-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[App Service] Fix #21907: az webapp config container set: preserve Key Vault references
#33071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3598,34 +3598,64 @@ def _redact_connection_strings(properties): | |||||||||||||
| APPSETTINGS_TO_MASK = ['DOCKER_REGISTRY_SERVER_PASSWORD'] | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| def _is_key_vault_reference(value): | ||||||||||||||
| """Check if a setting value is a Key Vault reference.""" | ||||||||||||||
| return isinstance(value, str) and value.strip().startswith('@Microsoft.KeyVault(') | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| def update_container_settings(cmd, resource_group_name, name, container_registry_url=None, | ||||||||||||||
| container_image_name=None, container_registry_user=None, | ||||||||||||||
| websites_enable_app_service_storage=None, container_registry_password=None, | ||||||||||||||
| multicontainer_config_type=None, multicontainer_config_file=None, | ||||||||||||||
| slot=None, min_replicas=None, max_replicas=None): | ||||||||||||||
| settings = [] | ||||||||||||||
| if container_registry_url is not None: | ||||||||||||||
| settings.append('DOCKER_REGISTRY_SERVER_URL=' + container_registry_url) | ||||||||||||||
| # Read existing app settings so we can preserve non-container settings and Key Vault references | ||||||||||||||
| existing_app_settings = _generic_site_operation(cmd.cli_ctx, resource_group_name, name, | ||||||||||||||
| 'list_application_settings', slot) | ||||||||||||||
| existing_properties = existing_app_settings.properties or {} | ||||||||||||||
|
Comment on lines
+3613
to
+3614
|
||||||||||||||
| 'list_application_settings', slot) | |
| existing_properties = existing_app_settings.properties or {} | |
| 'list_application_settings', slot) | |
| existing_properties = existing_app_settings.properties or {} | |
| if existing_app_settings.properties is None: | |
| existing_app_settings.properties = existing_properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update_container_settingsnow callslist_application_settingsunconditionally, even when no container app settings are being updated (e.g., onlycontainer_image_name/multicontainer/min/max are provided). This adds an extra network call on a hot command path; consider fetching existing app settings lazily only when needed (whencontainer_updateswill be applied and/or when ACR auto-detect needs to inspect existing DOCKER creds).