ARM Resource Manager Template Deployment with Azure Analysis Services
Published Jan 15 2019 05:39 PM 807 Views
First published on MSDN on Sep 27, 2017
Analysis Services model can be deployed in Azure in different ways like from SSDT or by running the JSON create script from SSMS.

We can leverage the richness of template deployment in our Azure Analysis Services as well.

What is Template Deployment in Azure?

The Resource Manager template you deploy can either be a local file on your machine, or an external file that is in a repository like GitHub through the Azure Portal. The same template can be deployed in multiple environment just changing the Environment parameters.


We will focus only to create the Azure Analysis Services Instance using a template. Here we will not use the Azure portal for the deployment, whereas we will use the PowerShell command to deploy the instance and configure the backup storage.

Also, we can use the parameter files explicitly to define the parameter values as described. Here we will pass the parameters directly from the PowerShell.


  1. The storage account and a resource group must have been created before executing the template.

  2. You should be the Admin of the subscription who has the access to create a resource in the Subscription.


  1. You need to get the storage account access key: You can follow the below screenshot:

PowerShell Command:
##Installinig AzreRm.Resources Module.
#Install-Module AzureRm.Resources
##Install-Module Azure
Get-Module -ListAvailable -Name AzureRm.Resources | Select Version


# replace with your information
$serverLocation = "West Europe"
$serverName = "backuptestserver1"
$storageAccount = "samtestblob"
$storageKey = "n1P9xnk/3x4HkaybaLYmmtOVvLHd#####################################"
$RGName = "RGSamSSAS"
$TemplateFile = "C:\temp\AzureASwBackup.json"

$asAdmin =""

##Adding 99 years. Please note that if we don’t specify any expiry time, it will by
##default take one hour. After one hour you might not be able to take the backup.
$starttime = Get-Date
$endtime= $starttime.AddYears(99)

$storageaccountContext = New-AzureStorageContext -StorageAccountName $storageAccount -StorageAccountKey $storageKey
$containerSASURI = New-AzureStorageContainerSASToken -Name $containerName -Permission rwdl -FullUri -Context $storageaccountContext -StartTime $starttime -ExpiryTime $endtime
$parameters = @{}
$parameters.Add("serverName", $serverName)
$parameters.Add(“asAdmin”, $asAdmin)
$parameters.Add("skuName", $skuName)

# using SAS token
$parameters.Add(“storageContainerURI”, $containerSASURI)

New-AzureRmResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $TemplateFile -TemplateParameterObject $parameters -Verbose


Reference Document:
"$schema": "",
"contentVersion": "",
"parameters": {
"serverName": {
"type": "string",
"defaultValue": "BackupTestServer"
"serverLocation": {
"type": "string",
"defaultValue": "West Europe"
"storageContainerURI": {
"type": "string",
"defaultValue": ""
"asAdmin": {
"type": "string",
"defaultValue": ""
"skuName": {
"type": "string",
"defaultValue": ""
"skuTier": {
"type": "string",
"defaultValue": " "

"resources": [
"name": "[parameters('serverName')]",
"type": "Microsoft.AnalysisServices/servers",
"apiVersion": "2016-05-16",
"location": "[parameters('serverLocation')]",
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]"
"tags": {},
"properties": {
"asAdministrators": {
"members": [
"backupBlobContainerUri": "[parameters('storageContainerURI')]"
"outputs": {

Author: Samarendra Panda - Support Engineer, SQL Server BI Developer team, Microsoft

Reviewer: Orsolya Gal – Support Escalation Engineer, SQL Server BI Developer team, Microsoft
Version history
Last update:
‎Jan 15 2019 05:39 PM
Updated by: