[英]Remove multiple vnet peers azure CLI
I have a requirement to remove and recreate 24 peers from two separate VNETS.我需要从两个独立的 VNETS 中删除和重新创建 24 个对等点。
2 different subscriptions, 2 different VNETs. 2 个不同的订阅,2 个不同的 VNET。 the peering all in the same vnet -
同一个 vnet 中的所有对等互连 -
12 in PRD珠三角12
12 in DEV 12 在开发
I am hoping to automate this process.我希望自动化这个过程。 What is the best approach to accomplish this?
实现这一目标的最佳方法是什么? The main goal is to automate and make the script/template portable.
主要目标是自动化并使脚本/模板可移植。
AZ CLI, ARM Template, PowerShell? AZ CLI、ARM 模板、PowerShell?
Thanks for your feedback感谢您的反馈意见
In this case, you could use Azure PowerShell or Azure CLI to remove the vnet peering.在这种情况下,可以使用 Azure PowerShell 或 Azure CLI 删除 vnet 对等互连。
Azure PowerShell: Remove-AzVirtualNetworkPeering
Azure PowerShell:
Remove-AzVirtualNetworkPeering
Remove-AzVirtualNetworkPeering -Name "myVnet1TomyVnet2" -VirtualNetworkName "myVnet" -ResourceGroupName "myResourceGroup"
Azure CLI: az network vnet peering delete
Azure CLI:
az network vnet peering delete
az network vnet peering delete -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.