Is there a python sdk command to get the vnet peering details in azure along with the necessary input variables.
Asked
Active
Viewed 108 times
1 Answers
0
Didn't find the sdk but found a az network command which gave me the outcome "az network vnet peering list -g MyResourceGroup --vnet-name MyVnet1"
In python you have to do something like
from azure.cli.core import get_default_cli
get_default_cli().invoke(['network', 'vnet', 'peering', 'list','-g','rsg001','--vnet-name','vnet001'])
Keep into mind I already have the az account login in powershell.

Gandhi
- 11,875
- 4
- 39
- 63

Ghost rider
- 43
- 1
- 9
-
Also this might be helpful https://learn.microsoft.com/en-us/python/api/azure-mgmt-network/azure.mgmt.network.v2020_04_01.operations.virtualnetworkpeeringsoperations?view=azure-python and https://learn.microsoft.com/en-us/python/api/azure-mgmt-network/azure.mgmt.network.v2020_04_01.models.virtualnetworkpeering?view=azure-python – Ghost rider Aug 04 '22 at 13:08