I'm trying to get my AAS models processed automatically using Azure Automation Runbooks. Our tenant uses multi-factor authentication so doing it with AD users is not an option, so I'm trying to make it work through a Service Principal (AzureRunAsConnection specifically).
I've gone through all this post basically, Use Automation RunAs service principal to connect to Azure Analysis Services and process
But I still can't get the script works using the AzureRunAsConnection, the message I still get is
Invoke-ProcessTable : The "XXXX" database does not exist on the server.
The question in the link solves it by granting permissions via SSMS, but I already did that and still getting the same problem.
Any help is appreaciated
I got a solution to this problem from the MSDN forums, Eamon O Reilly suggested me to add the Service Principal to the AAS admins via this command:
$SPAdmin = "app:c9ab3d0cf43-38b9-4d52-ba97-001ddaede361b@72fCCFbf-86f1-41af-9aab-25fd7cd011aac47"
Set-AzureRmAnalysisServicesServer -Name <analysisserver> -ResourceGroupName <resourcegroupname> -Administrator $SPAdmin
What I didn't know was that the AzureRunAs connection of the Runbook has a different application id than the actual service principal, so once I added the AzureRunAs application id as an AAS admin, the runbook worked.