我正在学习 Azure,作为学习练习,我需要创建一个 WordPress 网站。
我用这微软学习文档。
我激活了沙盒,但是在创建网站资源时,出现错误:
资源‘ServicePlan4b9381a9-93ea’不符合政策。
{
"telemetryId":"aea923d1-dbad-418d-aa94-0721bcdddc7d",
"bladeInstanceId":"Blade_36ae47db3af644939b1c1ed987ec8373_0_0",
"galleryItemId":"WordPress.WordPress",
"createBlade":"CreateBlade",
"code":"InvalidTemplateDeployment",
"message":"The template deployment failed because of policy violation. Please see details for more information.",
"details":[
{
"code":"RequestDisallowedByPolicy",
"target":"ServicePlan4b9381a9-93ea",
"message":"Resource 'ServicePlan4b9381a9-93ea' was disallowed by policy. (Code: RequestDisallowedByPolicy)",
"additionalInfo":[
{
"type":"PolicyViolation",
"info":{
"policyDefinitionDisplayName":"AppService-SKU",
"evaluationDetails":{
"evaluatedExpressions":[
{
"result":"True",
"expression":"type",
"path":"type",
"expressionValue":"Microsoft.Web/serverfarms",
"targetValue":"Microsoft.Web/serverFarms",
"operator":"Equals"
},
{
"result":"False",
"expression":"Microsoft.Web/serverfarms/sku.name",
"path":"sku.name",
"expressionValue":"S1",
"targetValue":[
"F1",
"D1"
],
"operator":"In"
}
]
},
"policyDefinitionId":"/providers/Microsoft.Management/managementGroups/604c1504-c6a3-4080-81aa-b33091104187/providers/Microsoft.Authorization/policyDefinitions/e790fdfe-5672-403f-9a29-e1aa564ac680",
"policyDefinitionName":"e790fdfe-5672-403f-9a29-e1aa564ac680",
"policyDefinitionEffect":"Deny",
"policyAssignmentId":"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policyAssignments/7bb64c0aa90247de8b4491c3",
"policyAssignmentName":"7bb64c0aa90247de8b4491c3",
"policyAssignmentDisplayName":"AppService-SKU",
"policyAssignmentScope":"/providers/Microsoft.Management/managementGroups/triplecrown2",
"policyAssignmentParameters":{
}
}
}
],
"policyDetails":[
{
"isInitiative":false,
"assignmentId":"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policyAssignments/7bb64c0aa90247de8b4491c3",
"assignmentName":"AppService-SKU",
"viewDetailsUri":"https://portal.azure.com#blade/Microsoft_Azure_Policy/EditAssignmentBlade/id/%2Fproviders%2FMicrosoft.Management%2FmanagementGroups%2Ftriplecrown2%2Fproviders%2FMicrosoft.Authorization%2FpolicyAssignments%2F7bb64c0aa90247de8b4491c3"
}
]
}
]
}
答案1
答案2
我发现默认情况下,服务计划的设置默认为“生产”。如果您选择“开发/测试”,则 S1 练习将按设计完成
答案3
沙箱仅提供对 Azure 中某些资源的访问……您收到的错误似乎是因为您选择的应用服务计划沙箱没有授予您使用权利。
您可以尝试选择其他应用服务计划吗?实验室指示保留默认的那个,但也许您需要选择另一个...如果您在选择任何应用服务计划时遇到相同的错误,则很可能是 Microsoft 授予您执行实验室的权限存在错误。