Skip to content

Commit a4d3b59

Browse files
author
Jill Grant
authored
Merge pull request #286830 from kgremban/sep16-iothubsev0
IoT Hub image scan: 0 and 2
2 parents 899f4e0 + 9c258e4 commit a4d3b59

File tree

9 files changed

+15
-17
lines changed

9 files changed

+15
-17
lines changed

articles/iot-hub/iot-hub-ip-filtering.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: kgremban
66
ms.author: kgremban
77
ms.service: iot-hub
88
ms.topic: how-to
9-
ms.date: 03/22/2021
9+
ms.date: 09/17/2024
1010
ms.custom: devx-track-azurepowershell, devx-track-azurecli
1111
---
1212

@@ -20,7 +20,7 @@ Use IP filter to receive traffic only from a specified range of IP addresses and
2020

2121
## Default setting
2222

23-
To get to the IP Filter settings page of your IoT hub, select **Networking** > **Public access**, then choose **Selected IP Ranges**:
23+
To get to the IP Filter settings page of your IoT hub, select **Security settings** > **Networking** > **Public access**, then choose **Selected IP Ranges**:
2424

2525
:::image type="content" source="media/iot-hub-ip-filtering/ip-filter-default.png" alt-text="Screenshot showing how to set default IP filter settings.":::
2626

@@ -32,7 +32,7 @@ To add an IP filter rule, select **Add IP Filter Rule**. To quickly add your com
3232

3333
:::image type="content" source="./media/iot-hub-ip-filtering/ip-filter-add-rule.png" alt-text="Screenshot showing how to add an IP filter rule to an IoT hub.":::
3434

35-
After selecting **Add IP Filter Rule**, fill in the fields. These fields are pre-filled for you if you selected to add your client IP address.
35+
After selecting **Add IP Filter Rule**, fill in the fields. These fields are prefilled for you if you selected to add your client IP address.
3636

3737
:::image type="content" source="./media/iot-hub-ip-filtering/ip-filter-after-selecting-add.png" alt-text="Screenshot that shows what to do after adding an IP filter rule.":::
3838

@@ -42,15 +42,13 @@ After selecting **Add IP Filter Rule**, fill in the fields. These fields are pre
4242

4343
After filling in the fields, select **Save** to save the rule. You see an alert notifying you that the update is in progress.
4444

45-
:::image type="content" source="./media/iot-hub-ip-filtering/ip-filter-save-new-rule.png" alt-text="Screenshot that shows notification about saving an IP filter rule.":::
46-
4745
The **Add** option is disabled when you reach the maximum of 100 IP filter rules.
4846

4947
To edit an existing rule, select the data you want to change, make the change, then select **Save** to save your edit.
5048

5149
## Delete an IP filter rule
5250

53-
To delete an IP filter rule, select the trash can icon on that row and then select **Save**. The rule is removed and the change is saved.
51+
To delete an IP filter rule, select the trash can icon on that row, and then select **Save**. The rule is removed and the change is saved.
5452

5553
:::image type="content" source="./media/iot-hub-ip-filtering/ip-filter-delete-rule.png" alt-text="Screenshot showing how to delete an IoT Hub IP filter rule.":::
5654

@@ -65,38 +63,38 @@ To apply the IP filter rules to the built-in Event Hubs compatible endpoint, che
6563
6664
By enabling this option, your IP filter rules are replicated to the built-in endpoint, so only trusted IP ranges can access it.
6765

68-
If you disable this option, the built-in endpoint is accessible to all IP addresses. This behavior may be useful if you want to read from the endpoint with services with source IP addresses which may change over time like Azure Stream Analytics.
66+
If you disable this option, the built-in endpoint is accessible to all IP addresses. This behavior can be useful if you want to read from the endpoint with services with source IP addresses which might change over time like Azure Stream Analytics.
6967

7068
## How filter rules are applied
7169

7270
The IP filter rules are applied at the IoT Hub service level. Therefore, the IP filter rules apply to all connections from devices and back-end apps using any supported protocol. Also, you can choose if the [built-in Event Hubs compatible endpoint](iot-hub-devguide-messages-read-builtin.md) (not via the IoT Hub connection string) are bound to these rules.
7371

