1

We have a logic app deployed in app service environment 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 ?

1

2 Answers 2

1

You need to use curly braces when using string interpolation.

This example from Microsoft shows you what to do.

{
   "serviceProviderConnections": {
      "serviceBus": {
         "parameterValues": {
            "connectionString": "@appsetting('serviceBus_connectionString')"
        },
        "serviceProvider": {
           "id": "/serviceProviders/serviceBus"
        },
        "displayName": "servicebus"
     }
   },
   "managedApiConnections": {
      "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"
         },
         "connectionRuntimeUrl": "@appsetting('BLOB_CONNECTION_RUNTIMEURL')",
         "authentication": "@parameters('blob_auth')"
      }
   }
}

Search for interpolated in this document ...

https://learn.microsoft.com/en-us/azure/logic-apps/create-parameters-workflows?tabs=standard#define-use-and-edit-parameters

Sign up to request clarification or add additional context in comments.

Comments

-1

You need to generate a Bicep supporter that generates a connections dynamically across environments.

Here's a demonstration about using it. Integrating API Connections into Standard Logic Apps with Bicep Scripts

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.