-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[App Service] Add deployment guidance, warnings for Linux web apps #33088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
71da1e9
33aebce
0943802
b9f64fe
0b20483
b74571d
0718c9d
9213bb4
419f586
31bac46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1874,7 +1874,18 @@ | |
| helps['webapp create'] = """ | ||
| type: command | ||
| short-summary: Create a web app. | ||
| long-summary: The web app's name must be able to produce a unique FQDN as AppName.azurewebsites.net. | ||
| long-summary: | | ||
| The web app's name must be able to produce a unique FQDN as AppName.azurewebsites.net. | ||
| This command creates the web app resource but does not deploy code. | ||
| Use 'az webapp list-runtimes' to see available runtimes. | ||
| Suggested next steps after creation: | ||
| - Deploy your code: | ||
| az webapp deploy -g MyResourceGroup -n MyAppName --src-path app.zip | ||
| - For Linux apps loading large models or dependencies at startup, increase the container | ||
| start time limit (default 230s, max 1800s): | ||
| az webapp config appsettings set -g MyResourceGroup -n MyAppName --settings WEBSITES_CONTAINER_START_TIME_LIMIT=1800 | ||
| examples: | ||
| - name: Create a web app with the default configuration. | ||
| text: > | ||
|
|
@@ -1910,6 +1921,12 @@ | |
| - name: Create a web app with end-to-end encryption enabled and minimum TLS version 1.2 | ||
| text: > | ||
| az webapp create -g MyResourceGroup -p MyPlan -n MyUniqueAppName --end-to-end-encryption-enabled true --min-tls-version 1.2 | ||
| - name: Create a Linux Python web app with a custom startup command. | ||
| text: > | ||
| az webapp create -g MyResourceGroup -p MyLinuxPlan -n MyUniqueAppName --runtime "PYTHON:3.14" --startup-file "gunicorn --bind=0.0.0.0 app:app" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we double check here on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Checked -> we are able to use startup file like "startup.sh" and also a command. Fixed, added example |
||
| - name: Create a Linux Python web app with a startup script. | ||
| text: > | ||
| az webapp create -g MyResourceGroup -p MyLinuxPlan -n MyUniqueAppName --runtime "PYTHON:3.14" --startup-file "startup.sh" | ||
| """ | ||
|
|
||
| helps['webapp create-remote-connection'] = """ | ||
|
|
@@ -1985,7 +2002,10 @@ | |
|
|
||
| helps['webapp deployment list-publishing-credentials'] = """ | ||
| type: command | ||
| short-summary: Get the details for available web app publishing credentials | ||
| short-summary: Get the details for available web app publishing credentials. | ||
| long-summary: | | ||
| Note: These credentials require SCM basic authentication to be enabled. | ||
| To enable: az webapp update -g MyResourceGroup -n MyAppName --basic-auth Enabled | ||
| examples: | ||
| - name: Get the details for available web app publishing credentials (autogenerated) | ||
| text: az webapp deployment list-publishing-credentials --name MyWebapp --resource-group MyResourceGroup --subscription MySubscription | ||
|
|
@@ -2070,6 +2090,10 @@ | |
| helps['webapp deployment source config-local-git'] = """ | ||
| type: command | ||
| short-summary: Get a URL for a git repository endpoint to clone and push to for web app deployment. | ||
| long-summary: | | ||
| Note: The default deployment branch is 'master'. If your local branch is 'main', | ||
vageorge00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| either push with: git push azure main:master, or set the app setting | ||
| DEPLOYMENT_BRANCH=main to change the deployment branch. | ||
| examples: | ||
| - name: Get an endpoint and add it as a git remote. | ||
| text: > | ||
|
|
@@ -2592,6 +2616,10 @@ | |
| Each time the command is successfully run, default argument values for resource group, sku, location, plan, and name are saved for the current directory. | ||
| These defaults are then used for any arguments not provided on subsequent runs of the command in the same directory. Use 'az configure' to manage defaults. | ||
| Run this command with the --debug parameter to see the API calls and parameters values being used. | ||
| long-summary: | | ||
vageorge00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Usage notes: | ||
| - If the app already exists, the existing SKU is kept. The --sku flag is ignored for existing apps. | ||
| - Use 'az webapp list-runtimes' to see available runtimes. | ||
| examples: | ||
| - name: View the details of the app that will be created, without actually running the operation | ||
|
|
@@ -2603,6 +2631,12 @@ | |
| - name: Create a web app with a specified name | ||
| text: > | ||
| az webapp up -n MyUniqueAppName | ||
| - name: Deploy a Python app to Linux with explicit runtime and plan name. | ||
| text: > | ||
| az webapp up -n MyApp --runtime "PYTHON:3.14" --plan MyPlan --sku P1v3 | ||
| - name: Deploy a .NET app to Linux (must specify --os-type linux). | ||
| text: > | ||
| az webapp up -n MyDotnetApp --runtime "DOTNETCORE:10.0" --os-type linux --plan MyPlan | ||
| - name: Create a web app with a specified name and a Java 11 runtime | ||
| text: > | ||
| az webapp up -n MyUniqueAppName --runtime "java:11:Java SE:11" | ||
|
|
@@ -2674,6 +2708,9 @@ | |
| helps['webapp webjob'] = """ | ||
| type: group | ||
| short-summary: Allows management operations for webjobs on a web app. | ||
| long-summary: | | ||
| To create WebJobs, use the Azure portal. For more information and other options, | ||
| see: https://learn.microsoft.com/azure/app-service/webjobs-create | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be linux specific guidance, I assume windows would work if the command exists. If webjob management via CLI is not supported for linux then we may want to take action to not allow it at all.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to documentation, it looks like this guidance applies to both Linux and Windows, I don't see a way to create webjob using az cli command on Windows. But I can add, For Linux Apps: just to be safe? |
||
| """ | ||
|
|
||
| helps['webapp webjob continuous'] = """ | ||
|
|
@@ -3287,7 +3324,22 @@ | |
| helps['webapp deploy'] = """ | ||
| type: command | ||
| short-summary: Deploys a provided artifact to Azure Web Apps. | ||
| long-summary: | | ||
| Deploys a zip, war, jar, ear, static file, startup script, or library to an existing Azure Web App. | ||
| The web app must already exist — use 'az webapp create' to create one first. | ||
| IMPORTANT: Zip deployment does NOT automatically run build automation (dependency installation, | ||
| compilation, etc.). If your package is not pre-built, you must set the | ||
| app setting SCM_DO_BUILD_DURING_DEPLOYMENT=true before deploying: | ||
| az webapp config appsettings set -g ResourceGroup -n AppName --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true | ||
| Supported --type values: zip, war, jar, ear, lib, static, startup. | ||
| examples: | ||
| - name: Enable remote build and deploy an app from a zip file. | ||
| text: | | ||
| az webapp config appsettings set -g ResourceGroup -n AppName --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true | ||
| az webapp deploy -g ResourceGroup -n AppName --src-path app.zip | ||
| - name: Deploy a war file asynchronously. | ||
| text: az webapp deploy --resource-group ResourceGroup --name AppName --src-path SourcePath --type war --async true | ||
| - name: Deploy a static text file to wwwroot/staticfiles/test.txt | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the common issues while creating sites is not getting the
--runtime(linuxfxversion) right. Maybe we can emphasize aboutaz webapp list-runtimesas well along with deploy.Currently PHP:7.2 is listed as an example, let's move that to "PYTHON:3.14"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Added list-runtimes here, changed PHP:7.2 to PYTHON:3.14 in _params for az webapp create --runtime and az webapp up --runtime