I am facing the issue only when I Deploy through ARM Template, when I try from portal its successful. I thought the issue might be with the version I am using so I have changed last 3 versions(https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/service/apis) in the template, still same issue. can some one please point me whats going wrong here? I have added minimal reproduction.
Swagger:
{
"openapi": "3.0.1",
"info": {
"title": "Test",
"description": "Test",
"version": "1.0"
},
"paths": {
"/api/v1/test": {
"get": {
"tags": [
"Test"
],
"summary": "Test",
"parameters": [
{
"name": "TestName",
"in": "query",
"schema": {
"minLength": 3,
"type": "string",
"nullable": true
}
}
],
"responses": {
"500": {
"description": "Server Error",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Error"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Error": {
"type": "object",
"properties": {
"errorCode": {
"type": "string",
"nullable": true
},
"errorDescription": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
}
}
ARM Template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ApimServiceName": {
"type": "string"
}
},
"resources": [
{
"properties": {
"serviceUrl": "https://test.url",
"path": "projects",
"value": ***"swaggerstorageaccounturl.json",***
"format": "swagger-link-json"
},
"name": "[concat(parameters('ApimServiceName'), '/Test')]",
"type": "Microsoft.ApiManagement/service/apis",
"apiVersion": "2020-06-01-preview",
"dependsOn": []
}
]
}
When I tried with the petstore example as mentioned here https://github.com/Azure/azure-quickstart-templates/blob/master/201-api-management-create-all-resources/azuredeploy.json#L139, its successful from the template as well as from the portal.