74-
Any connection attempt from an IP address that isn't explicitly allowed receives an unauthorized 401 status code and description. The response message does not mention the IP rule. Rejecting IP addresses can prevent other Azure services such as Azure Stream Analytics, Azure Virtual Machines, or the Device Explorer in Azure portal from interacting with the IoT hub.
72+
Any connection attempt from an IP address that isn't explicitly allowed receives an unauthorized 401 status code and description. The response message doesn't mention the IP rule. Rejecting IP addresses can prevent other Azure services such as Azure Stream Analytics, Azure Virtual Machines, or the Device Explorer in Azure portal from interacting with the IoT hub.
7573

7674
> [!NOTE]
7775
> If you want to use Azure Stream Analytics (ASA) to read messages from an IoT hub with IP filter enabled, **disable** the **Apply IP filters to the built-in endpoint** option, and then use the event hub-compatible name and endpoint of your IoT hub to manually add an [Event Hubs stream input](../stream-analytics/stream-analytics-define-inputs.md#stream-data-from-event-hubs) in the ASA.
7876
79-
### Ordering
77+
### Azure portal
8078

81-
IP filter rules are *allow* rules and applied without ordering. Only IP addresses that you add are allowed to connect to IoT Hub.
79+
IP filter rules are also applied when using IoT Hub through Azure portal. This is because API calls to the IoT Hub service are made directly using your browser with your credentials, which is consistent with other Azure services. To access IoT Hub using Azure portal when IP filter is enabled, add your computer's IP address to the allowlist.
8280

83-
For example, if you want to accept addresses in the range `192.168.100.0/22` and reject everything else, you only need to add one rule in the grid with address range `192.168.100.0/22`.
81+
### Ordering
8482

85-
### Azure portal
83+
IP filter rules are *allow* rules and are applied without ordering. Only IP addresses that you add are allowed to connect to IoT Hub.
8684

87-
IP filter rules are also applied when using IoT Hub through Azure portal. This is because API calls to the IoT Hub service are made directly using your browser with your credentials, which is consistent with other Azure services. To access IoT Hub using Azure portal when IP filter is enabled, add your computer's IP address to the allowlist.
85+
For example, if you want to accept addresses in the range `192.168.100.0/22` and reject everything else, you only need to add one rule in the grid with address range `192.168.100.0/22`.
8886

8987
## Retrieve and update IP filters using Azure CLI
9088

91-
Your IoT Hub's IP filters can be retrieved and updated through [Azure CLI](/cli/azure/).
89+
Your IoT hub's IP filters can be retrieved and updated through [Azure CLI](/cli/azure/).
9290

9391
To retrieve current IP filters of your IoT Hub, run:
9492

9593
```azurecli-interactive
9694
az resource show -n <iothubName> -g <resourceGroupName> --resource-type Microsoft.Devices/IotHubs
9795
```
9896

99-
This will return a JSON object where your existing IP filters are listed under the `properties.networkRuleSets` key:
97+
This returns a JSON object where your existing IP filters are listed under the `properties.networkRuleSets` key:
10098

10199
```json
102100
{
@@ -133,7 +131,7 @@ To remove an existing IP filter in your IoT Hub, run:
133131
az resource update -n <iothubName> -g <resourceGroupName> --resource-type Microsoft.Devices/IotHubs --add properties.networkRuleSets.ipRules <ipFilterIndexToRemove>
134132
```
135133

136-
Here, `<ipFilterIndexToRemove>` must correspond to the ordering of IP filters in your IoT Hub's `properties.networkRuleSets.ipRules`.
134+
Here, `<ipFilterIndexToRemove>` corresponds to the ordering of IP filters in your IoT hub's `properties.networkRuleSets.ipRules`.
137135

138136
## Retrieve and update IP filters using Azure PowerShell
139137

@@ -163,7 +161,7 @@ $iothubResource | Set-AzResource -Force
163161

164162
## Update IP filter rules using REST
165163

166-
You may also retrieve and modify your IoT Hub's IP filter using Azure resource Provider's REST endpoint. See `properties.networkRuleSets` in [createorupdate method](/rest/api/iothub/iothubresource/createorupdate).
164+
You can also retrieve and modify your IoT Hub's IP filter using Azure resource Provider's REST endpoint. See `properties.networkRuleSets` in [createorupdate method](/rest/api/iothub/iothubresource/createorupdate).
167165

168166
## Next steps
169167

4.14 KB
Loading
6.73 KB
Loading
6.3 KB
Loading
-820 Bytes
Loading
7.15 KB
Loading
Binary file not shown.
-1.04 KB
Loading
-1.98 KB
Loading

0 commit comments

Comments
 (0)