Share via

Importing DataFactory ARM Template failing for SQLServer ConnectionString

Pegoraro, Francesco 40 Reputation points
2023-09-07T16:16:25.0333333+00:00

I am trying to clone a DataFactory to a different ResourceGroup.

To do so I exported the ARM template from the source Resource Group and I would like to import it into the new one.

I read here that you also need to recreate any self-hosted IR:

If you have a SelfHosted IntegrationRuntime in your source factory, you need to precreate it with the same name in the target factory. If you want to share the SelfHosted Integration Runtime between different factories, you can use the pattern published here on sharing SelfHosted IR.

I opted for sharing the existing IR into the new one but it doesn't allow me to name it the same, so I added linked in the new IR name which was IRSQLServerOP (I am discussing this because it might be the cause of the problem...).

Then I went on and imported the template passing any password or connection string in the UI when suggested. After I start the deployment I get errors related to the failed import of SQL Servers datasets that use linked service nliSQLServerCon that in turn uses the infamous IRSQLServerOP.

This is the first error:

Failed to encrypt sub-resource payload {
  "Id": "/subscriptions/xxxxx/resourceGroups/target-rg/providers/Microsoft.DataFactory/
factories/target-df/linkedservices/nliSQLServerCon",
  "Name": "nliSQLServerCon",
  "Properties": {
    "annotations": [],
    "type": "SqlServer",
    "typeProperties": {
      "connectionString": "********************"
    },
    "connectVia": {
      "referenceName": "IRSQLServerOP"
      "type": "IntegrationRuntimeReference"
    }
  }
} and error is: Failed to encrypted linked service credentials on self-hosted IR 'IRSQLServerOP', 
reason is: NotFound, error message is: No online instance.. 
(Code: BadRequest, Target: /subscriptions/xxx/resourceGroups/target-rg/providers/Microsoft.DataFactory/
factories/target-df/linkedservices/nliSQLServerCon)

Any idea of what could be causing the issue? I also tried renaming all reference to IRSQLServerOP in the ARMTemplateForFactoryjson with linkedIRSQLServerOP but it gives an error like unable to change property.

Another possibility is that I am wrongly setting the SQLServer Connection String when asked:

User's image

because in the linked service from the UI is:

User's image

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

0 comments No comments

Answer accepted by question author

KranthiPakala-MSFT 46,827 Reputation points Moderator
2023-09-07T23:55:11.24+00:00

@Anonymous Welcome to Microsoft Q&A forum and thanks for reaching out here.

The error is because the SHIR does not exist in the target factory (SHIR cannot be created through ARM deployments, they have to be created manually in our UX or SDK and link them with shared IR as shown in the demo in this document).

Creating the SHIR manually in the target factory and retrying the deployment should help resolve the problem.

For detailed demonstration of how to share IR please refer to this : Shared Self Hosted Integration runtime in Azure Data Factory

In case if the target SHIR is created but throwing above error, then please check if your Shared IR status and Linked IR status in Online . If you notice the status is limited, then that is what causing the problem, please wait for the the SHIR status to be online.

I would also recommend going through this document related to SHIR encrytion details: Encrypt credentials for SHIR

Hope this info helps. Do let us know how it goes.


Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

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