PUT /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}
/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2016-09-01
REST调用正文:
{
"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.'."
}
}
好的,这没有意义,让我们尝试删除“schema”属性,这就是我得到的:
{
"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?