I am running below code from my automation runbook to refresh analysis service models:
Add-AzureAnalysisServicesAccount -RolloutEnvironment $RolloutEnvironment -ServicePrincipal -Credential $_Credential -TenantId $TenantId
Write-output ("Refreshing Analysis Server mode $DatabaseName...")
# Perform a Process Full on the Azure Analysis Services database
Invoke-ProcessASDatabase -Server $Server -DatabaseName $DatabaseName -RefreshType Full -ServicePrincipal -Credential $_Credential
I am getting following error while running model refresh from azure automation account:
Invoke-ProcessASDatabase : Failed to save modifications to the server. Error returned: 'The given credential is missing a required property. Data source kind: SQL. Authentication kind: OAuth2. Property name: AccessToken. The exception was raised by the IDbConnection interface. Technical Details: RootActivityId: ad01e91e-a17f-4b69-8e1d-ad2f18ddbdeb Date (UTC): 12/30/2019 9:59:09 AM '. At line:24 char:1 + Invoke-ProcessASDatabase -Server $Server -DatabaseName $DatabaseName ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (DevOps:String) [Invoke-ProcessASDatabase], OperationException + FullyQualifiedErrorId : Microsoft.AnalysisServices.PowerShell.Cmdlets.ProcessASDatabase