Why does New-AzureReservedIP return ResourceNotFound: no deployments detected?

I have a cloud service that has two virtual machines. I am trying to follow the steps below in this article to reserve the IP address of a cloud service.

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 found.

Virtual machines were created on the new portal, but in classic mode. I'm not sure if this is somehow my problem. I tried other combinations of cmdlets to add accounts or set up a subscription, but nothing helps.

Any ideas?

+5
source share
2 answers

I fought like 30 minutes with this. I'm not very sure why this is happening, but I think this is a mistake when choosing a subscription. Last time, it worked as follows:

  • Close the Azure Power Shell and open it again.
  • Listed my subscriptions using 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 team worked.
  • New-AzureReservedIP -ReservedIPName "myname" -Location "South Central US" -ServiceName "myservice"

Hope this helps.

+7
source

If your virtual machines were created on a new portal, you need to switch to the resource manager model, New-AzureReservedIP will be used only for the classic portal services, therefore, it suggested the error ResourceNotFound: No deployments were found .

There are no AzureReservedIP cmdlets in Azure RM. In the new portal, the IP address is associated with the network interface. If you want 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 do not know the network interface in your RG, run the command to see:

Get-AzureRmNetworkInterface -ResourceGroupName JohTest

More info here

+1
source

Source: https://habr.com/ru/post/1241775/


All Articles