refresh AAS tabular model synchronously using Synapse Analytics ?

Rajesh Manjunath 0 Reputation points
2023-08-29T07:36:10.43+00:00

can you please help provide any pointers towards refresh AAS tabular model synchronously using Synapse Analytics ?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,350 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 15,046 Reputation points
    2023-08-29T09:38:36.4833333+00:00

    I think you would typically use Azure Synapse as your data source, and then programmatically trigger a refresh operation on your AAS model. Here's a general guide on how to achieve this:

    1. Data Source :
    • Ensure that your AAS tabular model has Azure Synapse Analytics as its data source.
    • Proper connection strings and credentials should be set up in AAS to connect to Synapse Analytics.
    1. Use Azure Automation or Logic Apps:
      • You can set up Azure Automation with a runbook or use Azure Logic Apps to periodically or on-demand refresh your AAS model.
    2. Azure Analysis Services REST API:
      • AAS provides a REST API that allows you to manage and refresh your models. You can use this API to synchronously refresh your tabular model.
          
               $resourceGroupName = "Your-Resource-Group"
          
               $serverName = "Your-AAS-Server-Name"
          
               $databaseName = "Your-AAS-Database-Name"
          
               $modelRefreshUrl = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.AnalysisServices/servers/$serverName/databases/$databaseName/refreshes?api-version=2017-08-01-preview"
          
               
          
               # Use Azure AD token for authentication
          
               $token = (Get-AzAccessToken -ResourceUrl https://analysis.windows.net/powerbi/api).Token
          
               $headers = @{
          
                 "Authorization" = "Bearer $token"
          
                 "Content-Type" = "application/json"
          
               }
          
               
          
               $body = @{
          
                 "type" = "Full"
          
               } | ConvertTo-Json
          
               
          
               # Invoke REST API to refresh model
          
               Invoke-RestMethod -Method Post -Uri $modelRefreshUrl -Headers $headers -Body $body
          
          ```
    
    
    0 comments No comments

  2. Nandan Hegde 29,886 Reputation points MVP
    2023-08-30T03:09:49.34+00:00
    0 comments No comments