Azure / Azure/azure-cli

"az network application-gateway private-link add" assumes AppGw same RG as Vnet

Open
#17,272 9 comments 0 reactions 1 assignee Claimed by @msyyc View on GitHub
act-quality-productivity-squad Network - Application Gateway Network - Virtual Network Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**

My Application Gateway lives in a resource group separate from the vnet resource group. When attempting to add a Private Link to the AppGw I get the error:

```
az network application-gateway private-link add --frontend-ip xxx-apigw-feip01 --name xxx-waf-apigw-pls --subnet xxx-sn-be --subscription xxx --resource-group xxx-rg-fe --gateway-name xxx-waf-apigw

Command group 'network application-gateway private-link' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

(ResourceNotFound) The Resource 'Microsoft.Network/virtualNetworks/xxx-vnet03' under resource group 'xxx-rg-fe' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
```

When moving the Application Gateway to the same RG as the Vnet it works.

AFAICS the logic happens in this function:
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/network/custom.py#L475

**To Reproduce**
Deploy the Private link on an AppGw in a different resource group from the Vnet.

**Expected behavior**
I'd expect an extra option argument that I can use to specify the resource group for the AppGw and another one for the Vnet. Or the ability to paste a full resource ID. I tried playing around with the --ids argument but I couldn't get it to work.

**Environment summary**
```
az version
{
"azure-cli": "2.20.0",
"azure-cli-core": "2.20.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"aks-preview": "0.4.62",
"azure-cli-ml": "1.10.0",
"log-analytics": "0.1.4"
}
}
```

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.