I've encountered a discrepancy in the validation of secret keys between the Azure Portal and the CLI. When using the Azure CLI, it appears that secret key names cannot exceed 20 characters in length. However, this restriction is not enforced when creating secrets through the Azure Portal.
Related command
az containerapp secret set \
--name $CONTAINER_NAME \
--resource-group $RESOURCE_GROUP \
--secrets "long-secret-key-12345=mySecretValue"
Errors
Secret names cannot be longer than 20. Please shorten long-secret-key-12345
Issue script & Debug output
az containerapp secret set \
--name $CONTAINER_NAME \
--resource-group $RESOURCE_GROUP \
--secrets "long-secret-key-12345=mySecretValue" --debug
cli.knack.cli: Command arguments: ['containerapp', 'secret', 'set', '--name', 'dev-nozomi-api', '--resource-group', 'dev-nozomi-backend', '--secrets', 'long-secret-key-12345=mySecretValue', '--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 0x104898220>, <function OutputProducer.on_global_arguments at 0x104a17380>, <function CLIQuery.on_global_arguments at 0x104a60ea0>]
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.104 36 115
cli.azure.cli.core: serviceconnector 0.013 16 235
cli.azure.cli.core: Total (2) 0.118 52 350
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.005 30 81 /Users/xxx/.azure/cliextensions/containerapp
cli.azure.cli.core: Total (1) 0.005 30 81
cli.azure.cli.core: Loaded 70 groups, 407 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 0x10617d080>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/xxx/.azure/commands/2024-01-24.10-31-56.containerapp_secret_set.43509.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.<locals>.add_subscription_parameter at 0x1061ba8e0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x1061ddc60>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x1061ddda0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x104a17420>, <function CLIQuery.handle_query_parameter at 0x104a60f40>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x1061ddd00>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/xxx/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /Users/xxx/.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/xxx/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/xxx/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/xxx/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/xxx/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/xxx/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/xxx/kerberos', 'tenant_region_scope': 'AS', '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: b39981db-74a6-45b6-b56d-52cfb4b7aa96
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxx/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': '5c69e7cc-ba58-11ee-8f5c-164711aa06ae'
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.56.0 (HOMEBREW) azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.11.7 (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/xxx/providers/Microsoft.App?api-version=2022-09-01 HTTP/1.1" 200 1907
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': '6bd18fad-945f-4344-b452-2ca7c0fed7b2'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '6bd18fad-945f-4344-b452-2ca7c0fed7b2'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'JAPANWEST:20240124T013156Z:6bd18fad-945f-4344-b452-2ca7c0fed7b2'
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': 'Wed, 24 Jan 2024 01:31:56 GMT'
cli.azure.cli.core.sdk.policies: 'Content-Length': '1907'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/xxx/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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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":"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"],"apiVersions":["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":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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-08-01-preview","capabilities":"None"},{"resourceType":"connectedEnvironments","locations":["North Central US","East US","East Asia","West Europe","Southeast Asia"],"apiVersions":["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":["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":["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":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["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"],"apiVersions":["2023-11-02-preview","2023-08-01-preview"],"defaultApiVersion":"2023-08-01-preview","capabilities":"None"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.56.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.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/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/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
return cmd_copy.exception_handler(ex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.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.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.56.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.56.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/containerapp/custom.py", line 3086, 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 long-secret-key-12345
cli.azure.cli.core.azclierror: Secret names cannot be longer than 20. Please shorten long-secret-key-12345
az_command_data_logger: Secret names cannot be longer than 20. Please shorten long-secret-key-12345
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10617d300>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 0.374 seconds (init: 0.060, invoke: 0.313)
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 3623 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /Users/xxx/.azure"
telemetry.process: Return from creating process
Expected behavior
If it's possible to allow registration of more than 20 characters, we should do it.
Describe the bug
I've encountered a discrepancy in the validation of secret keys between the Azure Portal and the CLI. When using the Azure CLI, it appears that secret key names cannot exceed 20 characters in length. However, this restriction is not enforced when creating secrets through the Azure Portal.
Related command
Errors
Secret names cannot be longer than 20. Please shorten long-secret-key-12345
Issue script & Debug output
Expected behavior
If it's possible to allow registration of more than 20 characters, we should do it.
Environment Summary
az --version azure-cli 2.56.0
core 2.56.0 telemetry 1.1.0
Extensions: containerapp 0.3.46
Dependencies: msal 1.24.0b2 azure-mgmt-resource 23.1.0b2
Python location '/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/bin/python' Extensions directory '/Users/s23735/.azure/cliextensions'
Python (Darwin) 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Additional context
related: https://github.com/microsoft/azure-container-apps/issues/209