Why does New-AzureReservedIP return ResourceNotFound: No deployments were found?

假如想象 提交于 2019-12-04 07:59:32

I was fighting like 30 minutes with this. I'm not very sure why this was happening but I think was an error selecting the subscription. Last time it worked like this:

  • Close Azure Power Shell and Open it again.
  • Listed my subscriptions with: "Get-AzureSubscription" (Make sure you are logged in).
  • Now I can see the exact Subscription ID and use "Select-AzureSubscription -SubscriptionId XXXXXXXX"
  • After that the command worked.
  • New-AzureReservedIP -ReservedIPName "myname" -Location "South Central US" -ServiceName "myservice"

Hope it helps.

If your VMs were created in the new portal, you need to switch to the Resource Manager model, New-AzureReservedIP is only used for the classic portal services, so it prompted ResourceNotFound: No deployments were found error.

There is no AzureReservedIP in Azure RM cmdlets. In the new portal, the IP address is associated to network interface.If you want to set your VMip to be static,run the following command:

$nic=Get-AzureRmNetworkInterface -ResourceGroupName JohTest -Name johtestvm250 $nic.IpConfigurations[0].PrivateIpAllocationMethod="Static" $nic.IpConfigurations[0].PrivateIpAddress = "10.2.0.4" Set-AzureRmNetworkInterface -NetworkInterface $nic

If you dont know the networkinterface in your RG, run the command to see:

Get-AzureRmNetworkInterface -ResourceGroupName JohTest

More information here

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