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,075 questions
0 comments No comments
{count} vote

6 answers

Sort by: Most helpful
  1. Jitendra Kumar 6 Reputation points
    2022-10-26T09:08:05.957+00:00

    Change connection string in below format, it should be work from VS Code

    "outlook": {
    "api": {
    "id": "/subscriptions/7b71************b62b95****316a7/providers/Microsoft.Web/locations/centralus/managedApis/outlook"
    },
    "authentication": {
    "type": "ManagedServiceIdentity"

    },
    "connection": {
    "id": "/subscriptions/7b7*******************16a7/resourceGroups/RG-AIS-lapp/providers/Microsoft.Web/connections/outlook"
    },
    "connectionRuntimeUrl": "https://******e67.10.common.logic-centralus.azure-apihub.net/apim/outlook/ed41e635e******6729c8/",

    }  
    
    1 person found this answer helpful.
    0 comments No comments

  2. Ritu Raj 161 Reputation points
    2022-02-08T14:02:02.427+00:00

    Did anyone got this working ?
    I have a similar problem.

    0 comments No comments

  3. Dhanalakshmi Hariharan 61 Reputation points
    2022-02-14T10:18:16.99+00:00

    Still we have the same issue. we are unable to deploy from VS code.

    0 comments No comments

  4. Vijay Anand Muniyasamy 31 Reputation points Microsoft Employee
    2022-02-20T16:44:42.297+00:00

    The API id should be all string and it cannot accept params. I managed to have this running using this fix.
    "api":{
    "id":”/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/providers/Microsoft.Web/locations/northcentralus/managedApis/azureeventgrid”
    },


  5. Ruben Aster 1 Reputation point
    2022-05-09T10:01:10.78+00:00

    So in our Logic App connection JSON we have the following content:

    {
        "managedApiConnections": {
            "sftpwithssh_2": {
                "api": {
                    "id": "@appsetting('SFTP_CONNECTION_API_ID')"
                },
                "authentication": {
                    "type": "ManagedServiceIdentity"
                },
                "connection": {
                    "id": "@appsetting('SFTP_CONNECTION_RESOURCE_ID')"
                },
                "connectionRuntimeUrl": "@appsetting('SFTP_CONNECTION_RUNTIME_URL')"
            }
        }
    }
    

    When I save a workflow with an SFTP action I get the following error:

    WorkflowConnectionsInvalidConnectionValue","message":"The 'managedApiConnections' property in connection.json has a value that cannot be parsed."

    The app settings values are perfectly fine. When I insert them into the connection JSON manually I can save.

    Inside the action of the workflow designer I can navigate through the FTP server folders but maybe that's just because an older compilation with manually configured working connection.


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.