2017-08-08 96 views
1

我正嘗試使用其餘api更新創建的azure管理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": "[email protected]", 
       "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.'." 
    } 
} 

上午我做錯了什麼?

回答

1

有效載荷是無效的,它應該是相同的,與服務創建:

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

但重要的是它不支持改變APIM服務的主區域之上,你就必須創造新的服務和刪除舊的。

相關問題