0
PUT /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}
/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2016-09-01
REST調用體:與REST API創建資源組部署
{
"properties": {
"template": {
"schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": []
}
}
}
這是一個最小的有效的JSON模板,如果我的要求去做,我得到:
{
"error": {
"code": "InvalidRequestContent",
"message": "The request content was invalid and could not be deserialized: 'Could not find member 'schema' on object of type 'Template'. Path 'properties.template.schema', line 4, position 16.'."
}
}
好吧,這沒有意義,就把讓我們試着刪除「模式」屬性,這是我得到:
{
"error": {
"code": "InvalidRequestContent",
"message": "The request content was invalid and could not be deserialized: 'Required property '$schema' not found in JSON. Path 'properties.template', line 6, position 4.'."
}
}
模板對象的架構在docs中沒有描述。那麼WTH?
你知道如何做新AzureRmResource一樣嗎? – 4c74356b41
'如何用New-AzureRmResource做同樣的事情?'你能解釋一下嗎? –
如何使用New-AzureRmResource創建部署,我試着做同樣的調用,但無法處理模板。我知道有一個cmdlet可以做到這一點,但這沒有問題 – 4c74356b41