Logic Apps to ADF - Error in connection

Kothai Ramanathan 946 Reputation points Microsoft Employee
2020-12-01T10:35:45.013+00:00

I am trying to connect to data factory from logic apps. I created a connection via the designer and tested that it is working fine. However, I converted the same to ARM template and the creation of the logic app was successful. When I see the action in the designer, I see the below :

43939-image.png

The error message is not very helpful and not sure what the error is. Can you please throw some light on this ?

This is the code of the action

{
"inputs": {
"body": {
"blobName": "test",
"interchangeId": "1234"
},
"host": {
"connection": {
"name": "@parameters('$connections')['ADFConnectionDetail']['connectionId']"
}
},
"method": "post",
"path": "@markus.bohland@hotmail.de ('/subscriptions/', subscription().id, '/resourcegroups/', resourceGroup().name, '/providers/Microsoft.DataFactory/factories/', parameters('DatafactoryName'), '/pipelines/', parameters('PipelineName'), '/CreateRun' )",
"queries": {
"x-ms-api-version": "2017-09-01-preview"
}
}
}

The status of the API connection of the data factory (in the logic app) is "Connected'.

Thanks,
Kothai

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,551 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,639 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2020-12-02T14:26:11.543+00:00

    Hi @Kothai Ramanathan

    Apology for the delay.

    Yes, you are correct that once you have updated the path to the right resource URL string then everything should be working as expected.
    The issue is that the path is not correctly formed as looks like you are using the ARM template parameters. You cannot use the ARM template variable for the logic app runtime. You need to create your own parameter when the operation is evaluating in runtime as in this scenario.

    "path": "@markus.bohland@hotmail.de ('/subscriptions/', subscription().id, '/resourcegroups/', resourceGroup().name, '/providers/Microsoft.DataFactory/factories/', parameters('DatafactoryName'), '/pipelines/', parameters('PipelineName'), '/CreateRun' )",

    At a deeper level in your logic app's resource definition, your workflow definition's parameters object declares parameters for the values to use at your logic app's runtime.

    One more observation when you export the ARM template then the path will be :

    "path": "/subscriptions/@{encodeURIComponent('yoursubscriptionID')}/resourcegroups/@{encodeURIComponent('yourresourcegroup')}/providers/Microsoft.DataFactory/factories/@{encodeURIComponent('yourdatafactory')}/pipelines/@{encodeURIComponent('yourpipelinename')}/CreateRun",

    I was able to repro the same issue if I change the path and it is not correctly formed and the designer shows the same issue as you have observed. Once I used the above the designer doesn't show any error.

    If you want to use your own parameter then you need to define parameters section under properties of your logic app resource as you have defined it for @parameters('$connections')['ADFConnectionDetail']['connectionId']

    References:
    https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-azure-resource-manager-templates-overview#template-parameters
    https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-actions-triggers

    Hope the above helps and please let me know if you have any queries.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


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.