Preserve App Service container configuration during deploy#9281
Conversation
Update container image references through the dedicated App Service configuration endpoint so unrelated settings remain intact. Make Python restore tests independent of the host PATH. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Updates App Service container deployment to preserve infrastructure-managed configuration.
Changes:
- Uses dedicated configuration endpoints for apps and slots.
- Verifies exact
linuxFxVersion-only PATCH payloads. - Makes Python restore tests independent of host PATH.
Show a summary per file
| File | Description |
|---|---|
cli/azd/pkg/azapi/webapp.go |
Patches container image configuration safely. |
cli/azd/pkg/azapi/webapp_test.go |
Tests endpoints and exact payloads. |
cli/azd/pkg/project/framework_service_python_test.go |
Mocks platform Python launchers. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Medium
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
jongio
left a comment
There was a problem hiding this comment.
Verified the switch to the /config/web PATCH endpoint (UpdateConfiguration / UpdateConfigurationSlot) sends only properties.linuxFxVersion, so acrUseManagedIdentityCreds and acrUserManagedIdentityID stay under IaC ownership. That matches the root cause in #9249, where the old site-level SitePatchResource PATCH treated the nested siteConfig as a replacement.
Confirmed those two call sites were the only users of the old pattern and both are converted, and the new exact-payload tests lock in the linuxFxVersion-only body. Ran the azapi container-image tests and the Python restore tests locally, all green. The Python launcher mock matches the first candidate the production lookup checks on each OS (py on Windows, python3 elsewhere).
Fixes #9249
Summary
This PR prevents container-based App Service deployments from clearing configuration owned by infrastructure or other tooling. It also makes the related Python restore tests deterministic on Windows.
Issue
Container deployment support added in #8847 was intended to update only
linuxFxVersion, but it sent that field as a nestedsiteConfigthrough the site-level PATCH operation. App Service can treat that nested object as a replacement, clearing omitted settings such asacrUseManagedIdentityCredsandacrUserManagedIdentityID.Configuration update
The image update now uses the dedicated App Service configuration endpoint for both production apps and deployment slots.
/config/webwith onlyproperties.linuxFxVersion.Behaviour at a glance
siteConfiglinuxFxVersionsiteConfiglinuxFxVersionWindows test isolation
The Python restore tests asserted the preferred platform launcher but allowed the mock command runner to inspect the host PATH. They now explicitly mock that launcher, preserving production fallback behavior while removing machine-dependent failures.
Testing
Covered production and slot request paths and exact field-only payloads, repeated the Python restore cases, and ran the affected API and project package tests.