Your SEO optimized title page contents

Cost Saving Capabilities on Azure for Dynamics AX 2012 R3

How cost savings can be possible for Dynamics AX 2012  R3 VMs

Azure Resource Manager (ARM) and classic deployment models (ASM) represent two different ways of deploying and managing your Azure solutions. You work with them through two different API sets, and the deployed resources can contain important differences. The two models are not compatible with each other.

To simplify the deployment and management of resources, Microsoft recommends that you use Resource Manager for all new resources. If possible, Microsoft recommends that you redeploy existing resources through Resource Manager.

Any Dynamics AX 2012 R3 environment that is deployed via LCS is ASM model. LCS doesn’t support Dynamics AX 2012 with ARM. However, by the help of AX 2012 ARM templates you can achieve this. 

For details: How to Migrate to ARM model from ASM model?


Let’s say you have a DS13_V2 VM (8 Cores, 56 GB RAM). With Pay as you go option only, if you deploy this on West Europe region, cost per month will be like below screenshot:

Virtual Machines

Pay as you go

If you buy this VM instance as reserved for three years, then the cost per month will be:

RI 3 years only

You will have nearly 38% costs saving. If you also add Azure Hybrid Benefit:

RI 3 years + AHUB

Total cost savings will be nearly 71% per month for one virtual machine.  

Note: To benefit from Azure Hybrid Benefit (AHUB) you have to use ARM model.

How to Migrate to ARM model from ASM model?

For migrating from ASM, you will have to stand up a parallel environment using the ARM templates below, and then backup/restore DB from ASM to ARM. The Azure’s ASM to ARM tools does not support LCS based environment.

PowerShell scripts for ARM machines

ARM templates will help getting a basic High Availability (HA) environment deployed. SQL tuning configuration will be needed, as referenced in this link: Plan your Dynamics AX 2012 R3 deployment on Azure. These templates provide a starting point, partners/customers are free to modify them as needed.

Note: To add Azure Hybrid Benefit (AHUB) discount to templates please look section Create a VM with Azure Hybrid Benefit for Windows Server below. Reserved Instance (RI) discount can be set from portal as described in section Buy a Reserved Instance.

Key Highlights

No custom image for Dynamics AX VMs

This template uses VM images already available on Azure and published by Microsoft. With this approach, there is no cost to maintain a custom image with updates and pre-requirements. The prerequisites are handled by the deployment scripts.

Usage of PowerShell DSC resources to run machine configuration scripts

PowerShell DSC (Desired State Configuration) is a handful solution to setup Windows machines. There are many existing resources available published by the PowerShell team to configure many aspects of Windows and its applications, such as: Active Directory, Network, DNS, Windows Features, Disks, SQL Server and SharePoint. 

These resources are always being updated with new versions and its usage is as simple as calling a “method” and passing parameters, avoiding complicated PowerShell scripts and producing a cleaner code. It is also idempotent by nature, which allows to re-execute the scripts in the same machine without compromising its state. We will discuss more about PowerShell DSC later in this document.

Azure Active Directory and its consequences

Instead of a local AD, we will be relying on Azure Active Directory. Unfortunately, AAD is not yet supported on ARM so this template is not able to deploy it. As a consequence, a specific setup is required to connect an ASM/RDFE VNet with an ARM VNet and an additional configuration is also needed to set the DNS name for the RDS connection broker. These configurations are not supported by this project.

When AAD gets available on ARM, all this troublesome configuration can be replaced by some lines in the template.

AX2012R3 Components

The AX2012R3 deployment consists of multiple components. Below are listed the components installed from the ARM Template. Any components out of the list are not installed by this template (Retail Components, Management Reporter, Data Import Export Framework, etc.).

  • Database
  • Application Object Server (AOS)
  • Business intelligence components
    • Reporting Services extensions
    • Analysis Services configuration
  • Client components
    • Client
  • Web server components
    • Enterprise Portal (EP)
  • Management Utilities

