3

I have no knowledge of Microsoft Azure whatsoever.

I am following the Microsoft online Path "Azure fundamentals": https://learn.microsoft.com/en-us/learn/paths/azure-fundamentals/

For the third module, "Core Cloud Services - Introduction to Azure", for the first exercise "Exercise - Create a website hosted in Azure", I got stuck, unable to go through the exercise.

The error that I found is:

{"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"}]}]}

Any help will be much appreciated.

Thank you, Leo

2 Answers2

3

Welcome to Stack Overflow and Azure!

The reason you're getting this error is because as part of your exercise you're creating a MySQL resource and your Subscription Administrator has set a policy that disallows the creation of such resources.

You will need to contact your Subscription Administrator so that they can change the policy to allow creation of MySQL resources.

You can read more about Azure Policy here: https://learn.microsoft.com/en-us/azure/governance/policy/overview.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • 1
    Thank you so much. Yes, I just tried again the exercise now, and you are correct. I should have chosen the Database Provider as MySQL in App. Thank you. – leonardushutabarat May 24 '20 at 15:35
  • In my case I missed creating a new **App Service plan/location** which is explained in the next part. – Sadmi Jun 08 '20 at 16:24
  • Same here needed to choose this option "MySQL in App" – devops-admin Sep 28 '21 at 17:21
  • @Gaurav Mantri I am receiving same error creating wordpress in AZ900 material. i tried updating app-service-sku-policy assignment but it is not even letting me edit the definition. I also tried creating service plan. It throws error about RequestDisallowedByPolicy. Please advise. – kjosh Oct 09 '21 at 04:43
0

Should others see this error message - most likely because you are taking part of a Microsoft Learning Path, then ensure you have done exactly as described in the exercise.

So if for instance it says location needs to be westus2, then it should be west us 2 and not westus or westus3.

nelion
  • 1,712
  • 4
  • 17
  • 37