Note: This article is technical, so we recommend involving someone with the right technical expertise. If you have any questions, contact us at support@azumuta.com.
Power BI can load Azumuta data through the REST API. You can build a query yourself, or start from a sample template that already includes several queries.
If your workspace uses the reporting database, Power BI can also connect to it directly with the PostgreSQL connector. See Connect to the reporting database.
Before you start
- Create an API device and copy its API key. See Create and manage API keys.
- Find the endpoint you want to read in the in-app API docs. In the Azumuta app, click the question mark at the top right of your screen, then click API docs.
API keys are environment-scoped, so use the URL of the same Azumuta environment that the key belongs to.
Build a query in Power BI
- Open a new project in Power BI.
- Click Get data → Blank query.
- Open the Advanced editor and paste the following code:
let
Source =
Json.Document(
Web.Contents(
"https://YOUR_AZUMUTA_URL",
[
RelativePath = "api/YOUR_ENDPOINT",
Headers = [
#"x-api-key" = "YOUR_API_KEY",
#"Accept" = "application/json"
]
]
)
)
in
Source
- Replace the placeholders:
-
YOUR_AZUMUTA_URL: the URL of your Azumuta environment. -
YOUR_ENDPOINT: the endpoint path, for examplev2/products. -
YOUR_API_KEY: the API key you copied.
-
- When Power BI asks for credentials, choose Anonymous and set the privacy level to Organizational. Power BI doesn't need its own credentials here, because Azumuta reads the API key from the request header.
- Convert the result to a table. Click the List value, then click To Table.
- Click the expand icon (⤢) and select the columns you need.
- If you need data from several endpoints, repeat these steps to create one query for each.
- Build tables and visuals with the data.
Important: The API key is stored in the query. Anyone who can open the Power BI file, or edit the published report, can read it. Treat the file like a credential, and don't share it outside your company.
Start from the sample template
Azumuta offers a sample Power BI template that loads data through the REST API and handles paginated results. To get it, contact support@azumuta.com.
- Create an API device and copy its API key. See Create and manage API keys.
- Open the template in Power BI.
- Open the Power Query Editor and select each of the two parameters. Update the current value of the API key parameter, and set UrlEnvironment to the URL of your own environment.
- Delete the queries you don't need. Each query adds to the load time, so keeping only what you use makes the refresh faster.
- Click Close & Apply to load your data.
- Create relations between the tables and build your dashboard with the Power BI visuals.