Repository navigation
[App Service] az webapp show-runtime-version: Add command to show the resolved Linux runtime version - #34444
[App Service] az webapp show-runtime-version: Add command to show the resolved Linux runtime version#34444faditawfik21 wants to merge 1 commit into
az webapp show-runtime-version: Add command to show the resolved Linux runtime version#34444Conversation
|
Thank you for your contribution faditawfik21! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🔵 Needs a closer look
The raw ARM runtimeVersion API has only mocked coverage, requiring service-owner confirmation of the 2024-11-01 endpoint, response schema, and unavailable-runtime behavior for production and deployment-slot resources.
No open issues 🎉
What changed in this PR
Adds the preview command az webapp show-runtime-version to App Service commands, exposing the platform-resolved Linux runtime stack and patch version without requiring an SSH session.
Changes:
- Retrieves runtime information for web apps and deployment slots, with Linux validation and errors for unavailable information.
- Adds command arguments, help examples, and table formatting.
- Adds mocked tests for successful responses, error handling, slot targeting, and CLI output.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py |
Adds runtime-version and CLI invocation tests. |
src/azure-cli/azure/cli/command_modules/appservice/custom.py |
Implements runtime retrieval, validation, and error handling. |
src/azure-cli/azure/cli/command_modules/appservice/commands.py |
Registers the preview command and table formatter. |
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Defines web app name and slot arguments. |
src/azure-cli/azure/cli/command_modules/appservice/_help.py |
Documents the command with app and slot examples. |
Review effort: Balanced
|
Hi faditawfik21, |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Commenter does not have sufficient privileges for PR 34444 in repo Azure/azure-cli |
Adds the preview 'az webapp show-runtime-version' command to query the platform-resolved Linux runtime stack and patch version via the ARM /runtimeVersion endpoint (AB#40698179). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8175f4d to
fec360b
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
| slot_segment = '/slots/{}'.format(quote(slot, safe='')) if slot else '' | ||
| arm_url = ( | ||
| '{rm}/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web' | ||
| '/sites/{name}{slot_seg}/runtimeVersion?api-version={ver}' |
There was a problem hiding this comment.
Correct me if I'm wrong - wasn't Byron's ask to have role instance to runtime version mapping? https://msazure.visualstudio.com/Antares/_workitems/edit/40698179
Doesn't this call the app-level /runtimeVersion once, and therefore we only get the runtime of the instance selected by the service?
There was a problem hiding this comment.
You're right, that was the original plan, but based on a discussion with Tulika, Surender, and Gillian we decided to skip the per-instance backend changes for now and just use the existing /runtimeVersion API to get this out sooner.
|
Jordan Selig (@seligj95) could you please take a look when you get a chance? |
🤖 PR Validation —⚠️ Review suggested
Related command
az webapp show-runtime-versionDescription
Adds a new preview command
az webapp show-runtime-versionto retrieve the platform-resolved Linux runtime stack and patch version currently running on a web app or deployment slot (for example,PYTHON-3.12.7) viaGET .../sites/{name}[/slots/{slot}]/runtimeVersion?api-version=2024-11-01.Today, inspecting the actual patch version selected by Linux App Service after platform stack updates requires opening an SSH session into the container. This command surfaces the live resolved runtime version directly from the CLI (json, tsv, and table output), validates that the target is a Linux web app, and returns clear error messages when runtime version info is unavailable (such as custom container images or apps that have not started yet).
Fixes AB#40698179
Testing Guide
Validation run locally:
azdev style appservice(pylint + flake8 passed)azdev test test_webapp_commands_thru_mock --discover(all tests passed, including 8 new unit and CLI invocation tests inTestShowWebappRuntimeVersionMocked)History Notes
[App Service]
az webapp show-runtime-version: Add preview command to show the resolved platform runtime version running on a Linux web appThis checklist is used to make sure that common guidelines for a pull request are followed.
The 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.