Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

How to Enable IoT Hub Metrics Charts for Simulations

Troy Hopwood edited this page Nov 3, 2018 · 1 revision

Most Device Simulation deployments include a chart showing connected devices, created devices, and messages sent using metrics from IoT Hub. However, there are a few situations where this chart will not appear for your simulations.

Insufficient Permissions When Deploying Device Simulation

When Device Simulation is deployed, a service principle is created. This service principle is used to access the IoT Hub APIs to fetch metrics. If the person deploying Device Simulation did not have Owner or Administrator permissions on the subscription used then this user principle will not have adequate permissions. Someone with Owner or Administrator permissions will need to manually grant Contributor permissions to service principle to enable the charts.

  1. Log into the Azure Portal
  2. Click "Resource Groups" in the left navigation
  3. Click on the resource group for your Device Simulation deployment
  4. Click on "Access Control"
  5. Click "Add"
  6. Choose the "Contributor" role
  7. Enter the name of the resource group in the search box
  8. Click on the service principle listed with the name matching your resource group
  9. Click "Save"

No Hub Deployed with Device Simulation

Device Simulation can only access IoT Hub statistics for the IoT Hub deployed as part of Device Simulation. At this time, the only way to enable this feature, if you didn't deploy a hub, is to re-deploy Device Simulation and ensure the box is checked to also deploy an IoT Hub.

Targeting a different IoT Hub

Device Simulation can only access IoT Hub statistics for the IoT Hub deployed as part of Device Simulation. If you target the pre-provisioned IoT Hub you will be able to see the charts.