Cloud site migration with Azure Websites Migration Assistant

    Cloud technologies are increasingly penetrating our lives, allowing us to easily and quickly deploy complex technical solutions to huge computing power in just a few clicks of the mouse. The main giants of the IT market are constantly improving their services, introducing more and more new opportunities. The advantage of clouds is quite obvious - speed, power, scalability and ease of configuration. This can be a great solution if you are starting a new project or a startup.

    But what if you already have a website hosted at your own facilities? This resource works, the database is probably connected to it, various settings in the config are applied, and so on. In this case, migration to the cloud is a rather troublesome process. Even if you really understand that you can win by using the cloud, it’s not a fact that the difficulty of transferring all this environment can outweigh these advantages.

    For such cases, Microsoft introduced its new tool -  Azure Websites Migration Assistant. This is a small program that can collect the necessary information about a website hosted on IIS (starting with version 6), analyze it, and then automatically transfer all settings, files and, most importantly, even the database directly to the Microsoft Azure cloud.

    In this article, I will demonstrate by my own example that site migration is really easy and takes several minutes to complete.


    I prepared a website and placed it on my local computer with IIS 8:

    By the way, it is worth focusing on the fact that the website is migrating, and not the virtual directory. In this case, in addition to the Default Web Site, I have created a migrations site , which I will transfer. This is a simple ASP.NET site created using a template in Visual Studio 2013. A database is also connected to it, also located on the local computer in SQL Server Express:

    The database structure is simple and contains only information about the user and roles. This database is created automatically with the website. Here's how it looks in the end:

    Bindings are configured for the site to open by default when localhost is called: 80. Of course, this example is not super complicated, but even in such a simple case, the independent migration of all files, settings and the database would take quite a long time (at least a day).

    Azure Website Migration Assistant

    The first thing to do is download the Azure Website Migration Assistant utility from the official site . It is a simple ClickOnce application, made in the style of a step-by-step wizard.

    In the first step, you will be asked to choose where to look for the site that you want to migrate:

    There are two options - a local computer or a remote server. The second is especially useful if you do not have physical access to the server with your website or installing additional software there for one reason or another is not possible.

    In our case, I choose the first option, and the utility offers me to specify which site I will be migrating:

    I do not want to transfer the Default Web Site, because there is nothing there, so I only select the migrations site.

    As soon as you make your choice and click Next, a brief analysis of your IIS and determination of the key parameters of the website will be made. It looks something like this:

    On this screen, the basic server settings are listed, such as the protocol and port number on which the site is available, the application pool in which the code is executed, and also, note, database connections. This setting (and not only it) is taken from web.config of your site. This means that, firstly, the Azure Website Migration Assistant knows that your site works with the database (and then takes this into account), and secondly, it can transfer any other specific configuration parameters and apply them in the cloud.

    The next step (which is called by the Upload button) will show you a report on the readiness of your site for migration. This report is compiled on a server in the cloud and identifies any potential inconsistencies between your on-premises configuration and what might work in Azure.

    At the moment, there is a list of known restrictions that are listed in a special section on the official Azure Websites Migration Assistant. In my case, all the checks turned out to be successful and the migration can continue:

    After clicking the Begin Migration button, the most interesting part starts - working with Azure. You will be asked to log in using your "cloud" account. I see no reason not to do this :)

    After you log in successfully, the utility will be able to obtain data about your cloud and the resources that it has. In the next step, you can choose which subscription you want to add the new website to and in which region it should be located:

    I will choose West Europe as the closest. The Start Migration button actually doesn’t start the migration yet, but sends it to the next settings screen:

    And this is the screen I consider to be the coolest in the whole utility. Remember, I said that the Azure Websites Migration Assistant reads settings from web.config, including the database connection string? So, this is done for a reason, because on this screen you can create a cloud database, into which then the scheme and data are transferredfrom the local database. It is enough to specify the server name and administrator login / password.

    The bottom half indicates the parameters of the future site - its name and the name of the database. Also in the Customize settings section, you can configure the power settings of the future site. You can choose from all the options available in the usual Azure management portal :

    The next step is to create cloud facilities: a website and a database server:

    After everything is completed, the last step remains - data transfer. When you click on Begin Publish, all the local files of your website will be transferred to the cloud, along with the database structure and data:


    To make sure that everything works correctly, just go to the address of the cloud site and compare with the local version:

    Pay attention to the URL - this is not localhost, but a full-fledged website on the Internet. And also look at the top right of the site where Hello is written : . Information about the user is taken from the database, and the fact that this user is visible in the cloud site indicates that the database schema, its data, and connection parameters - everything was transferred by Azure Websites Migration Assistant without problems and restored to the cloud in pristine form.

    Additionally, you can check what happens in the management portal : The

    new site is accessible and connected to the migrations database. Great, what else to say!

    Not the end

    This utility is not a final release, and will continue to develop. Some limitations are already known:
    • only ports 80 and 443 are available (limitations of Azure itself), so if you are using something else, think about workarounds
    • authentication can only be anonymous or through web forms, and Windows Authentication can be done through Azure Active Directory
    • COM components and custom ISAPI filters will also not be automatically transferred, you will need to turn them on by hand
    • full list here

    All code of this utility is available for free access on Codeplex . So if you really want to, you can refine it yourself. Well, also at almost all steps of the utility there is a link to the feedback form - do not be too lazy to write a review for the developers so that he can improve the tool in future releases:

    Good luck with your migration!

    PS And if you do not have Azure yet, but want to try, then here you can find a free trial

    Also popular now: