Processing Analysis Services Table in PowerApps
This tutorial was requested by one of our clients. His app was connected to DWH, which was the source for the Analysis Services. After the data was input into the edit form, the task was to start processing the table to see it through Power BI.
As a prerequisite, check if you have all the permissions to create new resources in your Azure subscription and have credentials that can be used to authenticate with the AS server.
My proposed solution:
1. After setting up the cube click “Create a resource”:
2. Type in Automation and click the first icon
3. After the resource is created select Credentials in Shared Resources on the left pane.
4. Add credentials that have access to table/cube processing.
5. After saving credentials click Modules in Shared Resources on the left pane.
6. Using Browse gallery install missing modules and update them. The complete list should look like this:
7. Next click Runbooks in Process Automation on the left pane
8. Add new runbook and select its type to PowerShell
9. After creating a runbook, enter it and click Edit and paste this code:
1 2 3 4 5 6 7 8 |
## Providing the Server Details $ServerName = "asazure://<region>.asazure.windows.net/<aas_server_name>" DatabaseName = "<DB_name> " $TableName ="<Table_name>" $AzureCred = Get-AutomationPSCredential -Name '<Your credentials name>' Add-AzureRmAccount -Credential $AzureCred | Out-Null Invoke-ProcessTable -databasename $DatabaseName -server $ServerName -RefreshType "<Type of processing e.g. Full>" -Credential $AzureCred -TableName $TableName |
10. Next – click Test Pane and Start to see if the script works. If it does, click Publish.
11. Go to https://flow.microsoft.com/ , log in, click on My flows and Create from template. Next select PowerApps button:
12.Enter the flow and add new step. Search for Azure Automation and select Create a job. Fill in the information of the runbook you created in previous steps and save.
13. Go to PowerApps website and open your PowerApp.
14. In your PowerApp, select Action pane and click Flows.
15. Once a menu opens, select the flow you have created and add it.
16. Select a button to trigger the flow. Edit the OnSelect formula. If it has an action already, you can add another action by using “;;”. Simply type in <YourFlowName>.Run() to insert the trigger.
17. Test the solution.
Let me know, if this approach is clear and if you see any other way.
Thanks