KeyError
during container update on az containerapp update
#6712
Description
Describe the bug
When I run az containerapp update
the command fails with a KeyError, as you can see below. This wasn't happening with previous versions of containerapp
, and after some Investigation this has been introduced in a recent change in this repo. I've put the change in the "Additional context" section.
Related command
az containerapp update
Errors
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'value'
Traceback (most recent call last):
File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
return cmd_copy.exception_handler(ex)
File "/opt/az/azcliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
raise ex
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/opt/az/azcliextensions/containerapp/azext_containerapp/custom.py", line 582, in update_containerapp
return update_containerapp_logic(cmd=cmd,
File "/opt/az/azcliextensions/containerapp/azext_containerapp/custom.py", line 545, in update_containerapp_logic
containerapp_update_decorator.construct_payload()
File "/opt/az/azcliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1291, in construct_payload
super().construct_payload()
File "/opt/az/azcliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 765, in construct_payload
return self.set_up_update_containerapp_yaml(name=self.get_argument_name(), file_name=self.get_argument_yaml())
File "/opt/az/azcliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1169, in set_up_update_containerapp_yaml
_populate_secret_values(self.new_containerapp, secret_values)
File "/opt/az/azcliextensions/containerapp/azext_containerapp/_utils.py", line 1085, in _populate_secret_values
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
File "/opt/az/azcliextensions/containerapp/azext_containerapp/_utils.py", line 1085, in <genexpr>
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
KeyError: 'value'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
Error: Process completed with exit code 1.
Issue script & Debug output
cli.knack.cli: Command arguments: ['containerapp', 'update', '-g', '***', '-n', '***', '--yaml', '***', '--subscription', '***', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x100845630>, <function OutputProducer.on_global_arguments at 0x1009c1120>, <function CLIQuery.on_global_arguments at 0x1009f2320>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'containerapp': ['azure.cli.command_modules.serviceconnector', 'azext_containerapp']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: serviceconnector 0.234 16 235
cli.azure.cli.core: Total (1) 0.234 16 235
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: containerapp 0.130 42 132 /Users/***/.azure/cliextensions/containerapp
cli.azure.cli.core: Total (1) 0.130 42 132
cli.azure.cli.core: Loaded 57 groups, 367 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : containerapp update
cli.azure.cli.core: Command table: containerapp update
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x101557d90>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/***/.azure/commands/2023-08-31.12-38-34.containerapp_update.21580.log'.
az_command_data_logger: command args: containerapp update -g {} -n {} --yaml {} --subscription {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x10158c820>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x1015b2290>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x1015b23b0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x1009c11b0>, <function CLIQuery.handle_query_parameter at 0x1009f23b0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x1015b2320>]
az_command_data_logger: extension name: containerapp
az_command_data_logger: extension version: 0.3.38
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/***/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /Users/***/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/***/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/***/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/***/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: ***
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/***/providers/Microsoft.App?api-version=2022-09-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '***'
cli.azure.cli.core.sdk.policies: 'CommandName': 'containerapp update'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --yaml --subscription --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.3 (macOS-13.4.1-arm64-arm-64bit)'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/***/providers/Microsoft.App?api-version=2022-09-01 HTTP/1.1" 200 1546
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11997'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9327d192-1d36-4a79-aa28-a45962d8f85e'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9327d192-1d36-4a79-aa28-a45962d8f85e'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'BRAZILSOUTH:20230831T173834Z:9327d192-1d36-4a79-aa28-a45962d8f85e'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 31 Aug 2023 17:38:33 GMT'
cli.azure.cli.core.sdk.policies: 'Content-Length': '1546'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: ***redacted***
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/***/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/***/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/***/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 63964598-301d-499e-b543-c3e177b02932
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/***/providers/Microsoft.App?api-version=2022-09-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '***'
cli.azure.cli.core.sdk.policies: 'CommandName': 'containerapp update'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --yaml --subscription --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.3 (macOS-13.4.1-arm64-arm-64bit)'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/***/providers/Microsoft.App?api-version=2022-09-01 HTTP/1.1" 200 1546
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '***'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '***'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'BRAZILSOUTH:20230831T173835Z:***'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 31 Aug 2023 17:38:34 GMT'
cli.azure.cli.core.sdk.policies: 'Content-Length': '1546'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: ***redacted***
cli.azure.cli.core.util: Found subscription ID *** in the URL https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview
cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/, subscription ***
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/***/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/***/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/***/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: ***
cli.azure.cli.core.util: Request URL: 'https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview'
cli.azure.cli.core.util: Request method: 'GET'
cli.azure.cli.core.util: Request headers:
cli.azure.cli.core.util: 'User-Agent': 'python/3.10.3 (macOS-13.4.1-arm64-arm-64bit) AZURECLI/2.51.0'
cli.azure.cli.core.util: 'Accept-Encoding': 'gzip, deflate'
cli.azure.cli.core.util: 'Accept': '*/*'
cli.azure.cli.core.util: 'Connection': 'keep-alive'
cli.azure.cli.core.util: 'x-ms-client-request-id': 'c3b11eb6-2659-4fdf-b28e-cfb0e367e9b4'
cli.azure.cli.core.util: 'CommandName': 'containerapp update'
cli.azure.cli.core.util: 'ParameterSetName': '-g -n --yaml --subscription --debug'
cli.azure.cli.core.util: 'Authorization': 'Bearer eyJ0eXAiOiJKV...'
cli.azure.cli.core.util: Request body:
cli.azure.cli.core.util: None
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview HTTP/1.1" 200 None
cli.azure.cli.core.util: Response status: 200
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util: 'Cache-Control': 'no-cache'
cli.azure.cli.core.util: 'Pragma': 'no-cache'
cli.azure.cli.core.util: 'Transfer-Encoding': 'chunked'
cli.azure.cli.core.util: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.util: 'Content-Encoding': 'gzip'
cli.azure.cli.core.util: 'Expires': '-1'
cli.azure.cli.core.util: 'Vary': 'Accept-Encoding,Accept-Encoding'
cli.azure.cli.core.util: 'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.util: 'api-supported-versions': '2022-01-01-preview, 2022-03-01, 2022-06-01-preview, 2022-10-01, 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview'
cli.azure.cli.core.util: 'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.util: 'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.util: 'x-ms-request-id': '***'
cli.azure.cli.core.util: 'x-ms-correlation-request-id': '***'
cli.azure.cli.core.util: 'x-ms-routing-request-id': 'BRAZILSOUTH:20230831T173837Z:***'
cli.azure.cli.core.util: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.util: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.util: 'Date': 'Thu, 31 Aug 2023 17:38:37 GMT'
cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: ***redacted***
cli.azure.cli.core.util: Found subscription ID *** in the URL https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview
cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/, subscription ***
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/***/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/***/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/***/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/***/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 8c9b7c60-fd6a-43ba-ba28-586c2929dbce
cli.azure.cli.core.util: Request URL: 'https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview'
cli.azure.cli.core.util: Request method: 'GET'
cli.azure.cli.core.util: Request headers:
cli.azure.cli.core.util: 'User-Agent': 'python/3.10.3 (macOS-13.4.1-arm64-arm-64bit) AZURECLI/2.51.0'
cli.azure.cli.core.util: 'Accept-Encoding': 'gzip, deflate'
cli.azure.cli.core.util: 'Accept': '*/*'
cli.azure.cli.core.util: 'Connection': 'keep-alive'
cli.azure.cli.core.util: 'x-ms-client-request-id': '***'
cli.azure.cli.core.util: 'CommandName': 'containerapp update'
cli.azure.cli.core.util: 'ParameterSetName': '-g -n --yaml --subscription --debug'
cli.azure.cli.core.util: 'Authorization': 'Bearer ***'
cli.azure.cli.core.util: Request body:
cli.azure.cli.core.util: None
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/***/resourceGroups/***/providers/Microsoft.App/containerApps/***?api-version=2023-05-02-preview HTTP/1.1" 200 None
cli.azure.cli.core.util: Response status: 200
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util: 'Cache-Control': 'no-cache'
cli.azure.cli.core.util: 'Pragma': 'no-cache'
cli.azure.cli.core.util: 'Transfer-Encoding': 'chunked'
cli.azure.cli.core.util: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.util: 'Content-Encoding': 'gzip'
cli.azure.cli.core.util: 'Expires': '-1'
cli.azure.cli.core.util: 'Vary': 'Accept-Encoding,Accept-Encoding'
cli.azure.cli.core.util: 'x-ms-ratelimit-remaining-subscription-reads': '11998'
cli.azure.cli.core.util: 'api-supported-versions': '2022-01-01-preview, 2022-03-01, 2022-06-01-preview, 2022-10-01, 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview'
cli.azure.cli.core.util: 'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.util: 'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.util: 'x-ms-request-id': '***'
cli.azure.cli.core.util: 'x-ms-correlation-request-id': '***'
cli.azure.cli.core.util: 'x-ms-routing-request-id': 'BRAZILSOUTH:20230831T173839Z:***'
cli.azure.cli.core.util: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.util: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.util: 'Date': 'Thu, 31 Aug 2023 17:38:39 GMT'
cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: ***redacted***
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
return cmd_copy.exception_handler(ex)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 582, in update_containerapp
return update_containerapp_logic(cmd=cmd,
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 545, in update_containerapp_logic
containerapp_update_decorator.construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1291, in construct_payload
super().construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 765, in construct_payload
return self.set_up_update_containerapp_yaml(name=self.get_argument_name(), file_name=self.get_argument_yaml())
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1169, in set_up_update_containerapp_yaml
_populate_secret_values(self.new_containerapp, secret_values)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in _populate_secret_values
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in <genexpr>
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
KeyError: 'value'
cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: 'value'
Traceback (most recent call last):
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
return cmd_copy.exception_handler(ex)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 582, in update_containerapp
return update_containerapp_logic(cmd=cmd,
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 545, in update_containerapp_logic
containerapp_update_decorator.construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1291, in construct_payload
super().construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 765, in construct_payload
return self.set_up_update_containerapp_yaml(name=self.get_argument_name(), file_name=self.get_argument_yaml())
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1169, in set_up_update_containerapp_yaml
_populate_secret_values(self.new_containerapp, secret_values)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in _populate_secret_values
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in <genexpr>
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
KeyError: 'value'
az_command_data_logger: 'value'
Traceback (most recent call last):
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
return cmd_copy.exception_handler(ex)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
raise ex
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 582, in update_containerapp
return update_containerapp_logic(cmd=cmd,
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 545, in update_containerapp_logic
containerapp_update_decorator.construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1291, in construct_payload
super().construct_payload()
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 765, in construct_payload
return self.set_up_update_containerapp_yaml(name=self.get_argument_name(), file_name=self.get_argument_yaml())
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/containerapp_decorator.py", line 1169, in set_up_update_containerapp_yaml
_populate_secret_values(self.new_containerapp, secret_values)
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in _populate_secret_values
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
File "/Users/***/.azure/cliextensions/containerapp/azext_containerapp/_utils.py", line 1088, in <genexpr>
value["value"] = next(s["value"] for s in secret_values if s["name"] == value["name"])
KeyError: 'value'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10155c040>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 5.882 seconds (init: 0.142, invoke: 5.740)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 7214 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/bin/python3 /Users/***/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/telemetry/__init__.py /Users/***/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
Expected behavior
It should update the Container App, as it was with the previous versions of containerapp
. But instead, it's erroring out with a KeyError due to the secret_values
(List[Dict[str, str]
) having dictionaries with name
and not value
, like this: [{"name": "my-secret"}]
.
Environment Summary
azure-cli 2.51.0
core 2.51.0
telemetry 1.1.0
Extensions:
containerapp 0.3.38
Dependencies:
msal 1.24.0b1
azure-mgmt-resource 23.1.0b2
Python location '/Users//.asdf/installs/azure-cli/2.51.0/bin/venv/bin/python3'
Extensions directory '/Users//.azure/cliextensions'
Python (Darwin) 3.10.3 (main, Apr 28 2022, 19:15:59) [Clang 13.1.6 (clang-1316.0.21.2.3)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
I've added a comment in the file change introduced 3 days ago, that checks for the value of show_values
, which cannot be set with the az containerapp update
command (its a flag for secrets
). You can see the comment here: ac8bc6d#r126090624
Activity