Azure Backup for Iaas V2 released on Public Preview

Update 2 : MS just confirmed me (but not published) that Azure Site Recovery is supported via the new portal, via Recovery Services

Update : MS released the official documents, I was just announcing here Smile

Great news for Azure IaaS V2 users (ARM). Yesterday, Microsoft announced the release of the Public Preview of Azure Backup for IaaS V2 via ‘Recovery Services Vaults’

This is a quick step be step to rapidly configure your VMs backup

NB : Azure Backup via Recovery Services Vaults will let you backup V1 and V2 VMs (Classic and ARM). It’s recommended that you will use it just to get your hands on and not for Production, since it’s not covered by any SLA or commitment (Preview). MS has not published guides to migrate existing Backup vaults to Recovery Services Vaults, but I think this is planned.

Let’s start:

Login to the Azure Portal ( Go to Browse –> Recovery Services vaults


Click the Add + button


Type a Name for the RS vault, choose a Subscription, a Resource Group and a Region. You need to know that the Recovery Services vault in tied to a Region. you cannot Backup/Restore resources to/from a different region.


After the vault creation. you can discover the different options available. Just for Information : Recovery Services Vaults include Azure Backup services (VMs, Files, SCDPM) and ASR (Azure Site Recovery). ASR is currently on Private Preview and is not yet released. File and SCDP support we come soon too.

To configure a Backup, click on Backup +


Select the Backup type. As mentioned, only Azure Virtual Machine Backup is supported by now


You will now choose the Backup Policy. You can select an existing policy or create a new one.


The policy have the following options:

Name : Type a Name for your policy (Class1, Class2, Class3). Just a recommendation, Do not make naming like ‘Daily’ or ‘weekly’ since the retention may differ for two ‘daily’ based policies

Backup Frequency : There are only two options and a start hour. You can make Daily Backups or Weekly backups

Retention : This is great about Azure Backup since on the same policy you can configure your retention and  long term retention (Daily, Weekly, Monthly and Yearly!!)


Once the Policy is selected, you can choose which Virtual Machines to backup with this Policy. Note that Classic VMs and ARM VMs can be backed up with the same policy.


You can verify that the VMs selected are under the Backup Items blade, in addition to some other information like the Last Backup status, the Policy…


On the Backup Jobs Blade, you can find all the Backup Jobs of all VMs. You can change the period using the Filter Button


This just a teaser, more is coming, try it, you can ask me question on the comments, but as a reminder:

  • Do not use on Production, wait for the GA (Maybe 2 months)
  • ASR is not supported yet
  • A lot of enhancements are coming (User Experience mainly), stay tuned

Azure IaaS (ARM) : Architecting and Design Series | Azure Subscriptions

Hi All,

This is the first post of the Azure IaaS (ARM) : Architecting and Design Series, and today the topic is : Azure Subscriptions

This post will detail  the following points :

1- What is an Azure Subscription

2- How to get an Azure Subscription

3- Designing the Azure Subscriptions


1- What is an Azure Subscription

It’s not very complicated to understand what is an Azure Subscription, since the name  holds half the meaning. An Azure Subscription is simply a container and a boundary for all the operations, services and objects you make and create within it. An Azure subscription will be the common parent for anything you deploy and do within it. If you ask a physician about Earth, it will say : The Earth is part of the Solar System, which is part of the Milky Way, which is a Galaxy among billions of galaxies, which are part of the Universe. The Universe is the limit, it’s the final boundary (Based on the single Universe theory), it’s the parent of all the child objects. This is the same thing when you define a Virtual Machine or a Web Site deployed on Azure. You will say, this Web Site is part of the App Service Plan, which is part of the Resource Group, part of this Subscription : This identifies this Web Site. An Azure Subscription is the first door to use Azure Services : You cannot use or deploy any Azure Service without a Subscription. You will need at least one subscription to use Azure services. The Azure Subscription is your ID regards Microsoft to use its Azure services.

A Subscription has the following properties :

  • Identified by a Unique ID : Each subscription has a Subscription ID which identifies it across the world. Two customers can have Subscriptions with the same name but no with the same ID
  • Billing Boundary : When you get billed, MS will charge you per Subscription and for the Subscription usage. You still can get the billing details (consumption per service or per resource)
  • Management Boundary : The Subscription Admin has the total control of everything deployed within the subscription. Thanks to RBAC, the Subscription admin can assign users roles within the Subscription to give them specific permissions.

So what to keep in mind before continuing :

  • A subscription is the top entry point to use Azure Services
  • Is a management and billing boundary


2- How to get an Azure Subscription

Before starting using Azure services, the first step is to get an Azure Subscription. Getting a Subscription depends on your Contract type with Microsoft and how you want to proceed. I added a comparison table at the end of this section to explain which Subscription  type is more suitable for your usage

2.1- Subscriptions types

2.1.1- Trial Subscriptions

For people whom want to discover and test Azure, Microsoft provides today a Free trial Subscription, which will allow you to have some credit (170 $ the time of this post writing) which allow you to create some Azure Resources.

The Trial account expires after one month and cannot be renewed. If you want to keep using the resources you created, you can convert the Subscription to a Pay-As-You-Go Subscription, otherwise your resources will be suspended and then deleted.

The following are the requirements to get a trial subscription:

  • A valid Credit Card : Must be registered on the same country you entered when applying to the trial account
  • A valid phone number : Must be from the same country when applying to the trial account
  • A Microsoft  or an Organizational Account

The Trial Subscription is only available on some countries, but if you know some one from a supported country, you know what to do (It’s free anyway!)

More information ad details on this Link : and

2.1.2- Pas-As-You-Go Subscriptions

This is the first type of Subscription dedicated for real work or business. As you can notice, it’s a Pay as you Go contract which means, you will pay what you consume, but How ?

  • You will need to subscribe to the offer first, just like the Trial Subscription you will need
      • A valid Credit Card : Must be registered on the same country you entered when applying to the trial account
      • A valid phone number : Must be from the same country when applying to the trial account
      • A Microsoft  or an Organizational Account 
  • There is no Commitment, which means, you can cancel (end) the subscription at any time
  • The consumed services will get paid automatically by the end of the month. You can be billed by invoice too
  • You will be rated at the standard Azure services prices

For more information, visit the following link :


2.1.3- Prepaid Subscriptions

As indicated by the name of this offer, you will give a amount of money before using the Azure services within the Subscription. The prepaid Subscription works like the following :

  • It’s a commitment for 12 months automatically renewable
  • You can pay using Credit card or via Invoice
  • The minimum prepaid amount is  6000 $ without tax. Tax may vary by Country. For example, In France we are taxed at 23 % (Huge!!!)
  • You will earn 5 % discount compared to public Azure services prices
  • When you reach the amount of credit you have paid, you can make an additional prepayment or use a Pay-As-You-Go model.
    • If you use the Pas-as-you-Go model, you will not benefit from the 5 % Discount
    • If you add a Prepaid amount, you should consume it before the End of the first 12 months since you billing period will always start since your first engagement.
  • If you reach the 12 months, you will loose all the non-consumed credits
  • You cannot use this credit to purchase some items like third party solutions on the Market place or Azure services sold separately like Azure AD Premium
  • Items with prices depending on the volume will not be covered by the discount (Azure Storage, Data transfer…)
  • You can cancel the Subscription ant any time but keep in mind:
    • No refund
    • If your usage exceeds the prepaid amount, you will have to pay it before ending the Subscription (Since billing for extra usage is at each end of month)

For more information, visit the following link  :


2.1.4- Subscriptions under the OPEN Volume License Program

Many customers use today the Open Volume license program to purchase their Microsoft licenses like Windows, RDS or Microsoft Office licenses. You can use the same approach to get Azure Subscriptions.

To get a new subscription, you can process like the following :

  • Contact your preferred reseller. Ask them to purchase Azure Credits depending of the Open Program you are following. If you are not familiar wit Open licensing program, go HERE
  • The credits are purchased on form of Online Service Activation Keys (OSAK). After that, you have five years to enable those OSAKs. Each enabled key is valid for 12 months, after that, the credit will be forfeited
  • Not all Azure Services can be consumed via activated OSA keys. There are some services like Azure AD Basic and Premium, Market place items or Support Plans which need to be purchased separately.
  • Currently, there are no discounts when using Azure via the Open program

2.1.5- Subscriptions under the Enterprise Agreement

Customers under an Enterprise Agreement contract with Microsoft can make a monetary commitment to benefit from the Azure Services. EA provides the best benefits for Azure customers:

  • Best Prices : Azure services prices under EA are discount prices compared to public prices. Prices can be 30 % lower than Public. Also Microsoft is committed to always provide lower prices than its big competitor AWS
  • Purchase simplicity : Customers under EA can rapidly and simply purchase additional credit faced to an unplanned growth, and benefit from some great rates
  • Annual Payment : Faced to a unplanned growth and usage, customers can pay Microsoft later on the year for the additional  consumed resources, and this under the same rates (under conditions)
  • Enterprise Portal : Customers can benefit from the access to the Enterprise Portal which provide many features
    • Manage and Create Subscriptions
    • Manage Accounts
    • Billing

How and when to start :

  • Contact Microsoft (generally through the TAM or SDM) and ask them for an Azure commitment
  • Choose the amount of credit to pay for a Period of 12 months. If it’s the first enrollment, It’s recommended to ask a Specialist like an Azure architect to predict your usage during the next 12 months. For your next enrolments, it will be easier to predict the usage by using forecast tools (Based on the previous consumption, growth rates and planned growth)
  • Once activated, start using the Enterprise Portal to create Subscriptions

2.1.6- Other Azure Subscriptions types

Microsoft provides other subscription types, mainly for dev/test purposes, we can find :

  • Microsoft Azure for DreamSpark : This is an Azure subscription for students. This subscription type provides only a set of Azure services, which are generally deployable via Visual Studio Community. Teachers, Educators and Researchers can also benefit from this subscription type by applying and requesting an access to it. Of course, in all cases, enrollers should prove that they are from the education circle

  • Azure Subscriptions for Visual Studio subscribers (MSDN) : This is a benefit for the Visual Studio subscribers. Microsoft offers an amount of credit per month to allow these users to deploy and test several Azure services for free. A monthly Azure credit of 150$ (The time of writing this article) is provided and can also be credited when needed (users can add credit to their balance). This type of subscription is the only Microsoft subscription type which allow to deploy Client Operating Systems images from the Market Place like Windows 10, 8.1…


2.2- Subscriptions types Comparison

Subscription type

For whom




  • First Azure experience
  • Test basic features
  • Discover the Azure Services (Portal, User Experience…)
  • Free


  • Infrequent usage
  • Point in time usage (Fixed period)
  • Personal usage (Teaching, demo)
  • No monetary commitment


  • SMB market (Small and Middle business)
  • Mid term usage (Al least one year)
  • Predictable usage (Good for fixed budget)
  • Constant usage over the year
  • 5 % discount
  • Continuous usage over the year

Open Program

  • Customers already familiar/Using with the Open Licensing Program
  • SMB market
  • Small usage variation and growth
  • Under the Open program
  • OSA keys can be bought and activated within 5 years

Enterprise Agreement

  • For customers already part of an Enterprise Agreement
  • For customers with big annual usage
  • For customers with huge, unpredictable and unplanned usage growth
  • For customers whom want to benefit from the best Azure contract type which includes completive discount rates
  • Attractive discount rates
  • Face to unplanned growth

Other types

  • Students, educators
  • Dev/Test purposes
  • Limited usage per month
  • Free


3- Designing the Azure Subscriptions

After presenting the different Azure Subscription types and their specifications, here the most important section of this post, as I will present guidance to better design the first build block of an Azure infrastructure.

3.1- Subscription type

This is the first thing you need to think about : What is the subscription type I will choose ?

This is what was detailed on the first section, you will need to choose which type to use depending on your needs and budget. Read the ‘For whom’ information to look if you are part of the right population. It’s clear that this section concerns only non dev/test scenario :

  • Pay-As-You-Go
  • Prepaid
  • Open Program
  • Enterprise Agreement

3.2- Subscriptions count

After soundly choosing the commitment and subscription type, comes an obvious question on mind ? How many subscription will you need ? The answer can be predicted by asking it otherwise ? Why do you need 2 subscriptions instead of 1, or three instead two ? what will push us to create This is the first X subscriptions instead Y ?

Let me remember you the 3 basics about Azure Subscriptions :

  • Billing boundary
  • Management boundary
  • Quotas and limits constraint*

* You can notice that during Section 1, this information was not mentioned. I intentionally added it in this section because this constraint may change over the time, and hence, no longer be a constraint


3.2.1- Billing boundary

The first characteristic of an Azure subscription is that it’s the top level of the billing detail. Depending of the type of enrollment, you will pay for the usage within a single subscription. The following table shows how the Subscriptions get billed:

Enrollment type



  • The Subscription bill gets paid at the end of the month depending of the payment method (Credit card or Invoice)


  • The Subscription bill gets subtracted from the total ‘prepaid’ amount at the End of each month. You can at any time consult your account to check the balance

Open Program

  • Same statement than Prepaid subscriptions


  • Same statement than Prepaid subscriptions

Now, you can choose how many Subscriptions you will create based on your constraints. The following table shows examples of constraints :


What to do

You have different independent (or just depending a few core services) IT departments and you want to keep independent cost management Create a Subscription per department
You are a Holding Company with a centralized IT service which manage the IT service for all the child companies Create a Subscription for each company. You can go deeper by creating several Subscriptions per department per child company. It depends on the model
You are following a Charge-Back model for you departments or services. You wan to keep using this model when moving to the Azure cloud Create an Azure Subscription per entity to easily track the expenses and keep the charge-back model
You are a Cloud Service Provider managing and charging-back to your customers Create one or more Azure Subscriptions per customer. It’s evident that 2 customers can’t share the same Subscription

Just to note that you can get the billing details ( Per Resource Group…) and can extract usage based on these information, which can be used to charge-back or to get detailed cost spends. As mentioned, an Azure Subscription is the top of the bill, but not the unique billing information.

3.2.2- Management boundary

The choice of how many Subscriptions you will create may be impacted by this second factor which is the management rights. In fact, a Subscription is the top level of the rights assignment. Of course, thanks to the RBAC model which will be seen on a coming post, you can assign rights based on pre-defined or created user roles, but the Subscription stills  the starting point of rights management.

A– Account types and roles

Let me first refresh you memory about the different default account types and roles which apply to Azure and Azure Subscriptions :

Enterprise Administrator

This account type is only applicable for Enterprise Agreement customers. The Enterprise Administrator has the ability to :

  • Add Accounts to the Enrollment
  • Associate existing Accounts to the Enrollment
  • View usage data across all the Accounts
  • Consult the monetary balance of the enrollment and provide the Account’s Owners the rights to view charges

An Enrolment can have many Enterprise Administrators

Account Owner

This is the Principal Important account. This Account can be a Microsoft Account (Live ID) or an Azure Active Directory Account. It has the Ability to create Azure Subscriptions, update the Service Administrator account, and add co-administrators to the Subscriptions. It is financially responsible for the Azure monetary commitment. Microsoft will send invoices to the email associated with the Account Owners. In case of an EA , the Account owner has less privileges since it cannot by default view the Subscriptions balance, unless authorized by the Enterprise Administrators. Account Owners are created by the EA’s Enterprise Administrator. In case of other enrollments, it’s the first created account when enrolling.

Service Administrator (ASM)

The Account owner can create Subscriptions. Each Subscription has a ‘Super Admin’ account which has the total rights across the Subscription. By default, the Account owner is the Service Administrator. The Service Administrator has the ability to add co-administrators to the Subscription.

Co-Administrators (ASM)

Co-Administrators are accounts with the same ‘Service Administrator’ privileges except changing the Service Administrator account. A maximum of 200 Co-admin accounts can be associated to a Subscription (Unlimited with RBAC since it’s the Owner role)

NB : The Service Administrator and the Co-Administrators are part of the ‘Subscription Admins’ group. This is very important to know since the ‘Service Administrator’ and the ‘Co-admins’  are only valid for Azure Service Management model (IaaS V1). In fact, with Azure Resource Manager model, these accounts are no longer used natively. The ‘Super Administrators’ are part of the ‘Owner’ RBAC role. For compatibility reasons between ASM and ARM, the  Subscription Admins group is by default part of the Owner role. This lets the Subscription Admins be ‘Administrators’ at the ARM level

Owner (New Portal)

This is the most powerful RBAC role. Users part of the Owner role are Co-admins of the Subscription. But unlike Co-admins, they cannot use the ‘’ portal, since the RBAC model is not supported on the the old portal. More information will come on the RBAC post.

RBAC Roles (New Portal)

With the new Portal, Azure adds the possibility to use RBAC roles. There are built-in RBAC roles, but you can create your custom RBAC roles for more granular permissions. This allows you to control management rights over a Subscription. More will come on the RBAC post (The last of this Series)

NB : You need to keep in mind that the Enterprise Administrator and the Account Owner are different account types than the others. In fact, they are used to manage the Subscriptions (Create, Manage…), while other account types are ‘roles’ used to operate within the Subscriptions.


B- Design considerations

After presenting the different account types and roles which can be used  in Azure, you may now make decisions about how much subscription you want to create. ’The following are some examples of cases you may be encountering :


Possible decision

You have different departments with an IT team for each one. You want that the IT’s head have total management rights on their respective platform. You can create different subscriptions and make the IT’s head the Owner of the subscription. This way, each one have the full ability to manage its Subscription and assign users the required roles
You are a Cloud Service Provider managing and charging-back to your customers

Create one or more Azure Subscriptions per customer. It’s evident that 2 customers can’t share the same Subscription, even by using the right RBAC roles

You are a Company with a centralized IT service which manage the IT service for all the child companies. Depending on the hierarchy you can :
– Create different Enterprise Administrators and make each company’s IT head an Enterprise Admin
– Create different Account owners and make each company’s IT head an Account Owner
– Create different Subscriptions and make each company’s IT head an owner

It always depends on your needs and requirements, so just keep in mind the management boundary property of a Subscription


3.2.1- Quotas and limits constraint

This the third constraint which will influence you design, and this is us much important us the other factors. Let me explain the meaning of the title.

Azure does not let you create us much resource as you want, it applies limits! For example, as mentioned above you can have a Maximum of 200 co-admin per Subscription (ASM), this is a limit.

The following link provides all the quotas and limits applied to Azure.

NB : It’s important to differentiate the limits applied to Azure Service Management (Classic model) and Azure Resource Manager model, in few words:

  • For Classic model : Limits are applied per Subscription (For example, the default limit of the virtual networks count is 50 per Subscription across all the regions)
  • For ARM model : Limits are applied per Subscription per Region, for simplicity we can say per Region (For example, the default limit of the virtual networks count is 50 per region)

When mentioned and supported, you can ask the Azure Support to increase the limit applied to you since there are default limits and maximum limits. The question is what happens If you plan to exceed these limits ?

Let me write about a real life scenario :  NSG (Network Security Groups). A NSG is a Set of network security rules which can be applied on a NIC (on a VM) to control the network traffic (It’s the Firewall implementation on Azure). If you look to the quotas and limits values, you will see that there is a limit of 400 NSG per region and 500 rules per NSG. Based on the following NSG facts:

  • You can apply an NSG only on Subnet or a VM NIC
  • You cannot apply multiple NSG on a single resource (VM or Subnet)
  • You cannot create composed rules with NSG

What happens then : You will be hit by the limits! Suppose you use the model of 1 NSG per VM  –> You can deploy a maximum of 400 VMs per region, so if you decide to create different VNETs on the same region (VNET Prod, VNET Dev, VNET Int…), this maybe will not be suitable since you can deploy a maximum of 400 VMs across all VNETs. The only solution is to create multiple subscriptions and place a VNET per subscription (Anyway this is not scalable for enterprises creating more than 400 VMs per VNET)

To resume, the Azure maximum quotas and limits is a factor and constraint when designing your Subscriptions.


3.3- Naming the Subscriptions

This is the final section of this post, and I will discuss how you can name your Azure subscriptions. Like explained on the first section, a Subscription is identified via its ID, unique across all Azure customers. But to simplify things, a Subscription has a Name, which can be edited by the Account owner. Choosing a good naming convention is the key of easily manage, identify and recognize the subscriptions.

3.3.1- Questions to ask when making the Naming Convention

The basic thoughts when preparing a naming convention are merely tied to how on the future, we can easily identify a Subscription. Technically, what the Subscription name should contain which satisfies my needs.

Q: What are the common information between all the Subscriptions

A: Generally, this the Enterprise name or the Subscription’s Owner name or identifier. This information should be present on all the Subscription names to identify you

Q: What are the information which differs a Subscription from another

A: This is generally the key points on which you made your Subscription design, for example, you decided to create a Subscription for each Environment (Prod, Dev, UAT…), so these information are worth to be seen on the Subscription name. It can be 1 or more info depending on you deign

Q: Do you plan to add a Subscription of the same type on the future (to scale up)

A: If yes (And I recommend doing it anyway), add a  count suffix to easily identify the Subscription rank


3.3.2- Naming Convention examples

The following table details some examples of naming conventions, and what are the factors leading to choosing them:


Naming Convention

We are a holding company named SamirHolding
We have different child companies
Each child company have 3 different environments
The decision was to create a Subscription for each Environment

HoldingCompany-ChildCompany-Env-xx (where xx is between 01 and 99)
The first company name is Excelium, the subscription names will be:
– SamirHolding-Excelium-Prod-01
– SamirHolding-Excelium-Dev-01
– SamirHolding-Excelium-UAT-01
The second company name is Hydra, the subscription names will be:

We are a company (SamirCorp) with different departments, we wan to create a Subscription for each department. Each department have two environments : Prod and Test CompanyName-Departement-Env-xx













Azure IaaS (ARM) : Architecting and Design Series

Hi All,

Have you ever designed a Hyper-V , a Network or a Storage Platform ? I guess you did. But how if you are faced or asked to design all of them as a single Piece ? I think you got it, I’m talking about Azure.

Azure, and specifically Azure IaaS V2 (using Azure Resource Manager) is a new and recent topic, for Microsoft, for IT Pros and for the customer. When we decide to build an infrastructure, whatever it is, we need to design it first. The design phase is crucial, just like preparing the Plan of building or a bridge, before starting the construction. No plan, no building, unless you want to finish like these engineers Smile



I have been working on Azure IaaS V2 since the first days of Azure Resource Manager, May 2015. Today, I decided to write about the experience I got during this several months, and I will share the design considerations and some design scenarios to help you design an Azure Resource Manager IaaS V2 architecture.

Before you continue, you need to know that the recommendations, the points of view and the ‘I recommend’ may be sometimes based on my experience and my vision. You should always tailor and feet the target design to your needs and requirements.

The following is the Agenda of this Series. Each topic will be detailed in a separate post.

1- Azure Subscriptions

2- Azure Networking

3- Azure Storage

4- Azure Compute

5- Resource Groups


7- Availability and Load Balancing

I hope that this Series will enlighten you  about how to prepare and design an Azure IaaS V2 infrastructure and what are the different scenarios you can choose to better benefit from the power of Azure.

Finally, hope you build something like this Smile. Stay tuned!


la tour eiffel II

Move Azure (ARM) VM between Storage Accounts and beyond

Hi all,

One of the hardest operations which I’m actually encountering when working with Azure virtual machines is to move a Virtual Machine from a location to another.

Moving a VM from a location includes :

  • Change the VM’s Storage Account
  • Change the VM’s Storage Container
  • Change from  subscription
  • Change the VM location/Region
  • Change the Virtual Network

You may also want to :

  • Change the VM name
  • Change the VM’s availability set
  • Pass from single NIC VM to multiple NIC VM

or any combination of them.

Today, I’m publishing the first version of the ‘Move-ArmVM’ powershell script which is intended to provide a simple way to move/recreate an Azure Resource Manager VM (Or VMs), covering different move scenarios. The script will  create a copy of the Source VM. The Source VM will only be stopped, no change will affect it.

Move-ArmVM v1.0


  • Move a VM to a different Storage Account
  • Move a VM to a different Storage Container
  • Move a VM to a different Virtual Network
  • Move a VM to another location
  • Move a VM to a different Subscription
  • Change the VM Name during the move
  • Change the VM’s resource Group during the move
  • Change the VM’s availability Set  during the move
  • Pass from single NIC VM to multiple NICs VM ( Annex 1- How to configure the parameter file to have  multiple VNICs on the target VM)

* This script supports moving one or more VMs (Annex  2- How to configure the parameter file to move multiple VMs)

Release Notes

This version does not support moving/creating the next items. You should create them manually after the move:

  • VNIC’s Public IP
  • Tags
  • Load Balancer Configurations
  • Anything not mentioned on the Features section

Download Link

Version 1.0 Preview :

How To use it ?

I highly recommend you to download this JSON editor. It’s free, simple and will help you visualize and edit  JSON files : JSONedit

1- Fill the parameter file

This script uses a Parameters file, you should first fill the required parameters. The parameter file name is hardcoded, do not change its naming and location (the same location than the script). A ‘Logs’ folder will be created on the working directory. The log files will be created under this folder.







The source Subscription Name SamirSub


The source VM Name (The name of the VM to be moved) ADFS01


The source VM Resource Group ADFSRG


The destination Subscription Name
  • BuildSub


  • Set this value to 0 if you don’t want to place the VM in a availability Set
  • Type the name of the target availability set. If the AS does not exist, it will be created
  • 0
  • AdfsAS


  • Set this value to 1 if you want to use the same source VM Name
  • Type another Name if you want that the moved VM have another name
  • 1
  • ADFSVM01


  • Type a name of the resource group when to place the target VM. If the Resource Group does not exist, it will be created under the same region where the VM will be created


  • Set this value to 1 if you want to use the same source VmSize
  • Type a new VM Size (Standard_A1, Standard_A2, Standard_D1…)
  • 1
  • Standard_D1


  • Type the name of the target Storage Account. This Storage Account must already exist
  • vhdsa


  • Type the name of the target storage container, if the container does not exist, it will be created
  • vhd


  • Type 0 if you don’t want to attach an NSG to this NIC
  • Type the name of destination Network Security Group to attach to this VNIC
  • 0
  • ADFSnsg


  • Type the NSG’s resource Group. If the NSG is set to 0, this parameter will be ignored


  • Type the Virtual Network name for this VNIC


  • Type the Virtual Network Resource Group


  • Type the Subnet name for this VNIC


  • Type the IP address if this VNIC

* The value of this parameter is not monitored, if the value is wrong (Inexistent Vnet, erroned IP…), the script will fail. The error can be checked  on the log file

** You can choose to have multiple VNICs on the target VM. Check the Annex for the how to. The VM size must support the VNICs count

2- Run the script

After the configuration of the parameter file, run the script file. You will be prompted for your Azure credentials. The Parameter file name and location are hardcoded and can’t be changed. The parameter file have to be located on the location than the script file

1- How to configure the parameter file to have  multiple VNICs on the target VM

  • Open the parameter file on a text editor
  • Copy the Section between the two brackets, on the VNICs section


  • Paste it just after the closing bracket of the first VNIC (paste it too many times than the VNICs count). On the example, I will paste it two times because  I want to have 3 VNICs on the target VM


  • Add a comma (,) after all the VNICs closing brackets except the last one


2- How to configure the parameter file to move multiple VMs

  • Open the parameter file on a text editor
  • Copy the Section between the two brackets, on the Virtual Machines section


  • Paste it just after the closing bracket of the previous Virtual Machine (paste it too many times than the VMs count). On the example, I will paste it only one time because  I want to move 2 VMs. Add a comma (,) after all the VMs closing brackets except the last one