I'm trying to take backups of AAS databse models using below powershell script. I'm finding hard since there is no good Microsoft documentation around to implement this solution.
$AnalysisServiceDatabase = "adventureworks"
$AnalysisServiceServer = "testanalysis"
$automationConnectionName = $ConnectionName
if (!$ConnectionName) {
$automationConnectionName = "AzureRunAsConnection"
}
$servicePrincipalConnection = Get-AutomationConnection -Name $automationConnectionName
Write-Output "Logging in to Azure..."
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
# Get PSCredential
$cred = Get-AutomationPSCredential -Name $AutomationCredentialName
Write-Output "Starting Backup..."
Backup-ASDatabase `
–backupfile ("backup." + (Get-Date).ToString("yyMMdd") + ".abf") `
–name $AnalysisServiceDatabase `
-server $AnalysisServiceServer `
-Credential $cred
Could anyone help me? If there any alternative way to take automatic backups of azure analysis services databases?