diff --git a/README.md b/README.md index f2d8a67..3fa6b34 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,23 @@ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![GitHub issues](https://img.shields.io/github/issues/Sealjay-clj/powerbi-adt) ![GitHub](https://img.shields.io/github/license/Sealjay-clj/powerbi-adt) ![GitHub Repo stars](https://img.shields.io/github/stars/Sealjay-clj/powerbi-adt?style=social) ## Overview -An example showing how to query [Azure Digital Twins](https://docs.microsoft.com/en-us/azure/digital-twins/how-to-manage-twin#create-a-digital-twin) from within PowerBI. +An example showing how to query [Azure Digital Twins](https://docs.microsoft.com/en-us/azure/digital-twins/how-to-manage-twin#create-a-digital-twin) from within PowerBI. You could use this to query the current state of your IoT devices, for example, to use the [Anomaly Detector](https://docs.microsoft.com/en-gb/azure/cognitive-services/anomaly-detector/) cognitive service to check the state of outliers. powerbi-adt is available under the [MIT Licence](./LICENCE). -Implemented use cases: -- List all twins +## 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](https://github.com/Azure-Samples/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](https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts#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](https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts#run-your-python-script-and-import-data) +### Example +You should see something like this... +![](assets/example-dashboard.png) ## Contact Feel free to contact me [on Twitter](https://twitter.com/sealjay_clj). For bugs, please [raise an issue on GitHub](https://github.com/Sealjay-clj/powerbi-adt/issues). diff --git a/assets/example-dashboard.png b/assets/example-dashboard.png new file mode 100644 index 0000000..1eca895 Binary files /dev/null and b/assets/example-dashboard.png differ diff --git a/src/powerbi-report.pbix b/src/powerbi-report.pbix new file mode 100644 index 0000000..f9705c2 Binary files /dev/null and b/src/powerbi-report.pbix differ