By using any programming language that supports REST calls, you can perform asynchronous data-refresh operations on your Azure Analysis Services tabular models, including synchronization of read-only replicas for query scale-out.
Data-refresh operations can take some time depending on many factors including data volume, level of optimization using partitions, etc. Traditionally, these operations have been invoked with existing methods such as using TOM (Tabular Object Model), PowerShell cmdlets, or TMSL (Tabular Model Scripting Language). However, these methods can require often unreliable, long-running HTTP connections.
The REST API for Azure Analysis Services enables data-refresh operations to be carried out asynchronously. By using the REST API, long-running HTTP connections from client applications aren't necessary. There are also other built-in features for reliability, such as auto retries and batched commits.
All calls must be authenticated with a valid Microsoft Entra ID (OAuth 2) token in the Authorization header and must meet the following requirements:
The token must be either a user token or an application service principal.
The token must have the audience set to exactly https://*.asazure.windows.net. Note that * isn't a placeholder or a wildcard, and the audience must have the * character as the subdomain. Custom audiences, such as https://customersubdomain.asazure.windows.net, are not supported. Specifying an invalid audience results in authentication failure.
The user or application must have sufficient permissions on the server or model to make the requested call. The permission level is determined by roles within the model or the admin group on the server.
Important
Currently, server admin role permissions are necessary.
POST /refreshes
To perform a refresh operation, use the POST verb on the /refreshes collection to add a new refresh item to the collection. The Location header in the response includes the refresh ID. The client application can disconnect and check the status later if necessary because it's asynchronous.
Only one refresh operation is accepted at a time for a model. If there's a current running refresh operation and another is submitted, the 409 Conflict HTTP status code is returned.
The default value is applied if the parameter isn't specified.
Name
Type
Description
Default
Type
Enum
The type of processing to perform. The types are aligned with the TMSL refresh command types: full, clearValues, calculate, dataOnly, automatic, and defragment. add type isn't supported.
automatic
CommitMode
Enum
Determines if objects are committed in batches or committed only when the entire operation completes. Modes include: transactional, partialBatch.
transactional
MaxParallelism
Int
This value determines the maximum number of threads on which to run processing commands in parallel. This value aligned with the MaxParallelism property that can be set in the TMSL Sequence command or using other methods.
10
RetryCount
Int
Indicates the number of times the operation retries before failing.
0
Objects
Array
An array of objects to be processed. Each object includes: "table" when processing the entire table or "table" and "partition" when processing a partition. If no objects are specified, the whole model is refreshed.
Process the entire model
Specifying partialBatch for CommitMode is useful when doing an initial load of large datasets that could take hours. If the refresh operation fails after successfully committing one or more batches, the successfully committed batches will remain committed (it will not roll back successfully committed batches).
Note
At time of writing, the batch size is the MaxParallelism value, but this value could change.
Status values
Status value
Description
notStarted
Operation not yet started.
inProgress
Operation in progress.
timedOut
Operation timed out based on user specified timeout.
cancelled
Operation canceled by user or system.
failed
Operation failed.
succeeded
Operation succeeded.
GET /refreshes/<refreshId>
To check the status of a refresh operation, use the GET verb on the refresh ID. Here's an example of the response body. If the operation is in progress, inProgress is returned in status.
To cancel an in-progress refresh operation, use the DELETE verb on the refresh ID.
POST /sync
Having performed refresh operations, it may be necessary to synchronize the new data with replicas for query scale-out. To perform a synchronize operation for a model, use the POST verb on the /sync function. The Location header in the response includes the sync operation ID.
GET /sync status
To check the status of a sync operation, use the GET verb passing the operation ID as a parameter. Here's an example of the response body:
In the code sample, find string authority = …, replace common with your organization's tenant ID.
Comment/uncomment so the ClientCredential class is used to instantiate the cred object. Ensure the <App ID> and <App Key> values are accessed in a secure way or use certificate-based authentication for service principals.
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
In this episode with Gaston Cruz, he'll show you the options to process Azure Analysis Services models (Semantic Layer) connecting to an Azure SQL DB as a data source (using SSDT), and then create an architecture using a Service Principal account to process the model (DB, Tables, Partitions) in an automatic way deploying an Azure Logic Apps, and then calling from Azure Data Factory to trigger the process. Finally, he'll conclude by showing you the advantages of using a live connection from Power BI to conne
Replicate Azure Analysis Services servers with scale-out. Client queries can then be distributed among multiple query replicas in a scale-out query pool.