更新 Azure API 管理服务的位置时出错



我正在尝试使用 rest API 更新创建的 Azure 管理 API 服务实例的区域。

网址 -https://management.azure.com/subscriptions/b0474e6c-9d1c-4b84-87f5-27ef6aad5e5e/resourceGroups/res1/providers/Microsoft.ApiManagement/service/cloud1?api-version=2017-03-01

身体

{
"parameters": {
"serviceName": "cloud1",
"resourceGroupName": "res1",
"api-version": "2017-03-01",
"subscriptionId": "b0474e6c-9d1c-4b84-87f5-27ef6aad5e5e",
"parameters": {
"location": "North Central US"
}
},
"responses": {
"200": {
"id": "/subscriptions/b0474e6c-9d1c-4b84-87f5-27ef6aad5e5e/resourceGroups/res1/providers/Microsoft.ApiManagement/service/cloud1",
"name": "",
"type": "Microsoft.ApiManagement/service",
"tags": {},
"location": "Central US",
"etag": "AAAAAACYO/A=",
"properties": {
"publisherEmail": "",
"publisherName": "",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2017-02-14T04:33:06.0312071Z",
"gatewayUrl": "https://cloud1.azure-api.net",
"portalUrl": "https://cloud1.portal.azure-api.net",
"managementApiUrl": "https://cloud1.management.azure-api.net",
"scmUrl": "https://cloud1.scm.azure-api.net",
"hostnameConfigurations": [],
"staticIps": [
"40.66.160.152"
],
"additionalLocations": null,
"virtualNetworkConfiguration": null,
"customProperties": null,
"virtualNetworkType": "None"
},
"sku": {
"name": "Developer",
"capacity": 1
}
}
}
}

授权持有者 内容类型应用程序/json

我得到以下错误。

{
"error": {
"code": "InvalidRequestContent",
"message": "The request content was invalid and could not be deserialized: 'Could not find member 'parameters' on object of type 'ResourceDefinition'. Path 'parameters', line 2, position 15.'."
}
}

我做错了什么吗??

有效负载无效,它应该与服务创建相同:

{
"location": "westus",
"properties": {
"publisherEmail": "...",
"publisherName": "..."
},
"sku": {
"name": "Developer",
"capacity": 1
}
}

但最重要的是,不支持更改 APIM 服务的主区域,您必须创建新服务并删除旧服务。

相关内容

最新更新