How to add "secretName" parameter for Azure Data Lake Storage Gen2 linked service in Azure Data Factory?

Dina 0 Reputation points
2024-02-26T15:31:16.86+00:00

I have an Azure Data Lake Storage Gen2 linked service in the dev data factory environment and also in the prod environment. Below is the json of the dev linked service. The problem I have is that the secretName in the prod environment is different "AzureKeyvaultTestProd" than the one in the dev and I can not override this parameter in the release pipeline. The arm-template-definition.json is also below. How to override the secretName for the prod environment in the release pipeline?

"Microsoft.DataFactory/factories/linkedServices": {
        "*": {
            "properties": {
                "typeProperties": {
                    "accountName": "=",
                    "username": "=",
                    "userName": "=",
                    "accessKeyId": "=",
                    "endpoint": "=",
                    "servicePrincipalId": "=",
                    "userId": "=",
                    "host": "=",
                    "clientId": "=",
                    "clusterUserName": "=",
                    "clusterSshUserName": "=",
                    "hostSubscriptionId": "=",
                    "clusterResourceGroup": "=",
                    "subscriptionId": "=",
                    "resourceGroupName": "=",
                    "tenant": "=",
                    "dataLakeStoreUri": "=",
                    "baseUrl": "=",
                    "database": "=",
                    "serviceEndpoint": "=",
                    "batchUri": "=",
                    "poolName": "=",
                    "databaseName": "=",
                    "systemNumber": "=",
                    "server": "=",
                    "url": "=",
                    "functionAppUrl": "=",
                    "environmentUrl": "=",
                    "aadResourceId": "=",
                    "sasUri": "|:-sasUri:secureString",
                    "sasToken": "|",
                    "connectionString": "|:-connectionString:secureString",
                    "hostKeyFingerprint": "=",
                    "domain": "-",
                    "workspaceResourceId": "-",
                    "clusterId": "-",
                    "existingClusterId": "-",
                    "secretName":"-"
                }
            }
        },
        "Odbc": {
            "properties": {
                "typeProperties": {
                    "userName": "=",
                    "connectionString": {
                        "secretName": "="
                    }
                }
            }
        }
    },
{
    "name": "AzureDataLakeStorageGen2Test",
    "properties": {
        "annotations": [],
        "type": "AzureBlobFS",
        "typeProperties": {
            "url": "https://test.dfs.core.net",
            "accountKey": {
                "type": "AzureKeyVaultSecret",
                "store": {
                    "referenceName": "AzureKeyVaultTest",
                    "type": "LinkedServiceReference"
                },
                "secretName": "AzureDataLakeStorageGen2Test"
            }
        },
        "connectVia": {
            "referenceName": "TEST",
            "type": "IntegrationRuntimeReference"
        }
    }
}
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,521 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. QuantumCache 20,261 Reputation points
    2024-02-26T23:55:36.3566667+00:00

    Dina Did you try to use the Variable Group to pass the Secret value dynamically? You may also try the below suggestion,
    "secretName": "[if(equals(variables('Environment'), 'prod'), variables('SecretName'), 'AzureDataLakeStorageGen2Test')]"

    0 comments No comments

  2. Dina 0 Reputation points
    2024-02-27T09:08:51.38+00:00

    Can I add this ?: "AzureDataLakeStorageGen2Test", "properties": { "typeProperties": { "accountKey": { "secretName": "-" } } },


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.