Skip to content

Deploy Custom Inventory Resources

Log Analytics is a tool in the Azure portal to edit and run log queries. We leverage Log Analytics as an inexpensive storage medium for storing custom inventory data collected from Windows and macOS devices. This data is then synchronized to Power BI to be used in BI for Intune.

Custom inventory data is sent to Log Analytics using the Azure Monitor Logs Ingestion API. This requires deploying a set of Azure resources (Data Collection Endpoint, Data Collection Rule, and custom tables) which can be automated using our ARM template.

Already have a Log Analytics workspace?

If you previously set up WUfB Reports and already have a Log Analytics workspace, select Use an existing workspace in Step 1 below and point it to that workspace. Custom inventory and WUfB Reports must share the same workspace.

Prerequisites:

  1. You must have already created the Inventory App Registration and recorded the Enterprise App Object ID.
  2. The user deploying the ARM template requires Owner or Contributor + User Access Administrator on the target Azure subscription or resource group.

Step 1: Deploy Azure Resources

  1. Navigate to the Enhanced Inventory Deploy repository on GitHub.
  2. Select the Deploy to Azure button.
  3. Select your target Subscription and Resource group.
  4. Choose whether to create a new Log Analytics workspace or use an existing one.
  5. When prompted for Enterprise App Object Id, paste the Object ID from the Create Inventory App Registration guide.
  6. Select Review + create and then Create.

Tip

If you leave the Enterprise App Object Id field blank, the deployment will still succeed but you will need to manually assign the Monitoring Metrics Publisher role to your inventory app registration on the Data Collection Rule after deployment.

The deployment creates the following resources:

  • Log Analytics Workspace (new or uses existing)
  • Custom tables: PowerStacksDeviceInventory_CL, PowerStacksAppInventory_CL, PowerStacksDriverInventory_CL
  • Data Collection Endpoint (DCE)
  • Data Collection Rule (DCR)
  • RBAC role assignment (if Enterprise App Object Id was provided)

Step 2: Record Deployment Outputs

  1. After the deployment completes, navigate to your Resource group.
  2. Select Deployments from the left menu.
  3. Select the completed deployment.
  4. Select the Outputs tab.
  5. Record the following values for later use:
    • DceURI — the Data Collection Endpoint URI
    • DcrImmutableId — the immutable ID of the Data Collection Rule

Step 3: Assign Log Analytics Reader to the Power BI App Registration

In this step you assign the Log Analytics Reader role to your Power BI app registration so that Power BI can read the custom inventory data from the workspace.

  1. In the Azure portal search for, and select, Log Analytics workspaces.
  2. Select the Log Analytics workspace where you deployed the custom inventory resources.
  3. Select Access control (IAM).
  4. Select Add > Add role assignment.
  5. Search for and select Log Analytics Reader, then select Next.
  6. Select Assign access to: User, group, or service principal.
  7. Select +Select Members.
  8. Search for and select the name of the Power BI App Registration (the one created when you installed BI for Intune — not the inventory app registration).
  9. Select Next, then Review and assign.

Step 4: Record the Workspace ID

  1. Open the Log Analytics workspace in the Azure portal.
  2. On the Overview page (or Properties), locate and record the Workspace ID.
  3. This value is needed for the Dataset Settings for Log Analytics.

Note

The Workspace Primary Key is no longer needed. The inventory scripts now authenticate using the Logs Ingestion API with the app registration credentials from the Create Inventory App Registration guide.

Summary

You should now have the following values recorded:

Value Source Used In
Tenant ID Inventory App Registration Windows / macOS inventory scripts
Client ID Inventory App Registration Windows / macOS inventory scripts
Client Secret Inventory App Registration Windows / macOS inventory scripts
DceURI Step 2 — Deployment Outputs Windows / macOS inventory scripts
DcrImmutableId Step 2 — Deployment Outputs Windows / macOS inventory scripts
Workspace ID Step 4 — Log Analytics Workspace Dataset Settings for Log Analytics

Next Steps