Error deploying parameterized connections.json
Does this occur consistently? Yes
- create entry in connections.json
"managedApiConnections": {
"azurefile": {
"api": {
"id": "/subscriptions/@parameters('SubscriptionId')/providers/Microsoft.Web/locations/germanywestcentral/managedApis/azurefile"
},
"authentication": {
"parameter": "@appsetting('BMVSTORAGE_KEY')",
"scheme": "Key",
"type": "Raw"
},
"connection": {
"id": "/subscriptions/@parameters('SubscriptionId')/resourceGroups/xxx-stage/providers/Microsoft.Web/connections/azurefile"
},
"connectionRuntimeUrl": "https://sss.03.common.logic-germanywestcentral.azure-apihub.net/apim/azurefile/xxx",
"displayName": "storage1"
}
},
Action: azureLogicAppsStandard.deploy Error type: Error Error Message: Error in creating access policy for connection in reference - 'azurefile'. Error: Error in getting connection - /subscriptions/@parameters('SubscriptionId')/resourceGroups/---/providers/Microsoft.Web/connections/azurefile. Error: The provided subscription identifier '@parameters('SubscriptionId')' is malformed or invalid.
Version: 1.0.12 OS: win32 OS Release: 10.0.22000 Product: Visual Studio Code Product Version: 1.64.2 Language: de
Call Stack
extension.bundle.js:2:4376961extension.bundle.js:2:4376961
rejected extension.bundle.js:2:4372108
processTicksAndRejections task_queues.js:93:5
The same works when editing connections.json in Azure portal.
@sven5, The error looks like the parameter value for subscription ID is not loaded. Could you provide more details on how you are providing the value to the parameter and how are you deploying the connection?
@ShreeDivyaMV Thanks for your reply.
The value is provided by parameters.json
"SubscriptionId": {
"type": "String",
"value": "@appsetting('WORKFLOWS_SUBSCRIPTION_ID')"
}
The connection was created manually while using the workflow designer. However, I currently changed this to deploy an ARM template through terraform. This has been successful.
To be more precise, it only doesn't work when using a parameter in the connection section.
Example:
This works
"azurefile": {
"api": {
"id": "/subscriptions/@parameters('SubscriptionId')/providers/Microsoft.Web/locations/germanywestcentral/managedApis/azurefile"
},
"authentication": {
"type": "ManagedServiceIdentity"
},
"connection": { "id": "/subscriptions/xxxxxxxx-8aa6-4f5d-b8f5-0090f37fda5b/resourceGroups/xxx-stage-connections/providers/Microsoft.Web/connections/azurefile" },
"connectionRuntimeUrl": "@appsetting('STORAGE_CONNECTION_RUNTIME_URL')",
"displayName": "storage1"
}
This does not work
"azurefile": {
"api": {
"id": "/subscriptions/@parameters('SubscriptionId')/providers/Microsoft.Web/locations/germanywestcentral/managedApis/azurefile"
},
"authentication": {
"type": "ManagedServiceIdentity"
},
"connection": { "id": "/subscriptions/@parameters('SubscriptionId')/resourceGroups/xxx-stage-connections/providers/Microsoft.Web/connections/azurefile" },
"connectionRuntimeUrl": "@appsetting('STORAGE_CONNECTION_RUNTIME_URL')",
"displayName": "storage1"
}
The error is even clearer when trying to parameterize the resource group:
Action: azureLogicAppsStandard.deploy
Error type: Error
Error Message: Error in creating access policy for connection in reference - 'azurefile'.
Error: Error in getting connection - /subscriptions/---/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/azurefile.
Error: Resource group '@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')' could not be found.
connections.json
"connection": { "id": "/subscriptions/xxxxxx-8aa6-4f5d-b8f5-0090f37fda5b/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/azurefile" },
it seems the code doesn't parse the expressions and that's why the connection identifier becomes invalid.
I have the exact same issue. I tried referencing both @appsetting and @parameters from the connections.json file
@Sven5, Sorry for the delay in getting back on this. Currently we have an issue with transitive reference of app settings in Parameters. The product group is working on the fix. As of now, the template doesn't work if,
- A Param in parameters.json which reads value from app-settings using @appsetting() expression
- Referring the above param in connections.json file using @parameters()
We would update this thread once it is fixed. Meanwhile please check if the app setting can be directly used in the template for this requirement.
@sven5 I was facing exactly same issue, referencing subscription and resource group from app settings directly works fine in connections.json
This works fine: "connection": { "id": "/subscriptions/@appsetting('AzSubscription')/resourceGroups/@appsetting('AzResourceGroup')/providers/Microsoft.Web/connections/azuredatafactory" },
While referencing subscription as @{appsetting('AzSubscription')} doesn't work.
@sven5, could you please let usknow if any further questions on this?
@ShreeDivyaMV Thanks, currently not. Would be glad if you could inform me when this is fixed.
Any update on this issue? I'm facing the same issue. Using a parameters for the connection ->id is giving problems (invalid connections). No problems when I use a parameter for the connectionRuntimeUrl for example.
Things I've tried:
@appsetting('ResourceGroup') @{appsetting('ResourceGroup')} @parameters('ResourceGroup') -> and reference in the parameters json to the appsetting
I've also added the full URL as parameter, without success.
Any other suggestions?
It's absolutely crucial that we can parameterize these values.
A workaround could be maintaining seperate connections.json files per environment and replace them in the pipeline, but this is not my preferred solution.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.