How to detach/dissociate public IP of ARM VM

寵の児 提交于 2019-12-13 07:33:11

问题


I have an ARM VM with a public IP. I want to detach/dissociate this public IP after my test. I can see there is an option using azure portal-

I want to do the same thing using azure powershell. I tried finding azure cmdlets related to public IP but couldn't achieve it. If someone can give me some clue how this can be done ?


回答1:


You need to get the Network Interface object and remove the Ip Address Id from it and push changes back to Azure.

$nic = Get-AzureRmNetworkInterface -Name bla -ResourceGroup blabla
$nic.IpConfigurations.publicipaddress.id = $null
Set-AzureRmNetworkInterface -NetworkInterface $nic

Many Azure cmdlets work in similar fashion.



来源:https://stackoverflow.com/questions/46398694/how-to-detach-dissociate-public-ip-of-arm-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!