【发布时间】:2020-12-08 14:08:48
【问题描述】:
只有当我通过 ARM 模板部署时,当我从门户尝试成功时,我才会遇到这个问题。我认为问题可能与我正在使用的版本有关,所以我更改了模板中的最后 3 个版本(https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/service/apis),仍然是同样的问题。有人可以指出我这里出了什么问题吗?我添加了最小复制。
大摇大摆:
{
"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 模板
{
"$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": []
}
]
}
当我尝试使用此处提到的 petstore 示例https://github.com/Azure/azure-quickstart-templates/blob/master/201-api-management-create-all-resources/azuredeploy.json#L139 时,它从模板和门户都成功。
【问题讨论】:
标签: azure-devops openapi azure-api-management arm-template