Azure Analysis Services APIs Reference
This document provides a comprehensive reference for the Azure Analysis Services REST APIs. These APIs allow you to programmatically manage and interact with your Azure Analysis Services resources.
Introduction
Azure Analysis Services is a fully managed Platform as a Service (PaaS) that provides enterprise-grade data modeling capabilities. The REST APIs enable developers to automate common tasks such as creating, updating, and querying Analysis Services models, tables, and other objects.
Key benefits of using the APIs include:
- Automating deployment and configuration.
- Integrating with CI/CD pipelines.
- Building custom management tools.
- Performing bulk operations.
Authentication and Authorization
All requests to the Azure Analysis Services REST API must be authenticated. The API supports Azure Active Directory (Azure AD) authentication.
You can obtain an access token using the Azure AD authentication library or by making direct OAuth 2.0 requests. The access token should be included in the Authorization
header of your requests as a Bearer token:
Authorization: Bearer <your_access_token>
Permissions are managed through Azure RBAC roles assigned to users or service principals.
Models API
The Models API allows you to manage tabular models within your Azure Analysis Services server.
GET Models
Retrieves a list of all tabular models deployed on the specified Azure Analysis Services server.
Parameters
serverName
(string, required): The name of the Analysis Services server.
Example Request
Request URL:
GET https://{azureRegion}/{serverName}.asazure.windows.net/servers/{serverName}/models
GET Model
Retrieves the metadata for a specific tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.
Example Request
Request URL:
GET https://{azureRegion}/{serverName}.asazure.windows.net/servers/{serverName}/models/MySalesModel
POST Model
Creates a new tabular model on the specified Azure Analysis Services server.
Parameters
serverName
(string, required): The name of the Analysis Services server.
Request Body
A JSON object representing the model metadata.
{
"name": "NewSalesModel",
"description": "A new sales analysis model",
"cultures": ["en-US"],
"sourceMode": "Import"
}
Example Request
Request URL:
POST https://{azureRegion}/{serverName}.asazure.windows.net/servers/{serverName}/models
Request Body:
{
"name": "NewSalesModel",
"description": "A new sales analysis model",
"cultures": ["en-US"],
"sourceMode": "Import"
}
PUT Model
Updates an existing tabular model. This operation can be used to update model properties or deploy a new model definition.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model to update.
Request Body
A JSON object representing the updated model metadata or the full model definition.
{
"name": "MySalesModel",
"description": "Updated sales analysis model",
"cultures": ["en-US", "es-ES"]
}
Example Request
Request URL:
PUT https://{azureRegion}/{serverName}.asazure.windows.net/servers/{serverName}/models/MySalesModel
Request Body:
{
"name": "MySalesModel",
"description": "Updated sales analysis model",
"cultures": ["en-US", "es-ES"]
}
DELETE Model
Deletes a tabular model from the specified Azure Analysis Services server.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model to delete.
Example Request
Request URL:
DELETE https://{azureRegion}/{serverName}.asazure.windows.net/servers/{serverName}/models/MyOldModel
Tables API
The Tables API allows you to manage tables within a specific tabular model.
GET Tables
Retrieves a list of all tables within a specified tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.
GET Table
Retrieves the metadata for a specific table within a tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table.
POST Table
Creates a new table within the specified tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.
Request Body
A JSON object representing the table definition.
{
"name": "DimProduct",
"columns": [
{"name": "ProductID", "dataType": "int", "isKey": true},
{"name": "ProductName", "dataType": "string"}
]
}
PUT Table
Updates an existing table within a tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table to update.
Request Body
A JSON object representing the updated table definition.
{
"name": "DimProduct",
"description": "Product dimension table",
"columns": [
{"name": "ProductID", "dataType": "int", "isKey": true},
{"name": "ProductName", "dataType": "string"},
{"name": "Category", "dataType": "string"}
]
}
DELETE Table
Deletes a table from the specified tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table to delete.
Partitions API
The Partitions API allows you to manage partitions within a specific table.
GET Partitions
Retrieves a list of all partitions for a specific table.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table.
POST Partition
Creates a new partition for a specific table.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table.
Request Body
A JSON object representing the partition definition.
{
"name": "PartitionQ12023",
"source": {
"query": "SELECT * FROM Sales WHERE Date >= '2023-01-01' AND Date < '2023-04-01'"
}
}
PUT Partition
Updates an existing partition.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table.partitionName
(string, required): The name of the partition to update.
Request Body
A JSON object representing the updated partition definition.
{
"name": "PartitionQ12023",
"source": {
"query": "SELECT * FROM Sales WHERE Date >= '2023-01-01' AND Date < '2023-04-01' AND Region = 'North'"
}
}
DELETE Partition
Deletes a partition from a table.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.tableName
(string, required): The name of the table.partitionName
(string, required): The name of the partition to delete.
Relationships API
The Relationships API allows you to manage relationships between tables within a tabular model.
GET Relationships
Retrieves a list of all relationships within a tabular model.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.
POST Relationship
Creates a new relationship between two tables.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.
Request Body
A JSON object representing the relationship definition.
{
"name": "FK_Sales_DimProduct",
"fromTable": "FactSales",
"fromColumn": "ProductID",
"toTable": "DimProduct",
"toColumn": "ProductID",
"crossFilterDirection": "OneDirection"
}
PUT Relationship
Updates an existing relationship.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.relationshipName
(string, required): The name of the relationship to update.
Request Body
A JSON object representing the updated relationship definition.
{
"name": "FK_Sales_DimProduct",
"fromTable": "FactSales",
"fromColumn": "ProductID",
"toTable": "DimProduct",
"toColumn": "ProductID",
"crossFilterDirection": "BothDirections"
}
DELETE Relationship
Deletes a relationship between tables.
Parameters
serverName
(string, required): The name of the Analysis Services server.modelName
(string, required): The name of the tabular model.relationshipName
(string, required): The name of the relationship to delete.