Tag Archives: PaaS

Reserving existing dynamic VIPs for Azure Cloud Services

When you create a cloud service in Azure the Public Virtual IP address (VIP) assigned to it is by default dynamic. What this means is that once you stop the cloud service from Azure Portal the next time you start it you are assigned a different public IP. As an example if you de-allocate the underlying VMs in a cloud service this will happen definitely.

Microsoft understands that the customers require static Public IP addresses for their workloads due to the fact that Internet enabled DNS always rely on a static IP. When you create a new cloud service you can assign a static IP reservation for that. Previously it was only possible for new cloud services not existing deployments.

All Azure subscriptions are authorized to use 20 reserved IPs.However if you require more you can ask them an extension.

Let’s see how we can reserve an existing VIP assigned to a cloud service reserved.

Convert a dynamic VIP of to Reserved VIP

Take a look at below Azure PowerShell cmdlet.

New-AzureReservedIP -ReservedIPName “jcbvip01” -Location “Southeast Asia” -ServiceName “jcbvipcs”

Notice the -ServiceName parameter. This enables to provide an existing cloud service name where it will automatically reserve the exiting VIP.

Removing a Reserved IP from an existing deployment

You can use below cmdlet to remove the static VIP association.

Remove-AzureReservedIPAssociation -ReservedIPName “jcbvip01” -ServiceName “jcbvipcs”

Reassigning the VIP to another deployment

Here you simply provide the new cloud service name.

Set-AzureReservedIPAssociation -ReservedIPName “jcbvip01” -ServiceName “nabvipcs”

One important thing is that reassigning should occur within the same Azure region as these IP addresses are location specific. You cannot assign the same IP reservation to a service that is running in a different Azure region.

IIS Web site migration with Azure Website Migration Assistant

As I promised in my last post today we are going to migrate a simple IIS hosted web site to Azure websites.  Note that this tool only supports IIS 6.0 and higher versions.

For this demonstration I have used a standalone Azure VM with a static webpage. I admit that below website is ugly but it serves the purpose.

Azure Website Migration Assistant 17

Setting up Azure Websites Migration Assistant

  1. Navigate to https://www.movemetothecloud.net from your client PC or the IIS server itself.
  2. Click Dedicated IIS Server and then and then Install Tool. This will launch a Click-once Installation. based on my past experience with Click-once I strongly recommend you to use Internet Explorer. Also you can Download for offline use to install in another Server/PC. Note that there is an additional option to Upload an existing migration report which is described later.Azure Website Migration Assistant 1Azure Website Migration Assistant 2
  3. Click yes to Install Web Deploy.Azure Website Migration Assistant 3
  4. In the next screen it will check for all  the dependencies required for the migration. If required it will install the missing components.Azure Website Migration Assistant 4
  5. Choose Migrate sites and databases on the local server to azure option and click Continue, if your are running the tool inside your IIS server. If not select the second option and provide the administrative credentials.Azure Website Migration Assistant 5
  6. It will check for the websites and their relevant dependencies and will allow you to choose which websites you want to migrate. In my scenario I have a simple web page in Default web site so I selected same. Azure Website Migration Assistant 6
  7. It will generate a migration readiness report containing all the configuration information of your IIS instance and dependencies. You can click Upload to continue or Save it locally and upload at a later time. (Refer step 2)Azure Website Migration Assistant 7
  8. Azure will perform a readiness analysis based on the report you uploaded and reports if any errors are found. Click Begin Migration to continue.Azure Website Migration Assistant 8
  9. You will be prompted to provide your Azure credentials here. Azure Website Migration Assistant 10
  10. Select your Tenant, Subscription and the respective region that you want to deploy this website/s and click Start Migration.Azure Website Migration Assistant 11
  11. In the Migration screen it will allow you to customize site level and global settings for the migration such as website names, databases, database sizes etc… Since my IIS server is also an Azure VM I have provided it a name and changed the Site Mode to Free to avoid unwanted credit consumption. Click Create to begin the migration. Azure Website Migration Assistant 12 Azure Website Migration Assistant 13
  12. Migration Assistant will perform the actual migration and once migrated click Publish to publish your site to Azure. Also at the end of the migration if there is any error occurred it will immediately revert the migration and let you to report the error directly to Azure Team via e-mail.Azure Website Migration Assistant 14 Azure Website Migration Assistant 15Azure Website Migration Assistant 16
  13. There were no errors in my migration so the new site looks like below.Azure Website Migration Assistant 18
  14. Additionally if you look at your Azure Portal you can see the new website is running and you and further customize the site as you would do for a regular Azure website. (i.e scale up)Azure Website Migration Assistant 19

