"azurerm data factory linked service azure blob storage" fails to pass the connection string correctly

Hi,

I have just reopened a bug issue on Github which was initially reported and resolved about a year ago. In brief, when I check the linked service code generated by Terraform, instead of getting

{
    "name": "ls-main-blob",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "annotations": [],
        "type": "AzureBlobStorage",
        "typeProperties": {
            "connectionString": "DefaultEndpointsProtocol=https;AccountName=sadatablob;",
            "encryptedCredential": "somecredentials"
        },
        "connectVia": {
            "referenceName": "managed-runtime",
            "type": "IntegrationRuntimeReference"
        }
    }
}

I get

{
    "name": "ls-main-blob",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "connectVia": {
            "referenceName": "managed-runtime",
            "type": "IntegrationRuntimeReference"
        },
        "type": "AzureBlobStorage",
        "typeProperties": {
            "connectionString": {
                "type": "SecureString",
                "value": "**********"
            },
            "servicePrincipalId": "",
            "servicePrincipalKey": {
                "type": "SecureString",
                "value": "**********"
            },
            "tenant": ""
        },
        "annotations": []
    }
}

Which uses the “**********” instead of the actual storage account name string when configuring the linked service.

Does anyone know any workaround until the bug is fixed?

1 Like

Hi Team, Any workaround for the issue mentioned above

Unfortunately, none @srinipradhu when using Terraform. It seems to be a problem on Azure backend side. We decided to use CLI to overwrite the linked service configuration:

az config set extension.use_dynamic_install=yes_without_prompt

az datafactory linked-service update --factory-name "${FACTORY_NAME}" \
--linked-service-name "${LINKED_SERVICE_NAME}" \
--resource-group "${RESOURCE_GROUP}" \
--set properties.connectionString="DefaultEndpointsProtocol=https;AccountName=${ACCOUNT_NAME};EndpointSuffix=core.windows.net;"

az datafactory linked-service update --factory-name "${FACTORY_NAME}" \
--linked-service-name "${LINKED_SERVICE_NAME}" \
--resource-group "${RESOURCE_GROUP}" \
--remove properties.servicePrincipalId

az datafactory linked-service update --factory-name "${FACTORY_NAME}" \
--linked-service-name "${LINKED_SERVICE_NAME}" \
--resource-group "${RESOURCE_GROUP}" \
--remove properties.servicePrincipalKey

az datafactory linked-service update --factory-name "${FACTORY_NAME}" \
--linked-service-name "${LINKED_SERVICE_NAME}" \
--resource-group "${RESOURCE_GROUP}" \
--remove properties.tenant
1 Like

Thanks for you update. can you details about how to use in cli

r u referring to use local exec provisioner ?

Not really, however, that could also work. We run the command on a self-hosted runner terminal which is an Ubuntu VM.