Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

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

PERL
$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:

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900