When building Logic Apps in VS Code, there’s a key detail you should understand—especially when using the Designer. It’s not just about how the Designer looks but how it behaves depending on your setup.
Let’s say your Logic App needs to connect to an operation in API Management (APIM). The process is pretty straightforward:
- Search for the APIM connector in the Designer, select your APIM instance, give the connection a name, and choose the API you want to work with.
- This creates an entry like this in your
connections.json
:
"apiManagementConnections": {
"apiManagementOperation": {
"apiId": "/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxxxxxx/resourceGroups/test-dev-rg/providers/Microsoft.ApiManagement/service/apim-dev/apis/postapi",
"baseUrl": "https://apim-test.demo.pt/dev/operation/createpost",
"subscriptionKey": "@appsetting('apiManagementOperation_SubscriptionKey')",
"displayName": "CN-APIM"
}
}
Now, if you prefer using app settings instead of hardcoding values (which is a best practice), your connection would look like this:
"apiManagementConnections": {
"apiManagementOperation": {
"apiId": "@appsetting('post-api-Id')",
"baseUrl": "@appsetting('post-api-baseUrl')",
"subscriptionKey": "@appsetting('post-api-SubscriptionKey')",
"displayName": "CN-APIM",
"authentication": {
"type": "ManagedServiceIdentity"
}
}
}
Once you deploy your Logic App, make sure the app settings in the environment match the values you were previously hardcoding. Otherwise, your Logic App will not behave as expected.
Now, here’s a common gotcha: If you’re still developing and have already switched to using app settings, you might notice that the Designer stops working properly. That’s because the apiId
is now referencing a variable instead of a real API path. As a result, if you try to modify your Logic App—like adding variables or scopes—it might fail to save. Frustrating, right?
The fix is simple: just add those app setting values to your local local.settings.json
file. For example:
"post-api-Id": "/subscriptions/xxxx-xxxx-xxxx-xxxx-xxxxxxxx/resourceGroups/test-dev-rg/providers/Microsoft.ApiManagement/service/apim-dev/apis/postapi",
"post-api-baseUrl": "https://apim-test.demo.pt/dev/operation/createpost"
With this in place, the Designer will recognize the API again, and you’ll be able to make changes and save without issues.
Bonus tip:
- If your APIM lives in a different subscription than the rest of your resources, you can also update the
WORKFLOWS_SUBSCRIPTION_ID
value inlocal.settings.json
to match the subscription where your APIM is. That’ll solve the issue of the Designer not displaying your API correctly.
Hope you enjoyed this Friday Fact!
To lazy to read? We’ve got you covered! Check out our video version of this content!
Hope you find this helpful! If you enjoyed the content or found it useful and wish to support our efforts to create more, you can contribute towards purchasing a Star Wars Lego for Sandro’s son!