Continuous Deployment of Azure Analysis Services Cubes – Part 1

With Tabular Editor from Daniel Otykier, you can easily deploy tabular models to different stages. This Blog post covers how to do that and how to manage the connection which points to the correct stage. The second part will cover, how to do that with a SQL Authenticated user.
This blog post follows this series:

Firstly, you need a pipeline with three steps: Download the portable version of tabular editor, the preparing of the release which will deployed, and the final deployment. The cube uses an OAuth connection which also must be maintained in the last step.

The first step downloads the Tabular Editor and extracts the content to the environment:

# Download URL for Tabular Editor portable:
$TabularEditorUrl = "" 

# Download destination (root of PowerShell script execution path):
$DownloadDestination = join-path (get-location) ""

# Download from GitHub:
Invoke-WebRequest -Uri $TabularEditorUrl -OutFile $DownloadDestination

# Unzip Tabular Editor portable, and then delete the zip file:
Expand-Archive -Path $DownloadDestination -DestinationPath (get-location).Path
Remove-Item $DownloadDestination

The second step copies the BIM file and replaces the connection. Normally you have different branches, but in this case it is easier. The connection from the BIM file points to the DEV SQL database, the replacement points the cube to the testing database.

Copy-Item "_cube/cube/cube/Model.bim" -Destination "_cube/cube/cube/Test.bim" -Force

(Get-Content "_cube/cube/cube/Test.bim") -replace '"server": "",', '"server": "",' | Set-Content "_cube/cube/cube/Test.bim"

The last step deploys the cube to the testing environment. The password of the deployment user is stored inside a variable and can get from KeyVault ( )

TabularEditor.exe _cube\cube\cube\Test.bim  -D asazure:// Cube -L $(password) -O

But when you want to refresh the cube to get new data, you get an error. The reason why is, that you OAuth connection user doesn’t have actual credential information:

You can fix it, by refreshing the credentials. But you must be aware of, that your credentials will expire.

After that, and when you refresh the cube instantly, the lease time will be updated.

Categorized: Allgemein

Comments are closed.