Introducing Azure Websites Migration Assistant

Do you want to migrate your IIS hosted web site to Azure easily? Thinking about all the headache that you have to face when doing so? Now it’s time that Microsoft has taken away that burden.

Azure Websites Migration Assistant lets you to migrate your IIS 6.0 or higher hosted website to Azure without any implication. This great tool will thoroughly examine your IIS web server, report back which web sites can be migrated and if there anything that cannot be migrated it will notify same. Just in a matter of few clicks you can migrate compliant websites along with their configuration files and back-end web databases.

How to migrate?

Just few easy steps.

  1. Port bindings (i.e http or SSL mappings)
  2. Application Pools
  3. Virtual directories and web applications
  4. Databases
  • Upload the migration report that you generate from the tool.
  • Migrate your website. You’ll have to enter your Azure credentials along with which region you want this site to run on.

In a later post I’m going to show you how to migrate a simple website to Azure Websites using Migration Assistant.

Assigning Static Internal IP for an Azure VM

If you are doing your DEV/Test in Azure and de-allocating your VMs frequently you may have noticed that the Internal IPs assigned to your VMs are changing. By nature Azure wants you to run your VM continuously to have a reservation for your Internal IPs as there are million tenants like you using Azure over the world and to ensure everybody gets equal service.

If you are running DNS server in Azure you need to have a static IP regardless you de-allocate the VM, you need the same IP to work next time to prevent name resolution conflicts. Today I’m going to show you how to assign a Static DIP to Azure VM and some of the best practices that you should keep in mind when assigning DIPs.

Keep in Mind

  • If you have both IaaS & PaaS services in your tenant (i.e VMs and Cloud Services) it is always recommended to keep them in different subnets if you are using DIPs. Just in case if you are de-allocating a VM with static DIP it prevents your cloud services from acquiring the same DIP if they are in the same subnet.
  • Only assign DIPs for workloads that needs them the most (i.e DNS). Again this is not a requirement but you’l have to worry less if you have only fewer configuration changes.
  • Always use a Virtual Network with subnets properly assigned. Otherwise it would be pointless to use a DIP as there won’t be any allocation at all.

Lets take a look on the process.

Check the availability of the IP Address

You have to make sure the IP Address that you are going to use from your IP Pool is available prior assigning.

Test-AzureStaticVNetIP –VNetName JCBVNet –IPAddress

In the above example I’m checking the availability of the IP address for the Virtual Network JCBVNet.

Assigning Static DIP

For a new VM

Make sure you get your PowerShell cmdlets right. You can use variables instead of hard coded placeholders for parameters like -Name but again that’s upto you. Parameters like -ImageName has lengthier vaules to it is better to get the image name and store it in a variable when you pass the value to a cmdlet. Some of these parameters like -AffinityGroup are not mandatory but will be useful depending on your deployment. For a complete reference just bing (yes bing not google) the cmdlet name.

New-AzureVMConfig -Name jcbdipvm1 -ImageName $img –InstanceSize Small | Set-AzureSubnet –SubnetNames JCBVNet | Set-AzureStaticVNetIP -IPAddress | New-AzureVM –ServiceName jcbdipsvc –AffinityGroup “jcbAG”;

For an existing VM

From my experience, it is always better if you can stop the VM before you perform this on a existing VM. This is because the Update-AzureVM cmdlets restarts the VM once it has assigned the DIP. If the VM was running it will take some time and believe me you don’t want that to happen on something like DNS server. If you have previously assigned a DIP you will have to remove it first.

Get-AzureVM -ServiceName jcbdipsvc -Name jcbdipvm2| Set-AzureStaticVNetIP -IPAddress | Update-AzureVM

Removing a DIP

Get-AzureVM -ServiceName jcbdipsvc -Name jcbdipvm1 | Remove-AzureStaticVNetIP | Update-AzureVM

As part of the update VM will automatically receive a new IP address once it is restarted by the Update-AzureVM cmdlet.

It’s not rocket since if you read carefully. This is very useful for a production environment or if you have a lab environment that is not going to be running continuously to save Azure credits but still require static IP addresses for the workloads. My advice is to learn PowerShell a bit before you deal with Azure or you can keep blaming the platform not being good enough. (Which is so not true.)