Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

az containerapp secret set has an invalid low value for MAXIMUM_SECRET_LENGTH #29172

Closed jwhitley closed 5 months ago

jwhitley commented 5 months ago

Describe the bug

Assuming a Container App configured to point to a Container Registry:

  1. Refresh the Container Registry password that's used by the Container App (most likely just the credential "password").
  2. Attempt to use az containerapp secret set to update the Container App's secret with the new CR password

Just the first step creates a very poor situation where a previously running Container App fails in a somewhat obscure way due to its inability to access the registry. The Azure documentation handwaves around this setup, saying that it's automatic with no further details (e.g. maybe some kind of token-based access? who knows?). However, that's not true: it's just a regular secret on the Container App which isn't managed after resource creation time. THIS SHOULD BE EXPLICITLY DOCUMENTED.

Actual Result

The secret name used by the Container App for its associated Container Registry is auto-generated. In my current situation, the secret has form reg-pswd-12345678-ab12. The az containerapp secret set command would thus error out with:

Secret names cannot be longer than 20. Please shorten reg-pswd-12345678-ab12

This limitation is obviously wrong. I have numerous keys, both manually created and the Container App's auto-generated secret, which are longer than 20 characters. It's a terrible Catch-22, in that neither the UI nor the CLI are able to correctly update this credential – at least the CLI emits any error message whatsoever. The Portal UI simply reports success and fails to ever make the secret edit.

Related command

az containerapp secret set

Errors

Secret names cannot be longer than 20. Please shorten reg-pswd-12345678-ab12

Issue script & Debug output

