Creating ExpressRoute Gateway Connection not working in CLI, but it's working through ARM template deployment
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
Creating ExpressRoute Gateway Connection not working in CLI, but it's working through ARM template deployment.
az network express-route gateway connection create --gateway-name $erGateway -n $erConnection -g $netRG --peering $avsERPeering
It's complaining that subscription provided in the $avsERPeering is not available.
Subscription 'xyz' not found. Check the spelling and casing and try again.
Consider that I'm setting up the ER GW Connection from a different subscription of where I have the ER Circuit.
It is working fine when I deploy from the portal, or ARM template, but keeps failing in CLI.
Any help will be appreciaited 😊
### Related command
az network express-route gateway connection create --gateway-name $erGateway -n $erConnection -g $netRG --peering $avsERPeering
### Errors
**I replaced the actual subscription Id with "xyx"**
Subscription 'xyz' not found. Check the spelling and casing and try again.
### Issue script & Debug output
**I replaced the actual subscription Id with "xyx" and user account with "abc"**
az network express-route gateway connection create --gateway-name $erGateway -n $erConnection -g $netRG --peering /subscriptions/xyz/resourceGroups/tnt35-cust-p02-canadacentral/providers/Microsoft.Network/expressRouteCircuits/tnt35-cust-p02-canadacentral-er/peerings/AzurePrivatePeering --debug
cli.knack.cli: Command arguments: ['network', 'express-route', 'gateway', 'connection', 'create', '--gateway-name', 'LAB-AVS-ER-GW', '-n', 'LAB-AVS-ER-Connection', '-g', 'Lab-Network-RG', '--peering', '/subscriptions/xyz/resourceGroups/tnt35-cust-p02-canadacentral/providers/Microsoft.Network/expressRouteCircuits/tnt35-cust-p02-canadacentral-er/peerings/AzurePrivatePeering', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'network': ['azure.cli.command_modules.network', 'azure.cli.command_modules.privatedns', 'azext_bastion']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 0.439 116 476
cli.azure.cli.core: privatedns 0.026 14 60
cli.azure.cli.core: Total (2) 0.465 130 536
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: bastion 0.014 2 4 C:\Users\abc\.azure\cliextensions\bastion
cli.azure.cli.core: Total (1) 0.014 2 4
cli.azure.cli.core: Loaded 130 groups, 540 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network express-route gateway connection create
cli.azure.cli.core: Command table: network express-route gateway connection create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\abc\.azure\commands\2024-06-05.11-42-11.network_express-route_gateway_connection_create.28332.log'.
az_command_data_logger: command args: network express-route gateway connection create --gateway-name {} -n {} -g {} --peering {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x0000013829504860>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x0000013829504900>, .add_cache_arguments at 0x0000013829504A40>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x00000138295049A0>]
Command group 'az network' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 664, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 712, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 1039, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_poller.py", line 108, in result
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_poller.py", line 130, in wait
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_poller.py", line 83, in _start
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure\cli\command_modules\network\aaz_compact\latest\network\express_route\gateway\connection\__cmds.py", line 165, in _execute_operations
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_operation.py", line 42, in __init__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 73, in get_http_client
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 58, in get_login_credential
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 353, in get_login_credentials
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 576, in get_subscription
knack.util.CLIError: Subscription 'xyz' not found. Check the spelling and casing and try again.
cli.azure.cli.core.azclierror: Subscription 'xyz' not found. Check the spelling and casing and try again.
az_command_data_logger: Subscription 'xyz' not found. Check the spelling and casing and try again.
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 1.085 seconds (init: 0.502, invoke: 0.583)
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 3876 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry\__init__.pyc C:\Users\abc\.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
### Expected behavior
Create the ER GW Connection.
### Environment Summary
azure-cli 2.61.0
core 2.61.0
telemetry 1.1.0
Extensions:
account 0.2.5
bastion 0.3.0
connectedvmware 1.0.1
dns-resolver 0.2.0
resource-graph 2.1.0
vmware 6.0.1
Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\huhilal\.azure\cliextensions'
Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.