Parameters in connections.json for WorkFlows with Single Tenant Logic Apps Standard and Visual Studio Code

PingpongSet 36 Reputation points
2022-03-09T12:54:37.967+00:00

I want to replace hard coded strings in connections.json with parameters for connections in Logic App and Visual Studio Code.

Based on the link below

https://learn.microsoft.com/en-us/azure/logic-apps/create-parameters-workflows?tabs=standard#parameterize-connections-file

If I changed to like in 'connections.json' below:

  "azureblob": {  
     "api": {  
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/providers/Microsoft.Web/locations/@{appsetting('WORKFLOWS_LOCATION_NAME')}/managedApis/azureblob"  
     },  
     "connection": {  
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/@{appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/azureblob"  
     }  
  }  

I got the errors below on the Workflow designer in VS Code:

If use this:

 @{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}   

Error below:

The provided subscription identifier 'undefined' is malformed or invalid.

If I use this:

@appsetting('WORKFLOWS_SUBSCRIPTION_ID')  

Error below:

The provided subscription identifier '@appsetting('WORKFLOWS_SUBSCRIPTION_ID')' is malformed or invalid.

Refs:

https://learn.microsoft.com/en-us/answers/questions/517269/unable-to-parameterize-the-connectionjson-from-vs.html

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,996 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kamlesh Kumar 3,861 Reputation points
    2022-03-11T18:55:47.22+00:00

    Hi There,

    Thank you for asking this question on the Microsoft Q&A Platform.

    If you want to parameterize connections file then I would suggest to define the parameter key and then use that key in connections.json file. like below, it should work in VS code as well. But before adding these key, you have to define the Key in parameters.json file.

    Because to maintain the environment specific parameter file would be easier than making an entry in app setting.

       "azureblob": {
          "api": {
             "id": "/subscriptions/{@parameters('WORKFLOWS_SUBSCRIPTION_ID')}/providers/Microsoft.Web/locations/{@parameters('WORKFLOWS_LOCATION_NAME')}/managedApis/azureblob"
          },
          "connection": {
             "id": "/subscriptions/{@parameters('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/{@parameters('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/azureblob"
          }
       }
    

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    If this answer solved your problem, please click the Verify Answer button (found below the answer) to help other users who have the same question.

    0 comments No comments