# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
# ---

# ## Resources
# 1. [Linked Services in Azure Data Factory](https://docs.microsoft.com/en-us/azure/data-factory/v1/data-factory-introduction#linked-services)
# 1. [Execute Azure Machine Learning pipelines in Azure Data Factory and Synapse Analytics](https://docs.microsoft.com/en-us/azure/data-factory/transform-data-machine-learning-service)
# 1. [Give MSI permission to the Azure ML workspace](https://docs.microsoft.com/en-us/azure/synapse-analytics/machine-learning/quickstart-integrate-azure-machine-learning#give-msi-permission-to-the-azure-ml-workspace)
#

# # Connecting Azure Data Factory (ADF)
# Is this exercise we will establish a linked service  for our Azure Machine Learning (AML) workspace in Azure Data Factory (ADF). This will enable us to use the AML pipeline activity in ADF to orchestrate our machine learning process.
#
# Linked services are much like connection strings, which define the connection information that's needed for Data Factory to connect to external resources. Think of it this way: a linked service defines the connection to the data source and a dataset represents the structure of the data.

# ### Give MSI permission to the Azure ML workspace
#
# 1. Navigate to your Azure Machine Learning workspace resource in the Azure portal and select **Access Control**
# <br>
# <br>
# 1. Create a role assignment and add your ADF workspace Managed Service identity (MSI) as a **Contributor** of the Azure Machine Learning workspace. Note that this will require being an **Owner** of the resource group that the Azure Machine Learning workspace belongs to. If you have trouble finding your ADF workspace MSI, search for the name of the ADF workspace.
#
#     ![](./img/adfLinkService4.png)

# ### Create a linked service to AML Compute
# 1. Open **Manage > Connections - Linked services** in the studio
#
#     ![](./img/adfLinkService1.png)<!--Use four spaces to indent content between bullet points-->
# <br>
# <br>
# 1. In the "New linked service" pane, select **Compute > Azure Machine Learning**
#
#     ![](./img/adfLinkService2.png)
# <br>
# <br>
# 1. Fill out the form:
#
#     - Provide the details about the Azure Machine Learning workspace you want to link to. This includes details about subscription and workspace name.
#
#     - Select Authentication Method: **Managed Identity**
# <br>
# <br>
# 1. Click **Test Connection** to verify if the configuration is correct. If the connection test passes, click **Save**. Then **Publish** the changes in the workspace to save the newly created Linked Service
# <br>
# <br>
# If the connection test fails, make sure that the ADF workspace MSI has permissions to access this Azure Machine Learning workspace, and try again.
#
#     ![](./img/adfLinkService3.png)

StarcoderdataJupyterScriptsDedupFiltered