Is there a python sdk to get the list of vnet peering in azure?

152 views Asked by At

Is there a python sdk command to get the vnet peering details in azure along with the necessary input variables.

1

There are 1 answers

1
Ghost rider On

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.