Click here to Skip to main content
13,700,326 members
Rate this:
 
Please Sign up or sign in to vote.
I have recently created a virtual machine in Azure where I have installed WordPress and MySQL in it. I have created a Web App too. Now I need to assign my static Web App IP address to the Virtual machine I created. I tried the following commands but no luck there.

New-AzureReservedIP –ReservedIPName IP –Location "South Central US" -ServiceName ServName


I am using latest Azure Powershell in my virtual machine. When I search for a solution people are saying the commands I used are not compatible with the latest powershell. So I used the commands explained here as follows.

$nic=Get-AzureRmNetworkInterface -Name networkinterfacename -ResourceGroupName resouorcegrpupname $nic.IpConfigurations[0].PrivateIpAllocationMethod = 'Static' $nic.IpConfigurations[0].PrivateIpAddress = 'ip address' Set-AzureRmNetworkInterface -NetworkInterface $nic


But when I run I am getting error as Set-AzureRmNetworkInterface : Private static IP address does not belong to the range of subnet prefix 10.0.0.0/24.

Any help is much appreciated. Thanks in advance.

Note : I have logged in to the Powershell and I am able to run the commands Add-AzureAccount, Select-AzureSubscription, Get-AzureStorageAccount.

What I have tried:

$nic=Get-AzureRmNetworkInterface -Name networkinterfacename -ResourceGroupName resouorcegrpupname $nic.IpConfigurations[0].PrivateIpAllocationMethod = 'Static' $nic.IpConfigurations[0].PrivateIpAddress = 'ip address' Set-AzureRmNetworkInterface -NetworkInterface $nic
Posted 16-Aug-16 6:17am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180910.1 | Last Updated 16 Aug 2016
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100