You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Under the `connectionId` field, replace `Replace with subscription` with your subscription ID, and replace `Replace with RG name` with your resource group name, for example:
1. Go back to the **Logic app designer** to view the logic that the playbook follows.
69
+
70
+
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-logic.png" alt-text="Screenshot of a of the playbook logic for Defender for IoT sensor disconnection alerts." lightbox="media/automate-sensor-disconnection-alerts/playbook-logic.png":::
71
+
72
+
## Set up managed identity for your subscription
73
+
74
+
To give the playbook permission to run Keyword Query Language (KQL) queries and get relevant sensor data:
75
+
76
+
1. In the Azure portal, select **Subscriptions**.
77
+
1. Select the subscription running Microsoft Sentinel and select **Access Control (IAM)**.
78
+
1. Select **Add > Add Role Assignment**.
79
+
1. Search for the **Reader** role.
80
+
1. In the **Role** tab, select **Next**.
81
+
1. In the **Members** tab, under **Assign access to**, select **Managed Identity**.
82
+
1. In the **Select Managed identities** window:
83
+
1. Under **Subscription**, select the subscription running Microsoft Sentinel.
84
+
1. Under **Managed identity**, select your playbook's name.
85
+
1. Under **Select**, select the name of the automation rule you created and select **Select**.
86
+
87
+
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity-members.png" alt-text="Screenshot of a of setting up members for a managed identity while creating a Defender for IoT sensor disconnection alerts playbook." lightbox="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity-members.png":::
88
+
89
+
1. In the editor, select **HTTP2** and verify that the **Authentication Type** is set to **Managed Identity**.
90
+
91
+
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity.png" alt-text="Screenshot of sending up a managed identity for the Defender for IoT sensor disconnection alerts playbook." lightbox="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity.png":::
92
+
93
+
## Verify the sensor status
94
+
95
+
If you can't create the playbook successfully, run a KQL query in Azure Resource Graph to confirm that the sensor is offline.
96
+
97
+
1. In the Azure portal, search for *Azure resource graph explorer*.
98
+
1. Run the following query:
99
+
100
+
```kusto
101
+
iotsecurityresources
102
+
103
+
| where type =='microsoft.iotsecurity/locations/sites/sensors'
If the sensor has been offline for at least five minutes, the sensor status is **Disconnected**.
117
+
118
+
> [!NOTE]
119
+
> It takes up to 15 minutes for the sensor to synchronize the status update with the cloud. This means that the sensor needs to be offline for at least 15 minutes before the status is updated.
120
+
121
+
### Playbook code
122
+
123
+
Copy this code and return to the [paste the playbook code](#paste-the-playbook-code-and-modify-fields) step.
51
124
52
125
```json
53
126
{
@@ -433,77 +506,7 @@ Before you start, make sure you have:
433
506
}
434
507
435
508
}
436
-
```
437
-
1. Modify these fields in the code:
438
-
439
-
- Under the `post` body, in the `To` field, type the email to which you want to receive the notifications.
440
-
- Under the `office365` parameter:
441
-
- Under the `id` field, replace `Replace with subscription` with the ID of the subscription running Microsoft Sentinel, for example:
- Under the `connectionId` field, replace `Replace with subscription` with your subscription ID, and replace `Replace with RG name` with your resource group name, for example:
1. Go back to the **Logic app designer** to view the logic that the playbook follows.
455
-
456
-
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-logic.png" alt-text="Screenshot of a of the playbook logic for Defender for IoT sensor disconnection alerts." lightbox="media/automate-sensor-disconnection-alerts/playbook-logic.png":::
457
-
458
-
## Set up managed identity for your subscription
459
-
460
-
To give the playbook permission to run Keyword Query Language (KQL) queries and get relevant sensor data:
461
-
462
-
1. In the Azure portal, select **Subscriptions**.
463
-
1. Select the subscription running Microsoft Sentinel and select **Access Control (IAM)**.
464
-
1. Select **Add > Add Role Assignment**.
465
-
1. Search for the **Reader** role.
466
-
1. In the **Role** tab, select **Next**.
467
-
1. In the **Members** tab, under **Assign access to**, select **Managed Identity**.
468
-
1. In the **Select Managed identities** window:
469
-
1. Under **Subscription**, select the subscription running Microsoft Sentinel.
470
-
1. Under **Managed identity**, select your playbook's name.
471
-
1. Under **Select**, select the name of the automation rule you created and select **Select**.
472
-
473
-
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity-members.png" alt-text="Screenshot of a of setting up members for a managed identity while creating a Defender for IoT sensor disconnection alerts playbook." lightbox="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity-members.png":::
474
-
475
-
1. In the editor, select **HTTP2** and verify that the **Authentication Type** is set to **Managed Identity**.
476
-
477
-
:::image type="content" source="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity.png" alt-text="Screenshot of sending up a managed identity for the Defender for IoT sensor disconnection alerts playbook." lightbox="media/automate-sensor-disconnection-alerts/playbook-permissions-managed-identity.png":::
478
-
479
-
## Verify the sensor status
480
-
481
-
If you can't create the playbook successfully, run a KQL query in Azure Resource Graph to confirm that the sensor is offline.
482
-
483
-
1. In the Azure portal, search for *Azure resource graph explorer*.
484
-
1. Run the following query:
485
-
486
-
```kusto
487
-
iotsecurityresources
488
-
489
-
| where type =='microsoft.iotsecurity/locations/sites/sensors'
If the sensor has been offline for at least five minutes, the sensor status is **Disconnected**.
503
-
504
-
> [!NOTE]
505
-
> It takes up to 15 minutes for the sensor to synchronize the status update with the cloud. This means that the sensor needs to be offline for at least 15 minutes before the status is updated.
0 commit comments