Issue with Parameterizing Azure ML Linked Service in ADF

Sama Praveen Kumar Reddy 0 Reputation points
2025-02-13T03:20:59.63+00:00

Description:
I am facing an issue while migrating an Azure Data Factory (ADF) pipeline to a higher environment using a CI/CD pipeline.

In ADF, I have an Azure Machine Learning (Azure ML) activity that connects using an Azure ML linked service.

Currently, the values in the ML linked service are hardcoded.

While migrating the ADF pipeline using CI/CD, I am unable to create parameters for the Azure ML linked service to pass the values dynamically.

I want to configure the linked service to use system-assigned managed identity or service principal instead of hardcoded values.

Issue:

How can I parameterize the Azure ML linked service in ADF to support dynamic connections during CI/CD deployment?

What is the correct approach to passing authentication credentials dynamically using system-assigned managed identity or service principal in CI/CD?

Expected Outcome:

I need guidance on dynamically configuring the Azure ML linked service in ADF so that it works seamlessly across different environments during CI/CD deployment.

Any insights or best practices would be appreciated.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,201 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,376 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 18,876 Reputation points
    2025-02-13T12:21:26.9666667+00:00

    Hello Sama Praveen Kumar Reddy,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having issue with Parameterizing Azure ML Linked Service in ADF.

    Regarding your explanations, perform the steps to dynamically configure the Azure ML linked service in ADF and ensure seamless CI/CD deployment across different environments:

    1. Edit the JSON definition of the linked service to include parameters for servicePrincipalId, servicePrincipalKey, and tenant. For an example:
           {
             "name": "AzureMLLinkedService",
             "properties": {
               "type": "AzureML",
               "typeProperties": {
                 "servicePrincipalId": "@{linkedService().parameters.servicePrincipalId}",
                 "servicePrincipalKey": "@{linkedService().parameters.servicePrincipalKey}",
                 "tenant": "@{linkedService().parameters.tenant}"
               }
             }
           }
         
      
      https://learn.microsoft.com/en-us/azure/data-factory/parameterize-linked-services
    2. Use Azure Key Vault to:
      1. Store the service principal credentials in Azure Key Vault.
      2. Reference the secrets in the linked service using parameters.
    3. Enable System-Assigned Managed Identity to:
      1. Enable system-assigned managed identity for your ADF instance.
      2. Assign the necessary roles to the managed identity in Azure ML and other resources.

    Create a Service Principal:

    • Create a service principal in Azure Active Directory.
    • Assign the necessary roles to the service principal.
    • Store the service principal credentials in Azure Key Vault.
    1. CI/CD Pipeline Configuration: Use ARM templates to define your ADF pipeline and linked services. Parameterize the ARM templates to pass environment-specific values during deployment. Use Azure DevOps to deploy the ARM templates and pass the parameters dynamically.
    2. Best Practices are to: Use global parameters in ADF for common values. Ensure appropriate RBAC roles are assigned. Test the CI/CD pipeline in a lower environment before production deployment.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.