政策不允许资源

Resource was disallowed by policy

我对 Microsoft Azure 一无所知。

我正在关注 Microsoft 在线路径 "Azure fundamentals": https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/

第三个模块"Core Cloud Services - Introduction to Azure",第一个练习"Exercise - Create a website hosted in Azure",我卡住了,无法完成练习。

我发现的错误是:

{"telemetryId":"88076050-7e0b-4188-ae04-c0ada8ca2356","bladeInstanceId":"Blade_c6f20ee47e4744ac91acec54dbd57a83_10002_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":"blogforleo-mysqldbserver","message":"Resource 'blogforleo-mysqldbserver' was disallowed by policy. (Code: RequestDisallowedByPolicy)","additionalInfo":[{"type":"PolicyViolation","info":{"policyDefinitionDisplayName":"Allowed resource types","policySetDefinitionDisplayName":"webapp","evaluationDetails":{"evaluatedExpressions":[{"result":"False","expressionKind":"Field","expression":"type","path":"type","expressionValue":"Microsoft.DBforMySQL/servers","targetValue":["microsoft.resources/resourcegroups","microsoft.storage/storageaccounts","microsoft.web/sites","microsoft.web/serverfarms","microsoft.documentdb/databaseaccounts","microsoft.insights/components","microsoft.keyvault/vaults","microsoft.cache/redis","microsoft.servicebus/namespaces","microsoft.servicebus/namespaces/authorizationrules","microsoft.servicebus/namespaces/queues","microsoft.servicebus/namespaces/queues/authorizationrules","microsoft.servicebus/namespaces/topics","microsoft.servicebus/namespaces/topics/authorizationrules","microsoft.servicebus/namespaces/topics/subscriptions","microsoft.servicebus/namespaces/topics/subscriptions/rules","microsoft.cognitiveservices/accounts","microsoft.web/sites/slots","microsoft.web/sites/slots/instances","microsoft.web/sites/slots/metrics","microsoft.web/sites/metrics","microsoft.web/sites/instances","microsoft.web/certificates","microsoft.portal/dashboards","microsoft.containerregistry/registries","microsoft.containerregistry/registries/webhooks","microsoft.web/connections","microsoft.logic/workflows","microsoft.web/customapis","microsoft.search/searchservices","microsoft.network/trafficmanagerprofiles","microsoft.sql/servers","microsoft.sql/servers/databases","microsoft.signalrservice/signalr","microsoft.apimanagement/service","microsoft.dbforpostgresql/servers","microsoft.dbforpostgresql/serversv2","microsoft.web/sites/slots/metricdefinitions","microsoft.web/sites/metricdefinitions","microsoft.web/serverfarms/workers","microsoft.cdn/profiles","microsoft.cdn/profiles/endpoints","microsoft.network/connections","microsoft.network/localnetworkgateways","microsoft.network/publicipaddresses","microsoft.network/virtualnetworkgateways","microsoft.network/virtualnetworks","microsoft.network/networksecuritygroups","microsoft.relay/namespaces","microsoft.datafactory/factories","microsoft.machinelearningservices/workspaces","microsoft.machinelearningservices/workspaces/computes","microsoft.web/staticsites","microsoft.alertsmanagement/smartdetectoralertrules","microsoft.insights/actiongroups"],"operator":"In"}]},"policyDefinitionId":"/providers/Microsoft.Authorization/policyDefinitions/a08ec900-254a-4555-9bf5-e42af04b5c5c","policySetDefinitionId":"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policySetDefinitions/f06460e7-86f9-42ad-8955-fb55bad92028","policyDefinitionReferenceId":"8272972042953317437","policySetDefinitionName":"f06460e7-86f9-42ad-8955-fb55bad92028","policyDefinitionName":"a08ec900-254a-4555-9bf5-e42af04b5c5c","policyDefinitionEffect":"deny","policyAssignmentId":"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policyAssignments/4a0a4629d22043e6a70a69f9","policyAssignmentName":"4a0a4629d22043e6a70a69f9","policyAssignmentDisplayName":"webapp","policyAssignmentScope":"/providers/Microsoft.Management/managementGroups/triplecrown2","policyAssignmentParameters":{}}}],"policyDetails":[{"isInitiative":true,"assignmentId":"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policyAssignments/4a0a4629d22043e6a70a69f9","assignmentName":"webapp","auxDefinitionNames":["Allowed resource types"],"viewDetailsUri":"https://portal.azure.com#blade/Microsoft_Azure_Policy/EditAssignmentBladeV2/assignmentId/%2Fproviders%2FMicrosoft.Management%2FmanagementGroups%2Ftriplecrown2%2Fproviders%2FMicrosoft.Authorization%2FpolicyAssignments%2F4a0a4629d22043e6a70a69f9"}]}]}

任何帮助将不胜感激。

谢谢, 狮子座

欢迎使用 Stack Overflow 和 Azure!

您收到此错误的原因是,作为练习的一部分,您正在创建 MySQL 资源,而您的订阅管理员设置了不允许创建此类资源的策略。

您需要联系您的订阅管理员,以便他们可以更改策略以允许创建 MySQL 资源。

您可以在此处阅读有关 Azure Policy 的更多信息:https://docs.microsoft.com/en-us/azure/governance/policy/overview