User assigned managed identity with credentials ARM deployment of Data Factory using DevOps

SS23456 5 Reputation points
2023-05-12T07:07:36.9933333+00:00

I am trying to deploy Credentials associated with User assigned managed identity to higher environment via DevOps and ARM templates.

 

I get the error: User assigned identity does not belong to the resource you are deploying to

 

I want to parametrize the User assigned managed identity resource id which is there in the Credentials

 

I added:

"Microsoft.DataFactory/factories/credentials": { "properties": { "typeProperties": { "resourceid": "=" } } }

to my ARM template definition json in Data Factory.

I am still not getting the User assigned managed identity resource id as a parameter in the ARM file I exported.

Currently Data Factory is Generating & Exporting the ARM template for Credentials as:

CURRENT SCENARIO

{ "name": "[concat(parameters('factoryName'), '/<factoryname>')]", "type": "Microsoft.DataFactory/factories/credentials", "apiVersion": "2018-06-01", "properties": { "type": "ManagedIdentity", "typeProperties": { "resourceId": "/subscriptions/<subscriptionid>/resourcegroups/<resource group name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<managed identity name>" } }, "dependsOn": [] }

** EXPECTED SCENARIO

{ "name": "[concat(parameters('factoryName'), '/<factoryname>')]", "type": "Microsoft.DataFactory/factories/credentials", "apiVersion": "2018-06-01", "properties": { "type": "ManagedIdentity", "typeProperties": { "resourceId": [parameters('<parameter Name>')]" } }, "dependsOn": [] } 

Can Anyone please guide me what is to be changed in the ARM template Definition for the expected scenario?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,323 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Sedat SALMAN 14,155 Reputation points MVP
    2023-05-13T17:15:20.6266667+00:00

    To parameterize the resourceId of the Managed Identity in your ARM template, you would first need to add a parameter in the parameters section of your ARM template. Then, you can use this parameter in the resourceId field.

    Add a parameter for your Managed Identity resource ID.

    "parameters": {
        "managedIdentityResourceId": {
            "type": "string",
            "metadata": {
                "description": "Resource ID of the Managed Identity"
            }
        },
        // ... other parameters ...
    }
    
    

    Use the new parameter in the resourceId field

    {
        "name": "[concat(parameters('factoryName'), '/<factoryname>')]",
        "type": "Microsoft.DataFactory/factories/credentials",
        "apiVersion": "2018-06-01",
        "properties": {
            "type": "ManagedIdentity",
            "typeProperties": {
                "resourceId": "[parameters('managedIdentityResourceId')]"
            }
        },
        "dependsOn": []
    }
    
    

  2. Ciocan, Andrei-Cosmin 0 Reputation points
    2025-03-07T10:59:05.1566667+00:00

    Hello! Any update on this? I am facing the same issue...

    0 comments No comments

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.