Azure / Azure/azure-cli

private DNS link VNET creation with DNS and VNET not in the same resource group

Open
#23,351 8 comments 1 reaction 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign bug Network Network - DNS Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

**Command Name**
`az network private-dns link vnet create`

**Errors:**
```
(BadRequest) Virtual network resource not found for '/subscriptions/******-****-***/resourceGroups/rg-name/providers/Microsoft.Network/virtualNetworks/VNET-Hub
'
Code: BadRequest
Message: Virtual network resource not found for '/subscriptions/******-****-***/resourceGroups/rg-name/providers/Microsoft.Network/virtualNetworks/VNET-Hub
'

**FYI**
The VNET exists and in the command line the VNET ID is being passed instead of the name

```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- `az network vnet create -g $RG1 -n $HubVnet --address-prefix $HubAddressSpace \
--subnet-name $HubSubnet --subnet-prefix $HubSubnetPrefix`
- `az network private-dns zone create -g $RG2 -n $DNSZoneName`
- `HubVnetId=$(az network vnet show \
--resource-group $RG1 \
--name $HubVnet \
--query id --out tsv)`
- `az network private-dns link vnet create --name {} --registration-enabled {} --resource-group {} --virtual-network $HubVnetId --zone-name {} --debug`

## Expected Behavior
Create the private dns link.
## Environment Summary
```
Windows-10-10.0.22000-SP0
Python 3.8.9
Installer:

azure-cli 2.32.0 *

Extensions:
aks-preview 0.5.70
azure-firewall 0.14.1
ip-group 0.1.2

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.