Unable to parameterize the connection.json from VS code - Logic App standard

Dhanalakshmi Hariharan 61 Reputation points
2021-08-17T14:04:50.563+00:00

Hi all,

Single tenant Logic app ( VS code) - I have parameterized the connection.json like as below .

{
"managedApiConnections":{
"azureeventgrid":{
"api":{
"id":”/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/providers/Microsoft.Web/locations/northcentralus/managedApis/azureeventgrid”
},
"authentication":{
"type":"ManagedServiceIdentity"
},
"connection":{
“id":”/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/azureeventgrid”
}
}
}

while trying to deploy the Logic app from VS code, I am getting Error as below . But same is working fine from Azure portal( updated @appsetting in connections under workflows) .
Issue is getting only while deploying from Visual studio code. Is any access policy to be setup for this? Any pointers would be helpful.

Error in creating access policy for connection in reference - 'azureeventgrid'. Error: Error in getting connection - /subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/azureeventgrid. Error: The provided subscription identifier '@appsetting('WORKFLOWS_SUBSCRIPTION_ID')' is malformed or invalid.

Thanks,
Dhana

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

6 answers

Sort by: Most helpful
  1. David Robinson 1 Reputation point
    2022-05-16T12:32:44.947+00:00

    I have something similar to the above when parameterising parameters.json in relation to KeyVault

    If I add the following to parameters.json, the Logic App workflow runs successfully but if I open it in the designer I cannot view the KeyVault action and in fact if I try and make changes it gives me an error about KeyVault tokens.
    "value": {
    "api": {
    "id": "/subscriptions/@appsetting('subscriptionId')/providers/Microsoft.Web/locations/@appsetting('resourceLocation')/managedApis/keyvault"
    },
    "connection": {
    "id": "/subscriptions/@appsetting('subscriptionId')/resourceGroups/@appsetting('resourceGroup')/providers/Microsoft.Web/connections/@appsetting('keyVaultId')"
    },

    If I add the following to parameters.json it allows me to view the Logic App workflow in the designer but when I run it I get 'The 'managedApiConnections' property in connection.json has a value that cannot be parsed'
    "value": {
    "api": {
    "id": "@appsetting('keyVaultApiId')"
    },
    "connection": {
    "id": "@appsetting('keyVaultConnectionId')"
    },

    So in the end I have two parameters.json, one for local dev that just has the strings without any @appsetting substitution that I can edit and run locally and then the other one for Azure environments that is setup as per the first parameterised snippet above. As part of our DevOps approach, we use this one for deployment.


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.