I gave a demo at MMS 2016. The demo in the session was titled “Write once, deploy anywhere“. The purpose of the demo was to show using 1 ARM template (JSON file) and 1 PowerShell script to deploy a VM regardless if I was deploying to Azure or Azure Stack. The demo was a success so yes this is really possible. In a blog post (link below) I break down the JSON file, the PowerShell script I built, how it works and the download link for the files.

This download consists of a ARM JSON template and a PowerShell script. These can be used to deploy an IaaS virtual machine onto Azure or AzureStack. Full blog post with more details here: http://www.buchatech.com/2016/05/write-once-deploy-anywhere-azure-or-azure-stack

12-19-2016 v3 Update:

    The JSON and PowerShell script have been modified to work with Azure Stack TP2.

    This script now utilizes the connection PowerShell module AzureStack.Connect.psm1 from Azure Stack tools.

    This is included with the download of this script and JSON file on TechNet Gallery. The script is hard coded to look locally to import the AzureStack.Connect.psm1 module.

 

    Streamlined the JSON file and PowerShell script. The script no longer prompts for the publicDNS name. It is now automatically set to the same as the vmname.

    The script no longer prompts for the storage account name. It is automatically set to vmnamestorage.

    The script no longer prompts for the resourcegroup name. This is now automatically set to vmname-RG.

 

    By default this script now uses a JSON file hosted on Github. This is set in the $templateFilePath variable as shown on the next line.

    To keep it to the local directory just use the JSON file name.

    GITHUB: $templateFilePath = "https://raw.githubusercontent.com/Buchatech/Azure-AzureStackVM/master/AzureandAzureStack.json".

    LOCAL: $templateFilePath = "AzureandAzureStack.json"