I am trying to create an API and operations in azure API management using the swagger import feature, using a template derived from the doumentation at https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2018-01-01/service/apis
Every time I deploy my API using my Azure Resource manager template to Azure API management I get the error 'path' must not be empty
. What am I doing wrong? Path is definitely not empty!
For this example you can just use any valid swagger file contents such as at https://petstore.swagger.io/v2/swagger.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"apim_name": {
"type": "string"
},
"api_name": {
"type": "string"
},
"swagger_json": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(parameters('apim_name'), '/' ,parameters('api_name'))]",
"apiVersion": "2018-06-01-preview",
"properties": {
"displayName": "Pet Store",
"description": "Cool api def",
"serviceUrl": "https://petstore.swagger.io/v2",
"path": "petstore",
"protocols": [
"https"
],
"authenticationSettings": {
"oAuth2": null,
"openid": null,
"subscriptionKeyRequired": true
},
"subscriptionKeyParameterNames": {
"header": "Ocp-Apim-Subscription-Key",
"query": "subscription-key"
},
"contentValue": "[parameters('swagger_json')]",
"contentFormat": "swagger-json"
}
}
]
}