Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

az containerapp ingress cors enable #27262

Closed alexander-kastil closed 8 months ago

alexander-kastil commented 1 year ago

Describe the bug

When trying to enable cors on an existing container app using Azure CLI it throws an error. When adding --allow-credentials which is not a required param in the docs it works

Is this by design or the docs are wrong?

Related command

grp=az-native-$env appApi=config-api az containerapp ingress cors enable -n $appApi -g $grp --allowed-origins *

az containerapp ingress cors enable -n $appApi -g $grp --allowed-origins * --allow-credentials true

Errors

Bad Request({"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-93ce0f652c1c84bcaa419980c77c0d94-f0fd1cd8aeea679a-01","errors":{"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]}})

Issue script & Debug output

cli.knack.cli: Command arguments: ['containerapp', 'ingress', 'cors', 'enable', '-n', 'config-api', '-g', 'az-native-dev', '--allowed-origins', '_images', 'config-api', 'config-ui', 'publish-containers.azcli', 'readme.md', '--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 0x7f94e33a93f0>, <function OutputProducer.on_global_arguments at 0x7f94e3304310>, <function CLIQuery.on_global_arguments at 0x7f94e311d510>] 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.453 16 235 cli.azure.cli.core: Total (1) 0.453 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.440 42 129 /home/alex/.azure/cliextensions/containerapp cli.azure.cli.core: Total (1) 0.440 42 129 cli.azure.cli.core: Loaded 57 groups, 364 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : containerapp ingress cors enable cli.azure.cli.core: Command table: containerapp ingress cors enable cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f94e24ead40>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/alex/.azure/commands/2023-08-25.10-41-36.containerapp_ingress_cors_enable.4939.log'. az_command_data_logger: command args: containerapp ingress cors enable -n {} -g {} --allowed-origins {} {} {} {} {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f94e2503880>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f94e254d6c0>, <function register_cache_arguments..add_cache_arguments at 0x7f94e254d7e0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f94e33043a0>, <function CLIQuery.handle_query_parameter at 0x7f94e311d5a0>, <function register_ids_argument..parse_ids_arguments at 0x7f94e254d750>] az_command_data_logger: extension name: containerapp az_command_data_logger: extension version: 0.3.37 cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient cli.azure.cli.core.auth.persistence: build_persistence: location='/home/alex/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /home/alex/.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/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/kerberos', 'tenant_region_scope': 'EU', '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: e6868379-f49f-4d90-8d56-93c05be8074f cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/78033352-805c-4acd-af80-f8f95083268d/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': '32dc791d-4323-11ee-a2ce-03a15b587398' cli.azure.cli.core.sdk.policies: 'CommandName': 'containerapp ingress cors enable' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-n -g --allowed-origins --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.51.0 (DEB) azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31)' 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/78033352-805c-4acd-af80-f8f95083268d/providers/Microsoft.App?api-version=2022-09-01 HTTP/1.1" 200 1547 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': '11995' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9c5ce6d9-9a42-455b-a009-7b94d347ddcb' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9c5ce6d9-9a42-455b-a009-7b94d347ddcb' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'GERMANYWESTCENTRAL:20230825T084140Z:9c5ce6d9-9a42-455b-a009-7b94d347ddcb' 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': 'Fri, 25 Aug 2023 08:41:40 GMT' cli.azure.cli.core.sdk.policies: 'Content-Length': '1547' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/78033352-805c-4acd-af80-f8f95083268d/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"}],"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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, 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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["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"],"apiVersions":["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","2022-01-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"None"},{"resourceType":"connectedEnvironments","locations":["North Central US","East US","East Asia","West Europe"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"connectedEnvironments/certificates","locations":["North Central US","East US","East Asia","West Europe"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations/connectedEnvironmentOperationResults","locations":["North Central US","East US","East Asia","West Europe"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","capabilities":"None"},{"resourceType":"locations/connectedEnvironmentOperationStatuses","locations":["North Central US","East US","East Asia","West Europe"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview","2023-05-01","2023-04-01-preview","2022-11-01-preview","2022-10-01","2022-06-01-preview"],"defaultApiVersion":"2023-04-01-preview","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"],"apiVersions":["2023-05-02-preview"],"defaultApiVersion":"2023-05-02-preview","capabilities":"None"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"} cli.azure.cli.core.util: Found subscription ID 78033352-805c-4acd-af80-f8f95083268d in the URL https://management.azure.com/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-preview cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/, subscription 78033352-805c-4acd-af80-f8f95083268d 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/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/kerberos', 'tenant_region_scope': 'EU', '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: 5eaca4d8-c5cd-4640-9dea-ab6a67e33bf8 cli.azure.cli.core.util: Request URL: 'https://management.azure.com/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-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.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31) AZURECLI/2.51.0 (DEB)' 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': '328766a9-83e5-4def-a8ad-bb206ea742b9' cli.azure.cli.core.util: 'CommandName': 'containerapp ingress cors enable' cli.azure.cli.core.util: 'ParameterSetName': '-n -g --allowed-origins --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/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-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': '11993' 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': '33cbf502-2dc2-4e46-a752-a2d523d5e077' cli.azure.cli.core.util: 'x-ms-correlation-request-id': '33cbf502-2dc2-4e46-a752-a2d523d5e077' cli.azure.cli.core.util: 'x-ms-routing-request-id': 'GERMANYWESTCENTRAL:20230825T084141Z:33cbf502-2dc2-4e46-a752-a2d523d5e077' 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': 'Fri, 25 Aug 2023 08:41:41 GMT' cli.azure.cli.core.util: Response content: cli.azure.cli.core.util: {"id":"/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerapps/config-api","name":"config-api","type":"Microsoft.App/containerApps","location":"West Europe","systemData":{"createdBy":"alexander.pajer@integrations.at","createdByType":"User","createdAt":"2023-08-25T08:34:49.920977","lastModifiedBy":"alexander.pajer@integrations.at","lastModifiedByType":"User","lastModifiedAt":"2023-08-25T08:36:15.035286"},"properties":{"provisioningState":"Succeeded","runningStatus":"Running","managedEnvironmentId":"/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/managedEnvironments/aznative-dev","environmentId":"/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/managedEnvironments/aznative-dev","workloadProfileName":null,"outboundIpAddresses":["20.31.206.71"],"latestRevisionName":"config-api--xds65pp","latestReadyRevisionName":"config-api--xds65pp","latestRevisionFqdn":"config-api--xds65pp.delightfulglacier-9c484d1b.westeurope.azurecontainerapps.io","customDomainVerificationId":"1387F783D35B4E628CFECBEF659048D3844B3364AFAB806A32607A7B0D3AA59F","configuration":{"secrets":[{"name":"aznativedevazurecrio-aznativedev"}],"activeRevisionsMode":"Single","ingress":{"fqdn":"config-api.delightfulglacier-9c484d1b.westeurope.azurecontainerapps.io","external":true,"targetPort":80,"exposedPort":0,"transport":"Auto","traffic":[{"weight":100,"latestRevision":true}],"customDomains":null,"allowInsecure":false,"ipSecurityRestrictions":null,"corsPolicy":null,"clientCertificateMode":null,"stickySessions":null},"registries":[{"server":"aznativedev.azurecr.io","username":"aznativedev","passwordSecretRef":"aznativedevazurecrio-aznativedev","identity":""}],"dapr":null,"maxInactiveRevisions":null,"service":null},"template":{"revisionSuffix":"","terminationGracePeriodSeconds":null,"containers":[{"image":"aznativedev.azurecr.io/config-api","name":"config-api","resources":{"cpu":0.5,"memory":"1Gi","ephemeralStorage":"2Gi"}}],"initContainers":null,"scale":{"minReplicas":null,"maxReplicas":10,"rules":null},"volumes":null,"serviceBinds":null},"eventStreamEndpoint":"https://westeurope.azurecontainerapps.dev/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/containerApps/config-api/eventstream"},"identity":{"type":"None"}} cli.azure.cli.core.util: Found subscription ID 78033352-805c-4acd-af80-f8f95083268d in the URL https://management.azure.com/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-preview cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/, subscription 78033352-805c-4acd-af80-f8f95083268d 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/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/d92b247e-90e0-4469-a129-6a32866c0d0a/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/d92b247e-90e0-4469-a129-6a32866c0d0a/kerberos', 'tenant_region_scope': 'EU', '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: 69df2b25-c28e-4f6d-9d07-7fca49f00ec2 cli.azure.cli.core.util: Request URL: 'https://management.azure.com/subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-preview' cli.azure.cli.core.util: Request method: 'PATCH' cli.azure.cli.core.util: Request headers: cli.azure.cli.core.util: 'User-Agent': 'python/3.10.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31) AZURECLI/2.51.0 (DEB)' 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': '1b63dc23-53ab-44d8-90ec-14b9a99c1358' cli.azure.cli.core.util: 'Content-Type': 'application/json' cli.azure.cli.core.util: 'CommandName': 'containerapp ingress cors enable' cli.azure.cli.core.util: 'ParameterSetName': '-n -g --allowed-origins --debug' cli.azure.cli.core.util: 'Authorization': 'Bearer eyJ0eXAiOiJKV...' cli.azure.cli.core.util: 'Content-Length': '276' cli.azure.cli.core.util: Request body: cli.azure.cli.core.util: {"properties": {"configuration": {"ingress": {"corsPolicy": {"allowedOrigins": ["_images", "config-api", "config-ui", "publish-containers.azcli", "readme.md"], "allowedMethods": null, "allowedHeaders": null, "exposeHeaders": null, "allowCredentials": null, "maxAge": null}}}}} urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "PATCH /subscriptions/78033352-805c-4acd-af80-f8f95083268d/resourceGroups/az-native-dev/providers/Microsoft.App/containerApps/config-api?api-version=2023-04-01-preview HTTP/1.1" 400 316 cli.azure.cli.core.util: Response status: 400 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: 'Content-Length': '316' cli.azure.cli.core.util: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.util: 'Expires': '-1' cli.azure.cli.core.util: 'x-ms-ratelimit-remaining-subscription-resource-requests': '699' 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': 'eb92461a-f5f0-4635-85a5-de7602795dda' cli.azure.cli.core.util: 'x-ms-correlation-request-id': 'eb92461a-f5f0-4635-85a5-de7602795dda' cli.azure.cli.core.util: 'x-ms-routing-request-id': 'GERMANYWESTCENTRAL:20230825T084142Z:eb92461a-f5f0-4635-85a5-de7602795dda' 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': 'Fri, 25 Aug 2023 08:41:41 GMT' cli.azure.cli.core.util: Response content: cli.azure.cli.core.util: {"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-716ffafa281dab25abcfbd2075fd5b42-52781026a24d1e6a-01","errors":{"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]}} cli.azure.cli.core.azclierror: 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 "/home/alex/.azure/cliextensions/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 "/home/alex/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 3063, in enable_cors_policy handle_raw_exception(e) File "/home/alex/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 63, in handle_raw_exception raise e File "/home/alex/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 3059, in enable_cors_policy r = ContainerAppClient.update( File "/home/alex/.azure/cliextensions/containerapp/azext_containerapp/_clients.py", line 196, in update r = send_raw_request(cmd.cli_ctx, "PATCH", request_url, body=json.dumps(container_app_envelope)) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/util.py", line 1010, in send_raw_request raise HTTPError(reason, r) azure.cli.core.azclierror.HTTPError: Bad Request({"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-716ffafa281dab25abcfbd2075fd5b42-52781026a24d1e6a-01","errors":{"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]}})

cli.azure.cli.core.azclierror: Bad Request({"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-716ffafa281dab25abcfbd2075fd5b42-52781026a24d1e6a-01","errors":{"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]}}) az_command_data_logger: Bad Request({"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-716ffafa281dab25abcfbd2075fd5b42-52781026a24d1e6a-01","errors":{"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]}}) cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f94e24eaf80>] az_command_data_logger: exit code: 1 cli.main: Command ran in 2.677 seconds (init: 0.152, invoke: 2.526) cli.azure.cli.core.decorators: Suppress exception: Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/azure/cli/main.py", line 62, in raise ex File "/opt/az/lib/python3.10/site-packages/azure/cli/main.py", line 55, in sys.exit(exit_code) SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/azure/cli/core/decorators.py", line 79, in _wrapped_func return func(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/telemetry.py", line 123, in generate_payload payload = json.dumps(self.events, separators=(',', ':')) File "/opt/az/lib/python3.10/json/init.py", line 238, in dumps kw).encode(obj) File "/opt/az/lib/python3.10/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/opt/az/lib/python3.10/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/opt/az/lib/python3.10/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type HTTPError is not JSON serializable

telemetry.main: Split cli events and extra events failure: the JSON object must be str, bytes or bytearray, not NoneType

Expected behavior

Cors policy should be added for *

Environment Summary

azure-cli 2.51.0

core 2.51.0 telemetry 1.1.0

Extensions: application-insights 0.1.19 containerapp 0.3.37

Dependencies: msal 1.24.0b1 azure-mgmt-resource 23.1.0b2

Python location '/opt/az/bin/python3' Extensions directory '/home/alex/.azure/cliextensions'

Python (Linux) 3.10.10 (main, Jul 27 2023, 07:11:10) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

yonzhan commented 1 year ago

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

ractando commented 9 months ago

Hey Guys, @arambazamba @yonzhan Is this resolved ? I am facing this exact issue on AZ CLI latest version. Checked reinstalling it as well.

zhoxing-ms commented 9 months ago

@Greedygre Could you please take a look at the container-app related issue?

Greedygre commented 9 months ago

Hi @arambazamba @ractando

This issue has been fixed on azure-cli version 2.55.0 with PR: https://github.com/Azure/azure-cli/pull/27837

If @ractando still have issue, please make sure the version is >= 2.55.0 . If you still have problems, please provide your command and debug logs with --debug

Thanks.

ractando commented 9 months ago

Hey @Greedygre,

I am still facing the issue even though my AZ CLI is the latest one.

image

image

Attaching the debug logs:

debug logs 1.txt

Greedygre commented 9 months ago

Hey @Greedygre,

I am still facing the issue even though my AZ CLI is the latest one.

image

image

Attaching the debug logs:

debug logs 1.txt

Hi @ractando , Thank you for reply. As your version of containerapp extension, it needs to >= 0.3.43 too. Please upgrade the version of containerapp extension with command: az extension add -n contianerapp --upgrade

Because the same command from extension will overwrite the command from azure-cli. So the repair logic does not take effect when the extension version is too low.

ractando commented 9 months ago

This worked. Thanks @Greedygre

danielPerez97 commented 9 months ago

I am getting the same error with this command:

az containerapp create \
    -g *** \
    -n newcontainertest \
    --yaml gh-azure-config.yaml \
    --output none
...

ERROR: Bad Request(***"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"TRACE_ID","errors":***"$":["The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 4."]***)

Here is the YAML, scrubbed because a lot of these values get injected at runtime

location: centralus
name: RUNTIME_INJECT
properties:
  managedEnvironmentId: RUNTIME_INJECT
  configuration:
    secrets:
      - name: myregistrypassword
        value: RUNTIME_INJECT
    registries:
      - passwordSecretRef: myregistrypassword
        server: RUNTIME_INJECT.azurecr.io
        username: RUNTIME_INJECT
    activeRevisionsMode: Single
    ingress:
      transport: http2
      targetPort: 80
      external: true
      additionalPortMappings:
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
      traffic:
        - latestRevision: true
          weight: 100
  template:
    containers:
      - image: RUNTIME_INJECT
        name: RUNTIME_INJECT
        volumeMounts:
          - volumeName: RUNTIME_INJECT
            mountPath: RUNTIME_INJECT
        resources:
          cpu: 1.0
          memory: 2.0Gi
    volumes:
    - name: RUNTIME_INJECT
      storageType: AzureFile
      storageName: RUNTIME_INJECT
    scale:
      maxReplicas: 1
      minReplicas: 1
  workloadProfileName: Consumption
type: Microsoft.App/containerApps

What's worth noting is that this works when we use az containerapp update, but az containerapp create gives us this error for the same YAML file, so we're unsure what to do next.

Greedygre commented 9 months ago

Hi @danielPerez97

az containerapp create --yaml send a put request, required parameters should be included. I notice parameter allowInsecure is not include in the yaml file. Please add it and try again.

allowInsecure: false
external: true
      additionalPortMappings:
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET
        - exposedPort: SECRET
          external: true
          targetPort: SECRET

If it does not work, please show the result of command az version, and debug logs.

Thanks.

danielPerez97 commented 9 months ago

That was the piece that was missing, thank you! It's a little unfortunate the error wasn't more specific, but I'm happy this is working now. Thank you!

alexander-kastil commented 9 months ago

Hi @arambazamba @ractando

This issue has been fixed on azure-cli version 2.55.0 with PR: #27837

If @ractando still have issue, please make sure the version is >= 2.55.0 . If you still have problems, please provide your command and debug logs with --debug

Thanks.

works for me