Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a cloud service that has two VMs in it. I'm trying to follow the steps listed in this article to reserve my cloud service's IP address.

Login-AzureRmAccount -TenantId <my tenant id>
Set-AzureRmContext -SubscriptionId <my subscription id>
New-AzureReservedIP -ReservedIPName myname -Location "Central US" -ServiceName mycloudservicename

I always get this error:

New-AzureReservedIP : ResourceNotFound: No deployments were found.

The VMs were created in the new portal but are classic mode. I'm not sure if that is somehow my problem. I've tried other combinations of cmdlets to add accounts or set subscription but nothing helps.

Any ideas?

like image 332
Bryan Avatar asked Jan 29 '16 05:01

Bryan


2 Answers

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.

like image 154
Nelson Daza Avatar answered Nov 15 '22 03:11

Nelson Daza


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

like image 45
Lily_user4045 Avatar answered Nov 15 '22 03:11

Lily_user4045