APIManagementARMTemplateCreator
APIManagementARMTemplateCreator copied to clipboard
Named values used in backend definitions
DependsOn not set
When defining a backend and use a named value, that named value is extracted in the template. So far so good. But that backend is not set to depend on the same named value, leading to errors in deployment since the backend might be deployed before the named value is. Manually updating the template made it work just fine.
Original template code
(deleted some for readability)
{
"type": "Microsoft.ApiManagement/service/backends",
"name": "[concat(parameters('My_API_Service_name'), '/' ,'LogicAppName')]",
"apiVersion": "2019-01-01",
"properties": {
"url": "Long tings pointing to a logic app in this case",
"resourceId": "Pointing to said logic app",
"credentials": {
"query": {
"sig": [
"{{MyLogicAppKey}}"
]
},
"header": {}
},
"dependsOn": []
},
{
"type": "Microsoft.ApiManagement/service/namedValues",
"name": "[concat(parameters('My_API_Service_name'), '/', 'MyLogicAppKey')]",
"apiVersion": "2020-06-01-preview",
"properties": {
"displayName": "MyLogicAppKey",
"secret": true,
"value": "A long thing pointing to the signature in the Logic app"
},
"resources": [],
"dependsOn": []
}
My updated template code
(Just the affected part the post is getting too long)
{
"type": "Microsoft.ApiManagement/service/backends",
"name": "[concat(parameters('My_API_Service_name'), '/' ,'LogicAppName')]",
"apiVersion": "2019-01-01",
"properties": {
"url": "Long tings pointing to a logic app in this case",
"resourceId": "Pointing to said logic app",
"credentials": {
"query": {
"sig": [
"{{MyLogicAppKey}}"
]
},
"header": {}
},
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service/namedValues', parameters('My_API_Service_name'), 'MyLogicAppKey')]"
]
},
Hi! Having the same issue. @mikaelsand : did you find any solution for it or just went manual?
@MLogdberg : Something you have been looking into?
Sorry. I had to use the manual approach.