Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tracking the ISS with Azure Digital Twins

This directory contains all the scripts and code to track the International Space Station with Azure Digital Twins.

Outstanding Tasks

  • Populate Graph Structure here
  • Grafana Azure Active Directory Authentication here
  • Useful Azure Digital Twins Queries
  • Add Hololens src into iss-hololens directory with [string replacable parameters] which can be replaced by the powershell.
  • Add Option to deploy with IoT Hub ingestion rather than event hub ingestion

Prerequisites

  1. Azure Subcription

    You'll need an Azure subscription to complete this quickstart. If you don't have one already, create one for free now.

  2. Azure Command Line Interface

    You'll also need to make sure you have the latest Azure cli installed, you can do this here.

    You will also need the Azure Powershell Module using the following command

     Install-Module -Name Az -AllowClobber -Scope CurrentUser -Force
    
  3. Git Command Line Interface

    You will also need to make sure you have git installed, you can do this following instructions here.

  4. dotnet SDK

    The dotnet 6 SDK is required to run this quickstart. You can install it here.

  5. Azure Function Core tools

    Azure Function Core tools are also required to run this quickstart. You can install it here.

  6. Bicep CLI

    On top of this you then need to make sure you have Bicep cli installed by running the following command

     az bicep install
    

    ℹ️ If you've already got the Bicep CLI installed, you can update it by running the following command

    az bicep upgrade

  7. Powershell

    You will also need to make sure you have Powershell installed, you can do this here.

Getting started

Once you've got your Azure Suscription, and have the azure cli installed, you can start by running the following commands to setup the entire environment.

az login

You'll then need to set the scope of your subscription.

az account set --subscription <your-subscription-id>

Then run the command below to create deploy the entire environment.

./iss-digitaltwins.ps1 <your-subscription-id> <location> <your-digitaltwins-name> <your-aad-login-domain e.g. https://login.microsoft.com>

The above script will prompt you for to allow some changes for Azure Digital Twins Data History.

The script above will do the following

  1. Create a new Resource Group deploy Azure Resources
  2. Configure Grafana Dashboards and connect it to the Azure Active Directory and Azure Data Explorer
  3. Configure Azure Digital Twins Data History
  4. Deploy All custom code for the applications
  5. Configure the Hololens App to point at the deployed environment
  6. Generate Links for the applications

☕ This script takes around 15-20 minutes to run while to run - so you'll want to go boil the kettle.

The Architecture

Once the scripts (steps 1-5) are completed you should have the following architecture deployed in your Azure subscription.

ISS Architecture with event hub

The code

There are four applications which are deployed (automatically above) in order for this to work.

(after running the scripts to deploy the environment you should be able to find the code for the applications here )

Setup the Digital Twin

Once your bicep is installed, this digital twin explorer should open with the your digital twin.

Explore the Digital Twin

Navigate to the azure digital twin explorer for the ISS digital twin.

https://explorer.digitaltwins.azure.net?eid=<your-digital-twin-host-name>&query=SELECT%20*%20From%20DigitalTwins

You will see that you have a number of sensor twins already configured (this should be the case if the ISS Telemetry stream is working).

auto provisioned twins

At the moment there's not much graphical context to the sensors. This means the Dashboard called "Mission Control Panels" won't work as there's no Structure for you to browse through.

So let's group the sensors by their discipline (Mission Control Callsigns) by running the following script.

./step-7-organize-iss-sensors.ps1 <your-digitaltwins-name> <your-resource-group-name>

☕ This script takes a while to run - so you'll want to go and get another cup of tea or something.

This will create a new twin for each disicpline and add the sensors to those twins and should look something like this.

Organized twins

Clean up

When you want to remove all the azure resources which this project setup simply run the following script

./step-10-teardown.ps1 <your-resource-group-name> iss.azure

This command will delete everything deployed by the bicep deployment you ran earlier.