[App Service] Add deployment guidance, warnings for Linux web apps#33088
[App Service] Add deployment guidance, warnings for Linux web apps#33088vageorge00 wants to merge 10 commits intoAzure:devfrom
Conversation
…Linux Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
️✔️AzureCLI-FullTest
|
|
Hi @vageorge00, |
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Azure Pipelines successfully started running 3 pipeline(s). |
| 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" |
There was a problem hiding this comment.
can we double check here on --startup-file
I think it might be reference to the startup script file itself instead of the actual command
There was a problem hiding this comment.
Thank you! Checked -> we are able to use startup file like "startup.sh" and also a command. Fixed, added example
| local_context_attribute=LocalContextAttribute(name='web_name', actions=[LocalContextAction.SET], | ||
| scopes=['webapp', 'cupertino'])) | ||
| c.argument('startup_file', help="Linux only. The web's startup file") | ||
| c.argument('startup_file', help="Linux only. The web's startup command. " |
There was a problem hiding this comment.
as mentioned previously, let's double check on this
is this property taking the script file as input or the actual command itself?
also, if you want to accept startup command, lets add a new param for it as this can be a breaking change if you modify existing param
There was a problem hiding this comment.
Double checked, it can be file or command, thanks! fixed
| app = client.web_apps.get(resource_group_name, name) | ||
| params.is_linux_webapp = is_linux_webapp(app) | ||
|
|
||
| # Warn interpreted-language Linux apps that zip deploy won't auto-build |
There was a problem hiding this comment.
curios what is the case of dotnet, does it auto build?
There was a problem hiding this comment.
Tested: .NET does auto-build with SCM_DO_BUILD_DURING_DEPLOYMENT=true. Without it, raw source gets copied but never compiled (app falls back to default placeholder). I have updated the warning to log for all Linux zip deploys, not just Python/Node/PHP. Good catch!
…ix, startup command clarification, scale up/down/in/out, runtime version updates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… for basic auth Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…add startup script example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@microsoft-github-policy-service agree company="Microsoft" |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
|
||
| Suggested next steps after creation: | ||
| - Deploy your code: | ||
| az webapp deploy -g MyResourceGroup -n MyAppName --src-path app.zip --type zip |
There was a problem hiding this comment.
--type zipis optional, and can be skipped if the file type is already a zip.
| 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. |
There was a problem hiding this comment.
One of the common issues while creating sites is not getting the --runtime (linuxfxversion) right. Maybe we can emphasize about az webapp list-runtimes as 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.
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
| "and Node.js runtimes, and to Windows for .NET and ASP.NET runtimes. " | ||
| "Use 'linux' explicitly for .NET Linux deployments. " | ||
| "Use 'az webapp list-runtimes' to see available runtimes.") | ||
| c.argument('runtime', options_list=['--runtime', '-r'], help="canonicalized web runtime in the format of Framework:Version, e.g. \"PHP:7.2\". " |
There was a problem hiding this comment.
PHP:7.2 has reached end of life, we should take this opportunity to move to Python, PYTHON:314 (latest)
…2 to PYTHON:3.14, add list-runtimes to create help Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Related command
az webapp create,az webapp deploy,az webapp up,az webapp delete,az webapp deployment source config-local-git,az appservice plan updateDescription
Fixes https://github.com/serverless-paas-balam/tuxedo/issues/119
Improves the Azure CLI experience for deploying Linux web apps by adding help text, runtime warnings.
Help text: Added deployment guidance to
az webapp create, SCM_DO_BUILD_DURING_DEPLOYMENT guidance toaz webapp deploy, OS/runtime/plan defaults toaz webapp up, branch convention toconfig-local-git, and scale up vs scale out toaz appservice plan update.Code: Added warning for container image path doubling when --container-image-name includes the registry host. Added runtime warnings for Linux zip deploy, OS type defaulting, runtime auto-detection, plan auto-generation, delete plan warning, and local-git branch convention.
Testing Guide
End-to-end agent tests across Python, .NET, Java, and containers confirmed all warnings fire correctly.
Manual end-end tests for logging changes:
az webapp create -g test-startup4-rg -n test-pr-container --plan test-startup4-plan --container-image-name docker.io/nginx:latest --container-registry-url docker.io
az webapp deployment source config-local-git -g test-container-rg -n test-container-app2
az webapp delete -g test-container-rg -n test-container-app3
We get added help/param info
az webapp create --help
History Notes
[App Service]
az webapp create: Add post-creation deployment guidance and startup command examples[App Service]
az webapp deploy: Add build automation guidance for Linux zip deployments[App Service]
az webapp up: Add logging for OS type, runtime auto-detection, and plan auto-generation[App Service] Add warning for container image path when
--container-image-nameincludes registry host[App Service]
az webapp delete: Add warning about App Service Plan deletionThe PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.
@microsoft-github-policy-service agree company="Microsoft"