与REST API创建资源组部署
问题描述:
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