Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

(InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. #23714

Open Claire-cloud31 opened 2 years ago

Claire-cloud31 commented 2 years ago

Dear Team, We experience an error when using command "az account subscription rename --id xxxx-xxx --name "xxx"" to rename subscription. Error message InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'.

The cli version is as following : azure-cli 2.35.0 core 2.35.0 telemetry 1.0.6 * Extensions: account 0.2.1 Dependencies: msal 1.17.0 azure-mgmt-resource 20.0.0 Python location '/bin/python3.6' Extensions directory '/root/.azure/cliextensions' Python (Linux) 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

And we remove account extension 0.2.1 and add account extension 0.2.3 with below command az extension remove --name account az extension add --name account --version 0.2.1

Then cli version is as following { "azure-cli": "2.35.0", "azure-cli-core": "2.35.0", "azure-cli-telemetry": "1.0.6", "extensions": { "account": "0.2.3" }

We attempt to rename subscription and encounter the new error . Command group 'account subscription' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus (InvalidResourceType) The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. Code: InvalidResourceType Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'.

Could you please help to confirm it ? thanks

yonzhan commented 2 years ago

@jiasli for awareness

Claire-cloud31 commented 2 years ago

@jiasli , May I know if there is any update ? thanks

zhoxing-ms commented 2 years ago

Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'.

@Ochirkhuyag Could you please take a look at this issue? May I ask is the rename operation not currently supported in api-version 2021-10-01?

Ochirkhuyag commented 2 years ago

@zhoxing-ms The rename operation is supported in the api version 2021-10-01

zhoxing-ms commented 2 years ago

Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'.

@Ochirkhuyag Got it, thanks for conformation. Since this error message is returned by the REST service, could you help investigate this root cause?

@Vi-2022 Could you please show us the debug log (add --debug parameter) to help us know more about the details of failed requests?

Claire-cloud31 commented 2 years ago

@zhoxing-ms , I use az version 2.35.0,with extension account 0.2.3, run command "az account subscription rename --id xxx --name test --debug" , the result is as following : cli.knack.cli: Command arguments: ['account', 'subscription', 'rename', '--id', '', '--name', 'test', '--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 0x7f9385540ae8>, <function OutputProducer.on_global_arguments at 0x7f9385084c80>, <function CLIQuery.on_global_arguments at 0x7f9384e21158>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'account': ['azure.cli.command_modules.profile', 'azure.cli.command_modules.resource', 'azext_account'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: profile 0.008 2 9 cli.azure.cli.core: resource 0.043 43 197 cli.azure.cli.core: Total (2) 0.051 45 206 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: account 0.011 4 12 /root/.azure/cliextensions/account cli.azure.cli.core: Total (1) 0.011 4 12
cli.azure.cli.core: Loaded 47 groups, 218 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : account subscription rename cli.azure.cli.core: Command table: account subscription rename cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f9383dcb158>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2022-09-04.02-27-45.account_subscription_rename.5418.log'. az_command_data_logger: command args: account subscription rename --id {} --name {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f9383952158>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f93838a8840>, <function register_cache_arguments..add_cache_arguments at 0x7f93838a8950>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f9385084d08>, <function CLIQuery.handle_query_parameter at 0x7f9384e211e0>, <function register_ids_argument..parse_ids_arguments at 0x7f93838a88c8>] az_command_data_logger: extension name: account az_command_data_logger: extension version: 0.2.3 Command group 'account subscription' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus cli.azure.cli.core.commands.client_factory: Getting management service client client_type=SubscriptionClient cli.azure.cli.core.auth.persistence: build_persistence: location='/root/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /root/.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.chinacloudapi.cn//oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.chinacloudapi.cn//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.partner.microsoftonline.cn//v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://microsoftgraph.chinacloudapi.cn/oidc/userinfo', 'authorization_endpoint': 'https://login.chinacloudapi.cn//oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.chinacloudapi.cn//oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.chinacloudapi.cn//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.chinacloudapi.cn//kerberos', 'tenant_region_scope': 'AS', 'cloud_instance_name': 'partner.microsoftonline.cn', 'cloud_graph_host_name': 'graph.chinacloudapi.cn', 'msgraph_host': 'microsoftgraph.chinacloudapi.cn', 'rbac_url': 'https://pas.chinacloudapi.cn'} cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.chinacloudapi.cn//.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.chinacloudapi.cn//.default',), kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: fef75052-961c-4835-8ea2-f8625ccb4ca8 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.chinacloudapi.cn/subscriptions//providers/Microsoft.Subscription/rename?api-version=2021-10-01' cli.azure.cli.core.sdk.policies: Request method: 'POST' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '28' cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '29417fde-2bf9-11ed-90be-0017fa00b804' cli.azure.cli.core.sdk.policies: 'CommandName': 'account subscription rename' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--id --name --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.35.0 (RPM) azsdk-python-mgmt-subscription/3.0.0 Python/3.6.8 (Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-centos-8.2.2004-Core)' cli.azure.cli.core.sdk.policies: 'Authorization': '**' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"subscriptionName": "test"} urllib3.connectionpool: Starting new HTTPS connection (1): management.chinacloudapi.cn:443 urllib3.connectionpool: https://management.chinacloudapi.cn:443 "POST /subscriptions//providers/Microsoft.Subscription/rename?api-version=2021-10-01 HTTP/1.1" 404 279 cli.azure.cli.core.sdk.policies: Response status: 404 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: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'gateway' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'e9bcc76b-2e27-4956-ba8-8a0f1a5dd938' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'e9bcc76b-2e27-495-ba86-8a0f1a5dd938' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CHINANORTH2:20220904T022746Z:e9bcc76b-2e27-495-ba86-8a0f1a5dd938' 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': 'Sun, 04 Sep 2022 02:27:46 GMT' cli.azure.cli.core.sdk.policies: 'Content-Length': '279' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidResourceType","message":"The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'."}} cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 658, in execute raise ex File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 721, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 692, in _run_job result = cmd_copy(params) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in call return self.handler(args, kwargs) File "/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(*command_args) File "/root/.azure/cliextensions/account/azext_account/manual/custom.py", line 17, in account_subscription_rename return client.rename(subscription_id=subscription_id, body=body) File "/lib64/az/lib/python3.6/site-packages/azure/core/tracing/decorator.py", line 83, in wrapper_use_tracer return func(args, **kwargs) File "/root/.azure/cliextensions/account/azext_account/vendored_sdks/subscription/operations/_subscription_operations.py", line 313, in rename map_error(status_code=response.status_code, response=response, error_map=error_map) File "/lib64/az/lib/python3.6/site-packages/azure/core/exceptions.py", line 105, in map_error raise error azure.core.exceptions.ResourceNotFoundError: (InvalidResourceType) The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. Code: InvalidResourceType Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'.

cli.azure.cli.core.azclierror: (InvalidResourceType) The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. Code: InvalidResourceType Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. az_command_data_logger: (InvalidResourceType) The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. Code: InvalidResourceType Message: The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'. cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f9383dcb378>] az_command_data_logger: exit code: 3 cli.main: Command ran in 1.351 seconds (init: 0.465, invoke: 0.886) telemetry.save: Save telemetry record of length 3654 in cache telemetry.check: Negative: The /root/.azure/telemetry.txt was modified at 2022-09-04 02:18:32.750025, which in less than 600.000000 s

Claire-cloud31 commented 2 years ago

@zhoxing-ms , @Ochirkhuyag , May I know if there is any update from your side ? thanks

Ochirkhuyag commented 2 years ago

Checked unsuccessful requests on the log for the last 1 month. There is nothing related to this error. Seems like the request did not hit the API. Before hitting, somebody responded.

Claire-cloud31 commented 2 years ago

so...how can I resolve it ?

Claire-cloud31 commented 2 years ago

@zhoxing-ms , could you please continue to investigate it ? looking forward your reply , thanks in advance .

Claire-cloud31 commented 2 years ago

@jiasli , could you please continue to investigate it ? looking forward your reply , thanks in advance .

zhoxing-ms commented 2 years ago

This is the request URL:

https://management.chinacloudapi.cn:443 "POST /subscriptions//providers/Microsoft.Subscription/rename?api-version=2021-10-01 HTTP/1.1" 404 279

This is the response body from REST service:

{"error":{"code":"InvalidResourceType","message":"The resource type 'rename' could not be found in the namespace 'Microsoft.Subscription' for api version '2021-10-01'. The supported api-versions are '2019-03-01-preview,2019-10-01-preview,2020-09-01,2021-01-01-privatepreview'."}}

'x-ms-correlation-request-id': 'e9bcc76b-2e27-495-ba86-8a0f1a5dd938'

@Ochirkhuyag Please note that this is a request to China Cloud, could you query the request information related to this correlation id e9bcc76b-2e27-495-ba86-8a0f1a5dd938 for China Cloud?

chicago7 commented 2 years ago

hi All

I encountered the same issue in Azure China . Azure CLI version is 2.40.0. the error message is as below. please help fix the issue ASAP. Thanks.

cli.azure.cli.core.sdk.policies: Response status: 502 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: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'service' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'b920c4ad-1a4e-4b0f-9518-cfd9f8aaa6ec' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'b920c4ad-1a4e-4b0f-9518-cfd9f8aaa6ec' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CHINANORTH2:_**20220922T040407Z:b920c4ad-1a4e-4b0f-9518-cfd9f8aaa6ec' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 22 Sep 2022 04:04:07 GMT' cli.azure.cli.core.sdk.policies: 'Connection': 'close' cli.azure.cli.core.sdk.policies: 'Content-Length': '123' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}} cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\zuo.teng.azure\cliextensions\account\azext_account\generated\custom.py", line 16, in account_subscription_rename return client.rename(subscription_id=subscription_id, subscription_name=subscription_name) File "C:\Users\zuo.teng.azure\cliextensions\account\azext_account\vendored_sdks\subscription\operations_subscription_operations.py", line 334, in rename raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) azure.core.exceptions.HttpResponseError: (InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'.

cli.azure.cli.core.azclierror: (InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'. az_command_data_logger: (InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'.

chicago7 commented 2 years ago

@Ochirkhuyag @zhoxing-ms Is there any update? Thanks.

chicago7 commented 2 years ago

@Ochirkhuyag @zhoxing-ms @jiasli Is there any update? we still encounter the issue. Thanks.

az rest --method post --url https://management.chinacloudapi.cn/subscriptions/e215f72c-02a5-4e2a-8a6e-1469ce59478d/providers/Microsoft.Subscription/rename?api-version=2020-09-01 --body @C:\Users\test01\Desktop\rename.json Bad Gateway({"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}})

chicago7 commented 2 years ago

@Ochirkhuyag @zhoxing-ms @jiasli Is there any update? Thanks.

zhoxing-ms commented 2 years ago

az rest --method post --url https://management.chinacloudapi.cn/subscriptions/e215f72c-02a5-4e2a-8a6e-1469ce59478d/providers/Microsoft.Subscription/rename?api-version=2020-09-01 --body @C:\Users\test01\Desktop\rename.json Bad Gateway({"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}})

This is the problem of directly requesting REST, so I believe it should be a service issue. @Ochirkhuyag Could you confirm whether there is a problem with the China Cloud?

Ochirkhuyag commented 2 years ago

Checking. Will respond soon.

chicago7 commented 2 years ago

@Ochirkhuyag Thanks for your response. May I know if there is any update?

chicago7 commented 2 years ago

@Ochirkhuyag May I know if there is any update? thanks

Ochirkhuyag commented 2 years ago

We are working to enable APIs on ARM side. Once it is done, will update here.

chicago7 commented 1 year ago

@Ochirkhuyag May I know if there is any update? thanks

Ochirkhuyag commented 1 year ago

We enabled APIs on ARM side previous week. It would be reflected in a few days. Let me check today!

chicago7 commented 1 year ago

@Ochirkhuyag Thanks for your update. but the issue is still here.

az account subscription rename --id "e215f72c-021469ce59478d" --name "" Command group 'account subscription' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus (InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'.

Ochirkhuyag commented 1 year ago

We enabled the APIs on the ARM a week ago. It would take 1 day on each region to apply. It should be done for now, or would be done very soon.

chicago7 commented 1 year ago

@Ochirkhuyag Thanks for your support. but the issue is still here.

cli.azure.cli.core.sdk.policies: 'Date': 'Mon, 31 Oct 2022 02:13:01 GMT' cli.azure.cli.core.sdk.policies: 'Connection': 'close' cli.azure.cli.core.sdk.policies: 'Content-Length': '123' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}} cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\zuo.teng.azure\cliextensions\account\azext_account\manual\custom.py", line 17, in account_subscription_rename return client.rename(subscription_id=subscription_id, body=body) File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 73, in wrapper_use_tracer File "C:\Users\zuo.teng.azure\cliextensions\account\azext_account\vendored_sdks\subscription\operations_subscription_operations.py", line 338, in rename raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) azure.core.exceptions.HttpResponseError: (InvalidGatewayCertificate) The gateway certificate is invalid for 'Microsoft.Subscription'. Code: InvalidGatewayCertificate Message: The gateway certificate is invalid for 'Microsoft.Subscription'.

Ochirkhuyag commented 1 year ago

The ARM changes still in progress in Mooncake. Let me check it with ARM team.

Ochirkhuyag commented 1 year ago

@chicago7 The ARM changes are applied. Could you please check it from your side?

chicago7 commented 1 year ago

@Ochirkhuyag Thanks for your support. but the issue is still here.

Azure CLI is up to date.

cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.42.0 (MSI) azsdk-python-subscriptionclient/unknown Python/3.10.8 (Windows-10-10.0.19045-SP0)' cli.azure.cli.core.sdk.policies: 'Authorization': '*' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"subscriptionName": "**"} urllib3.connectionpool: Starting new HTTPS connection (1): management.chinacloudapi.cn:443 urllib3.connectionpool: https://management.chinacloudapi.cn:443 "POST /subscriptions/e215f7**8a6e-1469ce59478d/providers/Microsoft.Subscription/rename?api-version=2020-09-01 HTTP/1.1" 502 123 cli.azure.cli.core.sdk.policies: Response status: 502 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: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'service' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CHINANORTH2:20221105T064357Z:9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' 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': 'Sat, 05 Nov 2022 06:43:57 GMT' cli.azure.cli.core.sdk.policies: 'Connection': 'close' cli.azure.cli.core.sdk.policies: 'Content-Length': '123' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}}

Ochirkhuyag commented 1 year ago

@Ochirkhuyag Thanks for your support. but the issue is still here.

Azure CLI is up to date.

cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.42.0 (MSI) azsdk-python-subscriptionclient/unknown Python/3.10.8 (Windows-10-10.0.19045-SP0)' cli.azure.cli.core.sdk.policies: 'Authorization': '*' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"subscriptionName": "**"} urllib3.connectionpool: Starting new HTTPS connection (1): management.chinacloudapi.cn:443 urllib3.connectionpool: https://management.chinacloudapi.cn:443 "POST /subscriptions/e215f7**8a6e-1469ce59478d/providers/Microsoft.Subscription/rename?api-version=2020-09-01 HTTP/1.1" 502 123 cli.azure.cli.core.sdk.policies: Response status: 502 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: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'service' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CHINANORTH2:20221105T064357Z:9f430cf2-f810-4e0c-9523-9d2a0fcc5f1c' 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': 'Sat, 05 Nov 2022 06:43:57 GMT' cli.azure.cli.core.sdk.policies: 'Connection': 'close' cli.azure.cli.core.sdk.policies: 'Content-Length': '123' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}}

ARM is enabled for the version 2021-10-01. Seems like this one is for 2020-09-01. Those should be enabled. But let me check and will update you tomorrow morning.

chicago7 commented 1 year ago

@Ochirkhuyag Thanks for your support. I tried to send the request by version 2021-10-01. but I still encounter the issue.

az rest --method post --url https://management.chinacloudapi.cn/subscriptions/e2******-02a5-4e2a-8a6e-1469ce59478d/providers/Microsoft.Subscription/rename?api-version=2021-10-01 --body @C:\Users\test01\Desktop\name.json Bad Gateway({"error":{"code":"InvalidGatewayCertificate","message":"The gateway certificate is invalid for 'Microsoft.Subscription'."}})

Ochirkhuyag commented 1 year ago

Could you guys please try again? It should be okay for now.

Claire-cloud31 commented 1 year ago

@Ochirkhuyag , it works fine now , and I think this issue should be resolved . thank you all for your help .

wvusaf commented 1 year ago

What was the fix? I have the same issue, except with Microsoft.AlertsManagement