Unable to perform the Exercise - Create a website hosted in Azure

Sre Hari R 6 Reputation points
2021-03-20T11:36:08.327+00:00

I am trying to perform the Excercise - Create a website hosted in Azure, but it fails with the below error summary. Kindly assist. Resource ‘ServicePlanbcdbb059-88fa’was disallowed by policy. (Code: RequestDisallowedByPolicy) Initiative: web apps-assignment Policy: app-service-sku-policy Raw Error: {"telemetryId":"ca4febe1-4559-4ff9-8743-21b894f7c747","bladeInstanceId":"Blade_492c5a1def1b453e840ed16fcb88bfe2_16_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":"ServicePlanbcdbb059-88fa","message":"Resource 'ServicePlanbcdbb059-88fa' was disallowed by policy. (Code: RequestDisallowedByPolicy)","additionalInfo":[{"type":"PolicyViolation","info":{"policyDefinitionDisplayName":"app-service-sku-policy","policySetDefinitionDisplayName":"webapps-initiative","evaluationDetails":{"evaluatedExpressions":[{"result":"True","expressionKind":"Field","expression":"type","path":"type","expressionValue":"Microsoft.Web/serverfarms","targetValue":"Microsoft.Web/serverFarms","operator":"Equals"},{"result":"False","expressionKind":"Field","expression":"Microsoft.Web/serverfarms/sku.name","path":"sku.name","expressionValue":"S1","targetValue":["F1","D1","Y1"],"operator":"In"}]},"policyDefinitionId":"/providers/Microsoft.Management/managementGroups/learn-sandbox-prod/providers/Microsoft.Authorization/policyDefinitions/app-service-sku-policy","policySetDefinitionId":"/providers/Microsoft.Management/managementGroups/learn-sandbox-prod/providers/Microsoft.Authorization/policySetDefinitions/webapps-initiative","policyDefinitionReferenceId":"app-service-sku-policy_1","policySetDefinitionName":"webapps-initiative","policyDefinitionName":"app-service-sku-policy","policyDefinitionEffect":"Deny","policyAssignmentId":"/providers/Microsoft.Management/managementGroups/192fe359-e72a-fa7e-dcd5-95e985e7eac9/providers/Microsoft.Authorization/policyAssignments/webapps-assignment","policyAssignmentName":"webapps-assignment","policyAssignmentScope":"/providers/Microsoft.Management/managementGroups/192fe359-e72a-fa7e-dcd5-95e985e7eac9"}}],"policyDetails":[{"isInitiative":true,"assignmentId":"/providers/Microsoft.Management/managementGroups/192fe359-e72a-fa7e-dcd5-95e985e7eac9/providers/Microsoft.Authorization/policyAssignments/webapps-assignment","assignmentName":"webapps-assignment","auxDefinitions":[{"definitionName":"app-service-sku-policy","nonComplianceMessage":null}],"viewDetailsUri":"https://portal.azure.com#blade/Microsoft_Azure_Policy/EditAssignmentBladeV2/assignmentId/%2Fproviders%2FMicrosoft.Management%2FmanagementGroups%2F192fe359-e72a-fa7e-dcd5-95e985e7eac9%2Fproviders%2FMicrosoft.Authorization%2FpolicyAssignments%2Fwebapps-assignment"}]}]}

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
793 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Bodhik 106 Reputation points
    2021-06-01T12:20:25.763+00:00

    I had similar error when creating WordPress resource in sandbox account. When I check the app-service-sku-policy, it only allowing F1, D1, Y1 plans. So I created new plan with F1 plan (which is free) and it created resources straightaway. You can find the policy app-service-sky-policy in Policy service. ![101325-image.png][1] [1]: /api/attachments/101325-image.png?platform=QnA

    2 people found this answer helpful.

  2. tbgangav-MSFT 10,381 Reputation points
    2021-03-22T02:52:31.423+00:00

    Hi @Sre Hari R ,

    In general, we would see this error if there is a policy in your subscription which disallows the creation / updation of such resources. To be able to proceed further, you might have to disable that policy which was not allowing the successful deployment. For more information w.r.t retrieving details about the policy that blocked your deployment, please refer this article.

    If that's not the case then as the clean subscription / sandbox should work and if the exercise that you are trying is part of some certification / learning material then there might be issue with the order of the exercises. If so, Microsoft Certification / Exam / Learn related questions are currently not supported on this forum. It's better to reach out to dedicated forum over here / here.