Good afternoon,
I’m attempting to deploy an API to Azure API Management through an ARM template. To achieve this, I am using the Deploy an Azure Resource Manager template step.
The template is very simple, with just one apis resource, and I’m attempting to reference a swagger document for API configuration. However, the template parameter swaggerBlobUrl is not being substituted as I expect. It may be that my understanding of how I can do this is wrong.
To populate the Octopus parameter swaggerBlobUrl, I’m running a pre-deployment script and outputting the value to $OctopusParameters[“swaggerBlobUrl”]. My understanding from the docs is that pre-deployment scripts run before variable substitution, so I was expecting this to work.
Please find below snippets from my ARM template and the associated parameters file.
Resource from ARM template
"resources": [
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(parameters('apiManagementServiceName'), '/', parameters('apiName'))]",
"apiVersion": "2018-01-01",
"properties": {
"path": "[parameters('apiPath')]",
"contentFormat": "swagger-link-json",
"contentValue": "[parameters('swaggerBlobUrl')]"
}
}
]
Parameter declaration
},
"swaggerBlobUrl": {
"value": "#{swaggerBlobUrl}"
}