[Containerapp] az containerapp env storage set: Support Azure Files storage authentication - #10250
Conversation
|
Hi Shichao Qiu (@ShichaoQiu), |
There was a problem hiding this comment.
Pull request overview
Adds Azure Files authentication via account keys, Key Vault secrets, and managed identities for managed environment storage.
Changes:
- Adds authentication parameters, validation, and payload construction.
- Updates the storage API version and documentation.
- Adds unit and live scenario coverage.
A blocking issue remains: changing the shared API version causes existing cassette-based scenarios to request a different version. Update affected recordings or mark those scenarios live-only.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Summary |
|---|---|
src/containerapp/HISTORY.rst |
Records the upcoming feature. |
src/containerapp/azext_containerapp/tests/latest/test_containerapp_env_storage_unit.py |
Tests validation and payloads. |
src/containerapp/azext_containerapp/tests/latest/test_containerapp_env_storage_auth.py |
Adds live authentication scenarios. |
src/containerapp/azext_containerapp/custom.py |
Extends the storage command signature. |
src/containerapp/azext_containerapp/containerapp_env_storage_decorator.py |
Implements authentication handling. |
src/containerapp/azext_containerapp/_params.py |
Registers preview CLI arguments. |
src/containerapp/azext_containerapp/_models.py |
Adds authentication payload fields. |
src/containerapp/azext_containerapp/_help.py |
Documents usage and prerequisites. |
src/containerapp/azext_containerapp/_clients.py |
Sets the managed storage API version; existing cassettes require updates or live-only handling. |
Suppressed comments (2)
src/containerapp/azext_containerapp/_models.py:515
- These fields are added to the shared
AzureFilePropertiesdict, whichconnected_env_create_or_update_storageuses directly and serializes without removing null values. That unrelated command never sets the new fields, so its requests now includeaccountKeyVaultProperties: nullandidentity: null, diverging from the connected-environment API payload and existing recording. Keep a managed-environment template separate or strip these fields from the connected-env payload.
"accountKeyVaultProperties": None,
"identity": None,
src/containerapp/azext_containerapp/containerapp_env_storage_decorator.py:77
- Starting from the module-level
AzureFilePropertiesis unsafe here:connected_env_create_or_update_storageuses and mutates the same dictionary (custom.py:2174-2178). If a connected-environment storage command runs earlier in the same process, itsaccountKeyremains set; the Key Vault and managed-identity branches below do not clear it, so this request can contain multiple authentication modes and be rejected. Build from a fresh template or clear all authentication fields before selecting the mode.
storage_def = deepcopy(AzureFileProperties)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Follow-up
The rerun now has both |
|
Containerapp |
az containerapp env storage set: Support Azure Files storage authentication
🤖 PR Validation —⚠️ Review suggested
🤖 PR Validation —⚠️ Review suggested
Summary
--azure-file-key-vault-secret-url,--azure-file-key-vault-identity, and--azure-file-identity.2026-03-02-previewand enforce mutually exclusive authentication modes.Storage File Data SMB MI Adminprerequisites.Testing
python -m compileall -q azext_containerapppython -m unittest discover -s azext_containerapp/tests/latest -p '*_unit.py' -v(29 passed)containerapp env storage set.CLITestLocation=northcentralusstageandazdev test {test-selector} --live --series:test_container_app_mount_azurefile_e2epassed.test_container_app_mount_nfsazurefile_e2epassed. The first attempt hit a transient AzureStorageAccountOperationInProgressresponse while creating Premium FileStorage; a clean retry with new resources passed.test_containerapp_env_storagepassed.test_containerapp_env_storage_auth_crudpassed.test_containerappjob_create_with_yamlpassed.test_containerapp_env_storageis decorated with@live_only, so playback skips it by design.Content-Lengthheaders.azdev scanat LOW, MEDIUM, and HIGH confidence on all five recordings: no findings.e6d1986f3.This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az containerapp env storage setGeneral Guidelines
azdev style containerapplocally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.