Parameterising connections.json in Azure Logic Apps(Standard) for deployment via Azure DevOps

Aravind Dilip Kumar 0 Reputation points
2024-11-04T16:10:19.35+00:00

We have a logic app that is triggered by Service Bus Topic messages, and then connects to a Function App. For deployment to different environments we have parametrised the connections.json file as recommended here. But after deployment, the workflow fails to trigger and none of the messages are picked up from Service Bus.

Below is the connections.json file.

{
    "functionConnections": {
        "azureFunctionOperation": {
            "triggerUrl": "https://@appsetting('FUNCTIONAPPNAME').@appsetting('APPSERVICEENVIRONMENTNAME').appserviceenvironment.net/api/FunctionInApp",
            "authentication": {
                "name": "Code",
                "type": "QueryString",
                "value": "@appsetting('FunctionInApp_ConnectionKey')"
            },
            "displayName": "FunctionInApp-Connection",
            "function": {
                "id": "/subscriptions/@appsetting('SUBSCRIPTIONID')/resourceGroups/@appsetting('FUNCTIONAPPRESOURCEGROUPNAME')/providers/Microsoft.Web/sites/@appsetting('FUNCTIONAPPNAME')/functions/FunctionInApp"
            }
        }
    },
    "managedApiConnections": {},
    "serviceProviderConnections": {
        "FileSystem": {
            "displayName": "NASConnection",
            "parameterValues": {
                "mountPath": "@appsetting('FILESYSTEM_MOUNTPATH')"
            },
            "serviceProvider": {
                "id": "/serviceProviders/FileSystem"
            }
        },
        "serviceBus": {
            "displayName": "ServiceBusConnection",
            "parameterSetName": "connectionString",
            "parameterValues": {
                "connectionString": "@appsetting('SERVICEBUS_CONNECTIONSTRING')"
            },
            "serviceProvider": {
                "id": "/serviceProviders/serviceBus"
            }
        },
        "sql-2": {
            "displayName": "UserManagedIdentitySQlConnection",
            "parameterSetName": "ManagedServiceIdentity",
            "parameterValues": {
                "authProvider": {
                    "Type": "ManagedServiceIdentity"
                },
                "databaseName": "@appsetting('SQLDATABASENAME')",
                "managedIdentityClientId": "@appsetting('SQL_MANAGEDIDENTITYCLIENTID')",
                "managedIdentityType": "UserAssigned",
                "serverName": "@appsetting('SQLSERVERNAME').database.windows.net"
            },
            "serviceProvider": {
                "id": "/serviceProviders/sql"
            }
        }
    }
}



Have verified that all teh appsettings values are in place and when I use the portal view details screen all values are correctly displayed.

But when we try to manual make a change in the workflow and save it, it fails with the below error -

``

{
  "error": {
    "code": "WorkflowConnectionsInvalidConnectionValue",
    "message": "The 'functionConnections' property in connection.json has a value that cannot be parsed."
  }
}

We are unable to figure out any issues in the functionConnections property as mentioned in the error.

Could you please help us resolve the error ?

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

Accepted answer
  1. Ryan Hill 28,546 Reputation points Microsoft Employee
    2024-11-04T19:46:10.4066667+00:00

    Hey @Aravind Dilip Kumar

    It's worth a shot, but try enclosing your parameter in {} per Parameterizing Managed Connections with Logic Apps Standard - Microsoft Community Hub guide. No need to update parameter values.

    "azurequeues": {
      "api": {
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/providers/Microsoft.Web/locations/@{appsetting('WORKFLOWS_LOCATION_NAME')}/managedApis/azurequeues"
      },
      "connection": {
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourcegroups/@{appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/azurequeues-1"
      },
      "authentication": "@parameters('sql-std-Auth')",
      "connectionRuntimeUrl": "@parameters('sql-std-RuntimeUrl')"
    }
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.