Describe the bug
I was going through the module "Create serverless logic with Azure Functions" on Microsoft Learn. There I should create a Sandbox, which was done successfully
To Reproduce
Steps to reproduce the behaviour:
The following policy error is posted:
{
"telemetryId": "e531a41c-ef4d-441e-ad99-d63f023825b6",
"bladeInstanceId": "Blade_c922e6cf0d9d40c2964796537c243e49_6_0",
"galleryItemId": "MyGalleryItem",
"createBlade": "DeployToAzure",
"code": "InvalidTemplateDeployment",
"message": "The template deployment failed because of policy violation. Please see details for more information.",
"details": [
{
"code": "RequestDisallowedByPolicy",
"target": "ASP-Learn9ba362f406ed4d6fa0af9b5381-8ba3",
"message": "Resource 'ASP-Learn9ba362f406ed4d6fa0af9b5381-8ba3' was disallowed by policy. Policy identifiers: '[{\"policyAssignment\":{\"name\":\"AppService-SKU\",\"id\":\"/providers/Microsoft.Management/managementGroups/triplecrown2/providers/Microsoft.Authorization/policyAssignments/7bb64c0aa90247de8b4491c3\"},\"policyDefinition\":{\"name\":\"AppService-SKU\",\"id\":\"/providers/Microsoft.Management/managementGroups/604c1504-c6a3-4080-81aa-b33091104187/providers/Microsoft.Authorization/policyDefinitions/e790fdfe-5672-403f-9a29-e1aa564ac680\"}}]'.",
"additionalInfo": [
{
"type": "PolicyViolation",
"info": {
"policyDefinitionDisplayName": "AppService-SKU",
"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": "Y1",
"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": {}
}
}
]
}
]
}
Expected behavior
The resource should get created as expected
Screenshots


Desktop (please complete the following information):
Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).
The same seems to apply for the following module:
https://docs.microsoft.com/en-us/learn/modules/execute-azure-function-with-triggers/4-create-timer-trigger?pivots=powershell
I can work around this by choosing the F1 or D1 app service plan, but I think the problem would appear on any module for Azure Functions that suggests using the consumption plan.
I'm having the same problem. thanks for posting the workaround! I have wasted so much time today on this.
Thanks for providing this feedback. We have escalated to the appropriate teams and should resolve this issue shortly.
@adrianstevens or @jboeshart , can you help check the content instruction?
this problem seems to be pervasive across multiple exercises and modules
Thanks for the heads up on this. Currently investigating...
@SebastianSchuetze, @onetalltree if you have a chance can you give it another try? This should be fixed, you should now be allowed to create consumption tier Functions in our sandbox environment. Apologies for the issues here, but we appreciate you bringing this to our attention, so thank you!
It seems to be working ... I have done several exercises today and they all work now. Thanks!
Great, will close this for now but let us know if this pops up again (it shouldn't). Thanks for visiting Microsoft Learn!
@adrianstevens
Most helpful comment
@SebastianSchuetze, @onetalltree if you have a chance can you give it another try? This should be fixed, you should now be allowed to create consumption tier Functions in our sandbox environment. Apologies for the issues here, but we appreciate you bringing this to our attention, so thank you!