Automatically Pausing/Resuming an Azure Analysis Services model
Here is a great walk thru on YouTube
Introduction
One of the key value propositions of cloud computing is only paying for resources when you need them. So why pay to run an expensive in-memory model, like Azure Analysis Services when you aren’t using it. Using Azure Automation runbooks this tutorial will show you how to automatically pause and resume your Azure Analysis Services models on a schedule.
You could combine this with the article I wrote on pausing and resuming a VM from Data Factory, to use this as a trigger instead or even call the PowerShell scripts from Azure DevOps to automate the starting of a development server when you are running your testing pipelines.
Step 1: Create an Azure automation account
From within the Azure portal, navigate to the Automation Account
service and create a new account.
You will need elevated privledges to create this account.
Make sure to create this account within the same subscription and resource group as the virtual machines you want to control.
The Create Azure Run as account
option must be set to ‘Yes’.
Step 2: Import the required modules
You will need to import the az-accounts
and az-analysisservices
module for the automation account.
Step 3: Create a runbook
Create runbooks using the script in this repo. This script checks to see if the model is paused or running and flips the switch the other way. It would be easy to adapt this code to only ever turn on or off, which I would recommend in a live environment.
Step 4: Link to a schedule
Create an automation schedule to start and stop the model at the needed time intervals. You can also create a webhook to connect to Data Factory as a trigger (mentioned above).