More detail can be found in here:

Can I use LCS for ARM deployment?

LCS supports only ASM model VMs deployments for time being.

Can I manage ARM environment that deployed with these templates via LCS?

Deployed environment won’t be LCS managed (meaning you can’t start/stop from LCS). You can still hook up the LCS System Diagnostics tool between the LCS project and your environment.

When customers use the ARM model, not using LCS for start/stop VM will this put them in an unsupported state or not?

They will be supported if the criteria outlined in Plan your Dynamics AX 2012 R3 deployment on Azure is met. LCS direct connection is not a requirement. It is recommended that they install LCS diagnostics after deploying the environment.

Azure Reserved VM Instances (RIs)

Prepay for Virtual Machines with Azure Reserved VM Instances

Prepay for virtual machines and save money with Azure Reserved Virtual Machine (VM) Instances. For more information, see Azure Reserved Instances offering.

You can buy Azure Reserved Instances in the Azure portal. To buy a Reserved Instance:

  • You must be in an Owner role for at least one Enterprise or Pay-As-You-Go subscription.
  • For Enterprise subscriptions, Reserved Instance purchases must be enabled in the Enterprise Agreement (EA) portal.
  • For Cloud Solution Provider (CSP) program, only the admin agents or sales agents can purchase the Reserved Instances.

Buy a Reserved Instance

  1. Log in to the Azure portal.
  2. Select All services > Reservations.
  3. Select Add to purchase a new Reserved Instance.
  4. Fill in the required fields. Running VM instances that match the attributes you select qualify to get the Reserved Instance discount. The actual number of your VM instances that get the discount depend on the scope and quantity selected.

    Field Description
    Name The name of this Reserved Instance.
    Subscription The subscription used to pay for the Reserved Instance. The payment method on the subscription is charged the upfront costs for the Reserved Instance. The subscription type must be an enterprise agreement (offer number: MS-AZR-0017P) or Pay-As-You-Go (offer number: MS-AZR-0003P). For an enterprise subscription, the charges are deducted from the enrollment's monetary commitment balance or charged as overage. For Pay-As-You-Go subscription, the charges are billed to the credit card or invoice payment method on the subscription.
    Scope The Reserved Instance’s scope can cover one subscription or multiple subscriptions (shared scope). If you select:
    Single subscription The Reserved Instance discount is applied to VMs in this subscription.
    Shared The Reserved Instance discount is applied to VMs running in any subscriptions within your billing context. For enterprise customers, the shared scope is the enrollment and includes all subscriptions (except dev/test subscriptions) within the enrollment. For Pay-As-You-Go customers, the shared scope is all Pay-As-You-Go subscriptions created by the account administrator.
    Location The Azure region that is covered by the Reserved Instance.
    VM Size The size of the VM instances.
    Term One year or three years.
    Quantity The number of instances being purchased within the Reserved Instance. The quantity is the number of running VM instances that can get the billing discount. For example, if you are running 10 Standard_D2 VMs in the East US, then you would specify quantity as 10 to maximize the benefit for all running machines.
  5. You can view the cost of the Reserved Instance when you select Calculate Cost.

    Calculate Costs

  6. Select Purchase.
  7. Select View this Reservation to see the status of your purchase.

Reservation submitted

Next steps

The Reserved Instance discount is applied automatically to the number of running virtual machines that match the Reserved Instance scope and attributes. You can update the scope of the Reserved Instance through Azure portal, PowerShell, CLI or through the API.

To learn how to manage a Reserved Instance, see Manage Azure Reserved Instances.

To learn more about Azure Reserved Instances, see the following articles:

Azure Hybrid Benefit (AHUBs)

Azure Hybrid Benefit for Windows Server

