Ghost rider
Ghost rider

Reputation: 63

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

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

Upvotes: 0

Views: 184

Answers (1)

Ghost rider
Ghost rider

Reputation: 63

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.

Upvotes: 0

Related Questions