2
votes

I am creating an ARM template to deploy the Data Factory. Everything is working fine except the self hosted Integration Runtime. I have one On-premise SQL Server and another On-premise Oracle DB. Both are connected using self hosted Integration Runtime. I am getting the below error while deploying the ARM template.

2018-08-13T14:11:34.9569812Z ##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
2018-08-13T14:11:34.9582896Z ##[error]Details:
2018-08-13T14:11:34.9587327Z ##[error]BadRequest: {
  "code": "BadRequest",
  "message": "Failed to encrypt sub-resource payload {\r\n  \"Id\": \"/subscriptions/bf2c5c07-2536-497d-9b87-7f0a0fa5a2b3/resourceGroups/ResourceGroup_Name/providers/Microsoft.DataFactory/factories/DataFactoryName/linkedservices/Oracle_Linked_ServiceName\",\r\n  \"Name\": \"Oracle_Linked_ServiceName\",\r\n  \"Properties\": {\r\n    \"type\": \"Oracle\",\r\n    \"typeProperties\": {\r\n      \"type\": \"********************\",\r\n      \"connectionString\": \"********************\"\r\n    },\r\n    \"connectVia\": {\r\n      \"referenceName\": \"IntegrationRuntime-Name\",\r\n      \"type\": \"IntegrationRuntimeReference\"\r\n    }\r\n  }\r\n} and error is: Failed to encrypted linked service credentials on self-hosted IR 'IntegrationRuntime-Name', reason is: NotFound, error message is: No online instance..",
  "target": "/subscriptions/bf2c5c07-2536-497d-9b87-7f0a0fa5a2b3/resourceGroups/ResourceGroup_Name/providers/Microsoft.DataFactory/factories/DataFactoryName/linkedservices/Oracle_Linked_ServiceName",
  "details": null,
  "error": null
} undefined
2018-08-13T14:11:34.9599952Z ##[error]BadRequest: {
  "code": "BadRequest",
  "message": "Failed to encrypt sub-resource payload {\r\n  \"Id\": \"/subscriptions/bf2c5c07-2536-497d-9b87-7f0a0fa5a2b3/resourceGroups/ResourceGroup_Name/providers/Microsoft.DataFactory/factories/DataFactoryName/linkedservices/Source_OnPremSQL\",\r\n  \"Name\": \"Source_OnPremSQL\",\r\n  \"Properties\": {\r\n    \"type\": \"SqlServer\",\r\n    \"typeProperties\": {\r\n      \"connectionString\": \"********************\",\r\n      \"username\": \"********************\",\r\n      \"password\": \"********************\"\r\n    },\r\n    \"connectVia\": {\r\n      \"referenceName\": \"IntegrationRuntime-Name\",\r\n      \"type\": \"IntegrationRuntimeReference\"\r\n    }\r\n  }\r\n} and error is: Failed to encrypted linked service credentials on self-hosted IR 'IntegrationRuntime-Name', reason is: NotFound, error message is: No online instance..",
  "target": "/subscriptions/bf2c5c07-2536-497d-9b87-7f0a0fa5a2b3/resourceGroups/ResourceGroup_Name/providers/Microsoft.DataFactory/factories/DataFactoryName/linkedservices/Source_OnPremSQL",
  "details": null,
  "error": null
} undefined
2018-08-13T14:11:34.9602482Z ##[error]Task failed while creating or updating the template deployment.
2018-08-13T14:11:34.9611870Z ##[section]Finishing: DataFactoryDeployment
2
Giving your complete template will be helpful.Joy Wang

2 Answers

1
votes

If you used a connection string and password to make your connection, then the ARM template will have them, so you need to fill the connection strings again based on what is expected from each connector.

I had the same issue and fixed by filling oracle connection string with this and Azure SQL connector with this(use the JSON value key as a template)

To get rid of this issue permanently I suggest you use the Azure Key Vault to store your credentials, so when a new import is needed, the ARM template will carry the secret keys, but not it's values.

PS: you need to authorize Data Factory to it to be able to access the stored credentials.

0
votes

Make sure your selfhosted IR is online. It is needed to encrypt your credentials.