问题描述
大家好。我试图删除Azure中特定VM的公共IP地址,而不知道公共IP地址或公共IP名称。
Hi all. I am trying to remove a Public IP Address of a specific VM in Azure, without having the knowledge of the public IP Address or Public IP Name.
我知道这样做的命令此处指定 - >
I am aware of the commands to do so specified here --> https://docs.microsoft.com/en-us/powershell/module/azurerm.network/remove-azurermpublicipaddress?view=azurermps-6.13.0
\但是,所有这些都需要自动化。例如:
\but, all of this needs to be automated. For example:
- 在Azure中创建VM
- VM is created in Azure
- 有人给我VM名称和资源组名称(仅这两个)
- Someone gives me the VM Name and Resource Group Name (only these two)
- Azure Powershell需要在特定ResourceGroup下查询此特定VM,并删除其关联的公共IP
- Azure Powershell needs to query this specific VM under specific ResourceGroup, and remove its associated Public IP
谢谢!
推荐答案
要了解与VM关联的IP,您需要先获取VM详细信息。然后,您可以获得NIC,并使用NIC的UR,您可以获得与NIC关联的公共IP。然后你最终可以删除它。
In order to know the IP associated to the VM, you need to get the VM details first. Then you can get the NICs available and with the NIC's UR, you can get the Public IP associated with the NIC. Then you can finally remove it.
这篇关于删除公共IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!