Azure / azure-cli

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

'NoneType' object has no attribute 'private_dns_zone_configs' - while adding Private EndPoint to DNS zone #21146

Open avinashmg1976 opened 2 years ago

avinashmg1976 commented 2 years ago

I am able to create Private EndPoint successfully using the CLI command. In the same setup, I am trying to add Private Endpoint created in the earlier step to existing DNS zone but getting below error.

The command failed with an unexpected error. Here is the traceback: 'NoneType' object has no attribute 'private_dns_zone_configs' Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 658, in execute raise ex File "/opt/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 "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 692, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/network/custom.py", line 3388, in add_private_endpoint_private_dns_zone private_dns_zone_group.private_dns_zone_configs.append(private_dns_zone) AttributeError: 'NoneType' object has no attribute 'private_dns_zone_configs' To open an issue, please run: 'az feedback'

az network private-endpoint dns-zone-group add --endpoint-name MyPE -g MyRG -n MyZoneGroup --zone-name Zone1 --private-dns-zone PrivateDNSZone1

I tried to execute the command from my local machine which has Powershell, Python and CLI installed. I also tried on the Azure UI command line too. Same error.

Note: Private EndPoint created is in different Subscription/Resource group and DNS zone is in different Subscription/ResourceGroup

yonzhan commented 2 years ago

network

avinashmg1976 commented 2 years ago

Actual Command used is as below az network private-endpoint dns-zone-group add --endpoint-name "abcd-pe" --subscription "sub1" --resource-group "rsg1" --name "abcd.servicebus.windows.net" --zone-name "abcd.servicebus.windows.net" --private-dns-zone "/subscriptions/sub2/resourceGroups/rsg2/providers/Microsoft.Network/privateDnsZones/privatelink.servicebus.windows.net"

YuanyuanNi commented 2 years ago

Hi, 'az network private-endpoint dns-zone-group add ' only support dns zones created in different resource groups which have the same subscription now, it does not support to change subscription. Best wishes.

ghost commented 2 years ago

Thank you for your feedback. This has been routed to the support team for assistance.

ghost commented 2 years ago

Thank you for your feedback. This has been routed to the support team for assistance.

navba-MSFT commented 2 years ago

Issue created on Jan 28. Removing the CXP Attention label. @yonzhan for visibility.

ghost commented 2 years ago

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

Issue Details
I am able to create Private EndPoint successfully using the CLI command. In the same setup, I am trying to add Private Endpoint created in the earlier step to existing DNS zone but getting below error. The command failed with an unexpected error. Here is the traceback: 'NoneType' object has no attribute 'private_dns_zone_configs' Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute raise ex File "/opt/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 "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__ return self.handler(*args, **kwargs) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/network/custom.py", line 3388, in add_private_endpoint_private_dns_zone private_dns_zone_group.private_dns_zone_configs.append(private_dns_zone) AttributeError: 'NoneType' object has no attribute 'private_dns_zone_configs' To open an issue, please run: 'az feedback' az network private-endpoint dns-zone-group add --endpoint-name MyPE -g MyRG -n MyZoneGroup --zone-name Zone1 --private-dns-zone PrivateDNSZone1 I tried to execute the command from my local machine which has Powershell, Python and CLI installed. I also tried on the Azure UI command line too. Same error. Note: Private EndPoint created is in different Subscription/Resource group and DNS zone is in different Subscription/ResourceGroup
Author: avinashmg1976
Assignees: kairu-ms
Labels: `Network`, `Service Attention`, `Customer Usage`, `Traiged`
Milestone: Backlog