Skip to content

Sealjay/powerbi-adt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

powerbi-adt

Commitizen friendly GitHub issues GitHub GitHub Repo stars

Overview

An example showing how to query Azure Digital Twins from within PowerBI. You could use this to query the current state of your IoT devices, for example, to use the Anomaly Detector cognitive service to check the state of outliers.

powerbi-adt is available under the MIT Licence.

Setting up

  1. Create an Azure Digital Twin
  2. Give yourself access to the data plane - add some example data - the Azure Digital Twins explorer example data is a good start.
  3. Create a virtual environment for your Python setup, e.g. python3 -m venv .venv
  4. Install the requirements pip install -r requirements-dev.txt
  5. Copy the path to your venv
  6. Enable python scripting in PowerBI
  7. Log in to Azure on the CLI with az login
  8. Import the powerbi-query.py as a PowerBI datasource

Editing the query

query_expression = "SELECT * FROM digitaltwins"
query_result = service_client.query_twins(query_expression)
twin_list = pd.DataFrame(query_result)

The example query I provide in the query_expression variable will allow you to query the twin graph - and you can use the Azure Digital Twins query language to build on this. Each individual pandas dataframe will appear as a data set in PowerBI.

Example

You should see something like this...

Limitations

Contact

Feel free to contact me on Twitter. For bugs, please raise an issue on GitHub.

Contributing

Contributions are more than welcome! This repository uses the GitHub flow - and you can choose to use Commitizen to support the use of semantic commits. (npm install -g commitizen cz-customizableand then git cz- easy!)

About

Querying Azure Digital Twins with PowerBI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published