Azure / Azure/azure-cli-extensions

az webapp up fails to create a webapp & deploy code from a local workspace, does not run ORYX build in deployment anymore

Open
#3,448 2 comments 0 reactions 0 assignees View on GitHub
extension/webapp Service Attention Web Apps
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues)

### Extension name (the extension in question)
webapp

### Description of issue (in as much detail as possible)
**Up until a few weeks ago**, I was still able to run `az webapp` up to create a webapp and deploy code from a local workspace to the app, now it just fails because it fails to create an App Service plan. Here is the error:

```
code: RequestDisallowedByPolicy - , Resource **'_asp_Linux_westus_0' was disallowed** by policy. Policy identifiers: '[{"policyAssignment":{"name":"webapps-assignment","id":"/providers/Microsoft.Management/managementGroups/192fe359-e72a-fa7e-dcd5-95e985e7eac9/providers/Microsoft.Authorization/policyAssignments/webapps-assignment"},"policyDefinition":{"name":"app-service-sku-policy","id":"/providers/Microsoft.Management/managementGroups/learn-sandbox-prod/providers/Microsoft.Authorization/policyDefinitions/app-service-sku-policy"},"policySetDefinition":{"name":"webapps-initiative","id":"/providers/Microsoft.Management/managementGroups/learn-sandbox-prod/providers/Microsoft.Authorization/policySetDefinitions/webapps-initiative"}}]'.
```
The only way to get around this is to create an App Service on the Portal then re-run `az webapp up`, or deploy from VS Code. However, another error then surfaces: ORYX build no longer happens during the deployment like before, causing the app to fail with `modulenotfound error` after deployment when the app tries to import required modules. The only way to fix this is to manually add an app setting `ENABLE_ORYX_BUILD=true` to the App Service.

-----

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.