cli.knack.cli: Command arguments: ['containerapp', 'secret', 'set', '--name', 'aperturprod', '--resource-group', 'pupilscreen-data-rg', '--secrets', 'REDACTED-LONG-SECRET-NAME=REDACTED-PASSWORD-VALUE', '--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 0x10552d6c0>, <function OutputProducer.on_global_arguments at 0x1055d8900>, <function CLIQuery.on_global_arguments at 0x1056063e0>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'containerapp': ['azext_containerapp', 'azure.cli.command_modules.containerapp', 'azure.cli.command_modules.serviceconnector'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: containerapp 0.175 36 115 cli.azure.cli.core: serviceconnector 0.018 20 307 cli.azure.cli.core: Total (2) 0.193 56 422 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.009 45 136 /Users/whitley/.azure/cliextensions/containerapp cli.azure.cli.core: Total (1) 0.009 45 136 cli.azure.cli.core: Loaded 88 groups, 529 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : containerapp secret set cli.azure.cli.core: Command table: containerapp secret set cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x106353420>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/whitley/.azure/commands/2024-06-14.12-13-49.containerapp_secret_set.47534.log'. az_command_data_logger: command args: containerapp secret set --name {} --resource-group {} --secrets {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x1063c4180>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x1063c4220>, <function register_cache_arguments..add_cache_arguments at 0x1063c4360>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x1055d89a0>, <function CLIQuery.handle_query_parameter at 0x105606480>, <function register_ids_argument..parse_ids_arguments at 0x1063c42c0>] cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/whitley/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /Users/whitley/.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: Initializing with Entra authority: https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88 msal.authority: openid_config("https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/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/3629a46c-6188-4557-82f2-cf562dceab88/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/3629a46c-6188-4557-82f2-cf562dceab88/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/3629a46c-6188-4557-82f2-cf562dceab88/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? None 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: a00d1075-8416-48ff-b40d-3f1faf6ef261 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/99b80f3f-19ec-4096-b748-acd4d087fd87/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': '3b18c88c-2a82-11ef-ad3b-824dbaae89fd' cli.azure.cli.core.sdk.policies: 'CommandName': 'containerapp secret set' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --resource-group --secrets --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.61.0 (HOMEBREW) azsdk-python-core/1.28.0 Python/3.11.9 (macOS-14.5-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/99b80f3f-19ec-4096-b748-acd4d087fd87/providers/Microsoft.App?api-version=2022-09-01 HTTP/1.1" 200 26118 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-Length': '26118' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '249' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-global-reads': '3749' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'd555576d-6f13-4893-8c4f-8abb0d680bd7' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'd555576d-6f13-4893-8c4f-8abb0d680bd7' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTUS2:20240614T191350Z:d555576d-6f13-4893-8c4f-8abb0d680bd7' 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: 'X-Cache': 'CONFIG_NOCACHE' cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: 8BC86C9609C3451E834D042573BBEB82 Ref B: CO6AA3150220027 Ref C: 2024-06-14T19:13:50Z' cli.azure.cli.core.sdk.policies: 'Date': 'Fri, 14 Jun 2024 19:13:49 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/99b80f3f-19ec-4096-b748-acd4d087fd87/providers/Microsoft.App","namespace":"Microsoft.App","authorizations":[{"applicationId":"7e3bc4fd-85a3-4192-b177-5b8bfc87f42c","roleDefinitionId":"39a74f72-b40f-4bdc-b639-562fe2260bf0"},{"applicationId":"3734c1a4-2bed-4998-a37a-ff1a9e7bf019","roleDefinitionId":"5c779a4f-5cb2-4547-8c41-478d9be8ba90"},{"applicationId":"55ebbb62-3b9c-49fd-9b87-9595226dd4ac","roleDefinitionId":"e49ca620-7992-4561-a7df-4ed67dad77b5","managedByRoleDefinitionId":"9e3af657-a8ff-583c-a75c-2fe7c4bcb635"},{"applicationId":"1459b1f6-7a5b-4300-93a2-44b4a651759f","roleDefinitionId":"3c5f1b29-9e3d-4a22-b5d6-9ff4e5a37974"}],"resourceTypes":[{"resourceType":"managedEnvironments","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"managedEnvironments/certificates","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"managedEnvironments/managedCertificates","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"containerApps","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"containerApps/privateEndpointConnectionProxies","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview"],"defaultApiVersion":"2023-11-02-preview","capabilities":"None"},{"resourceType":"managedEnvironments/privateEndpointConnectionProxies","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview"],"defaultApiVersion":"2023-11-02-preview","capabilities":"None"},{"resourceType":"spaces","locations":["Central US","East Asia","West Europe"],"apiVersions":["2023-11-02-preview"],"defaultApiVersion":"2023-11-02-preview","capabilities":"SupportsTags, SupportsLocation"},{"resourceType":"sessionPools","locations":["West US 2","North Europe","East US","East Asia","North Central US"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2024-02-02-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"jobs","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/managedEnvironmentOperationResults","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/managedEnvironmentOperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/containerappOperationResults","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/containerappOperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/containerappsjobOperationResults","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/containerappsjobOperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/sourceControlOperationResults","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/sourceControlOperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/usages","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview"],"defaultApiVersion":"2023-05-02-preview","capabilities":"None"},{"resourceType":"operations","locations":["Central US EUAP","East US 2 EUAP","West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2023-02-01","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-11-02-preview","capabilities":"None"},{"resourceType":"connectedEnvironments","locations":["North Central US","East US","East Asia","West Europe","Southeast Asia"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"connectedEnvironments/certificates","locations":["North Central US","East US","East Asia","West Europe","Southeast Asia"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations/connectedEnvironmentOperationResults","locations":["North Central US","East US","East Asia","West Europe","Southeast Asia"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/connectedEnvironmentOperationStatuses","locations":["North Central US","East US","East Asia","West Europe","Southeast Asia"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/managedCertificateOperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/billingMeters","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"locations/availableManagedEnvironmentsWorkloadProfileTypes","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"getCustomDomainVerificationId","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview"],"defaultApiVersion":"2023-05-02-preview","capabilities":"None"},{"resourceType":"builders","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2023-08-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"builders/builds","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2023-08-01-preview","capabilities":"None"},{"resourceType":"locations/OperationResults","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2023-08-01-preview","capabilities":"None"},{"resourceType":"locations/OperationStatuses","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2023-08-01-preview","capabilities":"None"},{"resourceType":"managedEnvironments/dotNetComponents","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview"],"defaultApiVersion":"2023-11-02-preview","capabilities":"None"},{"resourceType":"managedEnvironments/javaComponents","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-02-02-preview","2023-11-02-preview"],"defaultApiVersion":"2023-11-02-preview","capabilities":"None"},{"resourceType":"managedEnvironments/daprComponents","locations":["West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","West Central US","UK West","Central India","Italy North","Poland Central","South India"],"apiVersions":["2024-03-01","2024-02-02-preview","2023-11-02-preview","2023-08-01-preview","2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview","2022-03-01"],"defaultApiVersion":"2023-05-01","capabilities":"None"},{"resourceType":"functions","locations":["West Central US","West US 2","Southeast Asia","Sweden Central","Canada Central","West Europe","North Europe","East US","East US 2","East Asia","Australia East","Germany West Central","Japan East","UK South","West US","Central US","North Central US","South Central US","Korea Central","Brazil South","West US 3","France Central","South Africa North","Norway East","Switzerland North","UAE North","Canada East","UK West","Central India"],"apiVersions":["2024-02-02-preview"],"capabilities":"SupportsExtension"},{"resourceType":"logicApps","locations":[],"apiVersions":["2024-02-02-preview"],"capabilities":"SupportsExtension"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"} cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/containerapp/_client_factory.py", line 28, in _polish_bad_errors raise ex File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/containerapp/custom.py", line 3099, in set_secrets raise ValidationError(f"Secret names cannot be longer than {MAXIMUM_SECRET_LENGTH}. " azure.cli.core.azclierror.ValidationError: Secret names cannot be longer than 20. Please shorten reg-pswd-25642517-ac43

cli.azure.cli.core.azclierror: Secret names cannot be longer than 20. Please shorten reg-pswd-25642517-ac43 az_command_data_logger: Secret names cannot be longer than 20. Please shorten reg-pswd-25642517-ac43 cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1063536a0>] az_command_data_logger: exit code: 1 cli.main: Command ran in 0.527 seconds (init: 0.099, invoke: 0.428) 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 3958 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.61.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.61.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users/whitley/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

All valid keys are accepted by this tool.

Environment Summary

azure-cli 2.61.0

core 2.61.0 telemetry 1.1.0

Extensions: containerapp 0.3.52

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.1

Additional context

The incorrect code is this line at containerapp/_constants.py. I modified this code locally (arbitrarily to 32) and the update was successful, and my company was unblocked.

Related, others have hit this, evidenced by this unanswered Stack Overflow post.

yonzhan commented 5 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 5 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @calvinsID.