For customers with Software Assurance, Azure Hybrid Benefit for Windows Server allows you to use your on-premises Windows Server licenses and run Windows virtual machines on Azure at a reduced cost. You can use Azure Hybrid Benefit for Windows Server to deploy new virtual machines with Windows OS. This article goes over the steps on how to deploy new VMs with Azure Hybrid Benefit for Windows Server and how you can update existing running VMs. For more information about Azure Hybrid Benefit for Windows Server licensing and cost savings, see the Azure Hybrid Benefit for Windows Server licensing page.

Note: Each 2-processor license or each set of 16-core licenses are entitled to two instances of up to 8 cores, or one instance of up to 16 cores. The Azure Hybrid Benefit for Standard Edition licenses can only be used once either on-premises or in Azure. Datacenter Edition benefits allow for simultaneous usage both on-premises and in Azure.

Note: Using Azure Hybrid Benefit for Windows Server with any VMs running Windows Server OS are now supported in all regions, including VMs with additional software such as SQL Server or third-party marketplace software.

Note: For classic VMs, only deploying new VM from on-prem custom images is supported. To take advantage of the capabilities supported in this article, you must first migrate classic VMs to Resource Manager model.

Ways to use Azure Hybrid Benefit for Windows Server

There are few ways to use Windows virtual machines with the Azure Hybrid Benefit:

  1. You can deploy VMs from one of the provided Windows Server images on the Azure Marketplace
  2. You can upload a custom VM and deploy using a Resource Manager template or Azure PowerShell
  3. You can toggle and convert existing VM between running with Azure Hybrid Benefit or pay on-demand cost for Windows Server
  4. You can also apply Azure Hybrid Benefit for Windows Server on virtual machine scale set as well

Create a VM with Azure Hybrid Benefit for Windows Server

All Windows Server OS based images are supported for Azure Hybrid Benefit for Windows Server. You can use Azure platform support images or upload your own custom Windows Server images


To create a VM with Azure Hybrid Benefit for Windows Server, use the toggle under the "Save money" section.



-ResourceGroupName "myResourceGroup"

-Name "myVM"

-Location "East US" `

-ImageName "Win2016Datacenter"

-LicenseType "Windows_Server"


Within your Resource Manager templates, an additional parameter licenseType must be specified. You can read more about authoring Azure Resource Manager templates

Convert an existing VM using Azure Hybrid Benefit for Windows Server

If you have an existing VM that you would like to convert to take advantage of Azure Hybrid Benefit for Windows Server, you can update your VM's license type as follows:


From portal VM blade, you can update the VM to use Azure Hybrid Benefit by selecting "Configuration" option and toggle the "Azure hybrid benefit" option


  • Convert existing Windows Server VMs to Azure Hybrid Benefit for Windows Server
$vm = Get-AzureRmVM -ResourceGroup "rg-name" -Name "vm-name"

$vm.LicenseType = "Windows_Server"

Update-AzureRmVM -ResourceGroupName rg-name -VM $vm
  • Convert Windows Server VMs with benefit back to pay-as-you-go
$vm = Get-AzureRmVM -ResourceGroup "rg-name" -Name "vm-name"

$vm.LicenseType = "None"

Update-AzureRmVM -ResourceGroupName rg-name -VM $vm

How to verify your VM is utilizing the licensing benefit

Once you have deployed your VM through either PowerShell, Resource Manager template or portal, you can verify the setting in the following methods.


From portal VM blade, you can view the toggle for Azure Hybrid Benefit for Windows Server by selecting "Configuration" tab.


Get-AzureRmVM -ResourceGroup "myResourceGroup" -Name"myVM"


Next Steps


Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose.

This post assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. */

Comments (3)
  1. DKobayashi says:

    Good post. Thanks for sharing!
    I hope this feature will reflect to price of Dynamics 365 Finances and Operations license. Is this feature used for D365FO VMs and Azure SQL DB?

    1. This post is only covering version Dynamics AX 2012 R3 Azure deployments.

  2. gvnshn says:

    thanks, very helpful.

Comments are closed.

Skip to main content