[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 9 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>
|
| 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', |
There was a problem hiding this comment.
| site_config = get_site_configs(cmd, resource_group_name, name, slot) | ||
| site_config.scm_type = 'LocalGit' | ||
| _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'create_or_update_configuration', slot, site_config) | ||
| logger.warning("Note: The default deployment branch is 'master'. If your local branch is 'main', " |
| linux_fx = getattr(site_config, 'linux_fx_version', '') or '' | ||
| stack_prefix = linux_fx.split('|')[0].upper() if '|' in linux_fx else '' | ||
| if stack_prefix in ('PYTHON', 'NODE', 'PHP'): | ||
| logger.warning( |
There was a problem hiding this comment.
If we add this warning log:
Pros:
Helps with deployment confusion when --help is not read
Cons:
- Logs even if SCM_DO_BUILD_DURING_DEPLOYMENT is already set. Could check app settings (extra API call) to suppress, but could add some latency.
- If WEBSITE_RUN_FROM_PACKAGE=1 is also set, it overrides SCM_DO_BUILD_DURING_DEPLOYMENT and Oryx won't run. The warning's guidance would be misleading in that case.
- Also logs when --type is not specified (artifact_type=None), which could include non-zip deploys. The stack check (PYTHON/NODE/PHP) mitigates most false positives since Java/.NET stacks won't match.
Open to removing the runtime warning and keeping only the help text guidance if the noise is a concern.
Good point - no ruby Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… static site fix, container warning, startup command clarification Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
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
| 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: SCM basic authentication must be enabled to use these credentials for deployment. |
There was a problem hiding this comment.
nit: maybe also suggest the command to enable basic auth?
There was a problem hiding this comment.
Added! To enable: az webapp update -g -n --basic-auth Enabled
| long-summary: | | ||
| Usage notes: | ||
| - If the app already exists, the existing SKU is kept — the --sku flag is ignored for existing apps. | ||
| - Progress messages appear as WARNING level — these are informational, not errors. |
There was a problem hiding this comment.
nit: maybe we can skip this about warning? this behaviour is common throughout CLI and not specific to this command
| Run this command with the --debug parameter to see the API calls and parameters values being used. | ||
| long-summary: | | ||
| Usage notes: | ||
| - If the app already exists, the existing SKU is kept — the --sku flag is ignored for existing apps. |
There was a problem hiding this comment.
vnit: extra hyphen after kept?
| 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: | |
There was a problem hiding this comment.
nit: maybe also add this as suggestion, since this command is likely to be used by someone deploying for the first time
Use az webapp list-runtimes to get the list of supported runtimes
|
|
||
| az webapp config appsettings set -g ResourceGroup -n AppName --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true | ||
|
|
||
| Alternatively, use 'az webapp up' which handles resource creation, zipping, and build automatically. |
There was a problem hiding this comment.
should we avoid suggesting webapp up here, these two commands are different use cases
There was a problem hiding this comment.
Removed webapp up suggestion
| Note: Progress messages may appear as WARNING level — these are informational and do not | ||
| indicate errors. | ||
| examples: | ||
| - name: Deploy a Python/Node.js app from a zip file (must enable build first). |
There was a problem hiding this comment.
(must enable build first)
looks a little confusing, maybe we can re-phrase something like
Enable remote build(platform side build) and deploy an app from a zip file
| with self.argument_context('appservice plan update') as c: | ||
| c.argument('sku', arg_type=sku_arg_type) | ||
| c.argument('sku', arg_type=sku_arg_type, | ||
| help='SKU of the app service plan. Use this to scale up (change machine size), e.g. --sku P1v3.') |
| c.argument('elastic_scale', arg_type=get_three_state_flag(), help='Enable or disable automatic scaling. Set to "true" to enable elastic scale for this plan, or "false" to disable elastic scale for this plan. The SKU must be a Premium V2 SKU (P1V2, P2V2, P3V2) or a Premium V3 SKU (P1V3, P2V3, P3V3)') | ||
| c.argument('max_elastic_worker_count', options_list=['--max-elastic-worker-count', '-m'], type=int, help='Maximum number of instances that the plan can scale out to. The plan must be an elastic scale plan.') | ||
| c.argument('number_of_workers', type=int, help='Number of workers to be allocated.') | ||
| c.argument('number_of_workers', type=int, help='Number of workers to be allocated. Use this to scale out (add instances), e.g. --number-of-workers 3.') |
There was a problem hiding this comment.
nit: scale out/in (add or remove instances)
| 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
| help="Set the OS type for the app to be created. Defaults to Linux for Python " | ||
| "and Node.js runtimes, and to Windows for .NET and ASP.NET runtimes. " | ||
| "Use 'linux' explicitly for .NET Linux deployments.") | ||
| 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.
nit, also suggest command to view available runtimes
az webapp list-runtimes
| plan=plan, | ||
| is_linux=_is_linux, | ||
| client=client) | ||
| if not _plan_was_provided: |
There was a problem hiding this comment.
nit: we can just check here if plan is None
| 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>
| c.argument('acr_identity', help='Accept system or user assigned identity which will be set for acr image pull. ' | ||
| 'Use \'[system]\' to refer system assigned identity, or a resource id to refer user assigned identity.') | ||
| c.argument('basic_auth', help='Enable or disable basic auth for both SCM and FTP Basic Auth Publishing Credentials. Defaults to Enabled if not specified. See https://aka.ms/app-service-basic-auth to learn more.', arg_type=get_enum_type(BASIC_AUTH_TYPES)) | ||
| c.argument('basic_auth', help='Enable or disable basic auth for both SCM and FTP Basic Auth Publishing Credentials. Disabled by default for new apps. See https://aka.ms/app-service-basic-auth to learn more.', arg_type=get_enum_type(BASIC_AUTH_TYPES)) |
There was a problem hiding this comment.
…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). |

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"