0

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.

Azure Logic Apps (std) for VS Code: v1.0.12

Refs:

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

https://github.com/Azure/logicapps/issues/494

Pingpong
  • 7,681
  • 21
  • 83
  • 209

1 Answers1

0

I had the same issue. The work around I found was to add the value as a parameter, then reference the parameter in the connections.json file.

E.g.,

"id": "/subscriptions/@parameters('WORKFLOWS_SUBSCRIPTION_ID')/providers/Microsoft.Web/locations/australiaeast/managedApis/sql"

Then in the parameters file you can reference the appsettings:

"WORKFLOWS_SUBSCRIPTION_ID": {
        "type": "string",
        "value": "@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}"
    }
Luke
  • 21
  • 2