Let’s Deploy Azure Analysis Service AAS through Azure DevOps Pipeline

TechFarm by Shahz
Let’s Azure
Published in
5 min readJan 3, 2022

A beginners guide — When AAS meets DevOps Pipeline

Microsoft’s blue-eyed analytics engine is now available as PaaS within Azure stack with its enterprise-grade torque. This Azure Analysis Service, nicknamed AAS, provides a soft and smooth experience for building a data visualization with scale, quickly and intuitively. This story takes you to a tour of deploying AAS model through Azure DevOps.

Check-in Code into A Repo

The first step of building aa CI/CD pipeline is to setup a a collaborative code repo and check-in the deployable code there. For AAS this part is a bit tricky. We should not check-in the entire code from developer workspace but a subset of it. Only selected file from source and binary needs to be checked-in.

There are seven files which we are of importance here

  1. Check-in four source files from the developer working directory — .smproj, .sln, .bim and .bim.layout
  2. Check-in three binary files from bin folder— .asdatabase, .deploymentoptions and .deploymenttargets
  3. use .gitignore to ensure that all other files doesn’t get pushed.

Here is the .gitignore settings that helps to maintain the the git repo clean and focused.

# .gitignore
# Visual Studio 2019 cache/options director
.vs/
/.vs/
bin/Data/*
obj/*
obj/

Setup Library

Before we move into configuring the pipeline, we should create a Library of variable group which we can link to the pipeline and refer. The variables that need to be defined here are as below.

AnalysisServicesName - asazure URL of the target Analysis Service
AnalysisDBName - Name of AAS database to be deployed
ModelName - Name of AAS model to be deployed
AzSQLServerName - Server URL of Azure SQL database
AzSQLDBName - DB name of Azure SQL database
AzSQLDBLoginID - Login username of Azure SQL database
AzSQLDBLoginSecret - Login password of Azure SQL database
AzureADTenantID - Tenant ID of Service Principal
ApplicationClientID - Client ID of Service Principal
ApplicationSecret - Secret of Service Principal

The secrets and passwords can also be referred from Azure Vault, if linked.

Install Marketplace Plugin for AAS

Add the marketplace component for Analysis Service pipeline extension into your Azure Subscription. You need to have admin privilege in Azure DevOps to be able to perform this action. For more details on the marketplace extension refer to this document link.

Setup the Pipeline

For AAS deployment we will use only the Release Pipeline of Azure DevOps. Here is a detailed steps of setting up the pipeline.

  • Browse to Pipelines →Release →New →New release pipeline → Empty Job

This will open the release pipeline setup grid.

  • Edit the name of of the pipeline and give it a name of your choice. For this story we have name our pipeline as AAS Neptune
  • Next click on Add-an-artifact and setup your code repo as the artifact for the pipeline.
  • Once artifact is added, Click on the Task →Stage 1 link in top. This will open the Task setup grid.

Setup the Release Task

The Stage 1 of pipeline task will deploy code into our non production development environment. Let’s call it Develop Stage and rename the stage accordingly. Click on Agent Job and verify the agent specifications.

Next click on + sign in the Agent Job to add the deployment task. Search for the marketplace tasks plugin that we have setup earlier. Click on Add to add this task

Configure the Deployment Task

First thing to setup the deployment is to establish connection between Azure DevOps and Azure Portal. Select Service Connection Type as Azure Resource Manager. In the Service Connection field select the previously configured subscription resource. If there is no service connection configured, click on Manage and create a New service connection. For this specific action you will need to have an admin privilege in both Azure DevOps and specific Subscription in Azure Portal

Next are setting up of Analysis Service Details.

Here the best practice is to use the variables defined in the Library (refer previous section) for all configurations.

Use Service Principal as Login Type.

For configuring Data Source Connection details also, use predefined library variables.

Next is configuring Deployment details. Here browse the artifact directory and add .bim file as model File.

For Partition Deployment configuration Determine how existing partitions are treated during deployment. Choose from one of the below options.

  • Deploy partitions: any existing partitions will be replaces
  • Retain partitions: partitions of new tables will be deployed, but partitions for existing tables will be unaffected

For Role Deployment configuration determine how security roles and role members are treated during deployment. Choose from one of the below options.

  • Deploy roles and members: any existing roles and members will be replaced
  • Deploy roles and retain members: roles will be deployed along with their members for new roles. Members for existing roles will be retained
  • Retain roles and members: the roles and members will not be deployed

Configure rest of the details as default provided. Click on Save and your release pipeline is ready for deployment.

Add More Stages

The steps elaborated above create one stage of the release pipeline. If we have multiple deployment environments (non-production, production etc.) we would need to add more stages, one per deployment target. In this case the artifact and variable groups will also have to be replicated for each target environment. Refer to Azure documentation on adding and managing deployment stages.

Run and Deploy

Executing a release pipeline is super intuitive here. Click on Create new release and then click on Create to start a deployment session.

Happy Coding !

[Please add your valuable feedback and suggestions in the comments]

--

--

TechFarm by Shahz
Let’s Azure

Passionate Enterprise Architect | GenAI Expert | Cloud Architect | Digital Transformation Strategist | Blockchain Enthusiast | Learning Leader