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
@@ -657,14 +657,15 @@ Resources of some services, **when registered in your subscription**, can access
657
657
| Azure Site Recovery | Microsoft.SiteRecovery | Enable replication for disaster-recovery of Azure IaaS virtual machines when using firewall-enabled cache, source, or target storage accounts. [Learn more](../../site-recovery/azure-to-azure-tutorial-enable-replication.md). |
### Trusted access based on system-assigned managed identity
662
+
### Trusted access based on a managed identity
662
663
663
664
The following table lists services that can have access to your storage account data if the resource instances of those services are given the appropriate permission.
664
665
665
-
If your account does not have the hierarchical namespace feature enabled on it, you can grant permission, by explicitly assigning an Azure role to the [system-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md) for each resource instance. In this case, the scope of access for the instance corresponds to the Azure role assigned to the managed identity.
666
+
If your account does not have the hierarchical namespace feature enabled on it, you can grant permission, by explicitly assigning an Azure role to the [managed identity](../../active-directory/managed-identities-azure-resources/overview.md) for each resource instance. In this case, the scope of access for the instance corresponds to the Azure role assigned to the managed identity.
666
667
667
-
You can use the same technique for an account that has the hierarchical namespace feature enable on it. However, you don't have to assign an Azure role if you add the system-assigned managed identity to the access control list (ACL) of any directory or blob contained in the storage account. In that case, the scope of access for the instance corresponds to the directory or file to which the system-assigned managed identity has been granted access. You can also combine Azure roles and ACLs together. To learn more about how to combine them together to grant access, see [Access control model in Azure Data Lake Storage Gen2](../blobs/data-lake-storage-access-control-model.md).
668
+
You can use the same technique for an account that has the hierarchical namespace feature enable on it. However, you don't have to assign an Azure role if you add the managed identity to the access control list (ACL) of any directory or blob contained in the storage account. In that case, the scope of access for the instance corresponds to the directory or file to which the managed identity has been granted access. You can also combine Azure roles and ACLs together. To learn more about how to combine them together to grant access, see [Access control model in Azure Data Lake Storage Gen2](../blobs/data-lake-storage-access-control-model.md).
668
669
669
670
> [!TIP]
670
671
> The recommended way to grant access to specific resources is to use resource instance rules. To grant access to specific resource instances, see the [Grant access from Azure resource instances (preview)](#grant-access-specific-instances) section of this article.
In this section, you use Azure CLI to create an IoT hub and a resource group. An Azure resource group is a logical container into which Azure resources are deployed and managed. An IoT hub acts as a central message hub for bi-directional communication between your IoT application and the devices.
14
+
15
+
If you already have an IoT hub in your Azure subscription, you can skip this section.
16
+
17
+
To create an IoT hub and a resource group:
18
+
19
+
1. Launch your CLI app. To run the CLI commands in the rest of this quickstart, copy the command syntax, paste it into your CLI app, edit variable values, and press `Enter`.
20
+
21
+
- If you're using Cloud Shell, select the **Try It** button on the CLI commands to launch Cloud Shell in a split browser window. Or you can open the [Cloud Shell](https://shell.azure.com/bash) in a separate browser tab.
22
+
- If you're using Azure CLI locally, start your CLI console app and sign in to Azure CLI.
23
+
24
+
1. Run [az extension add](/cli/azure/extension#az_extension_add) to install or upgrade the *azure-iot* extension to the current version.
25
+
26
+
```azurecli-interactive
27
+
az extension add --upgrade --name azure-iot
28
+
```
29
+
30
+
1. In your CLI app, run the [az group create](/cli/azure/group#az_group_create) command to create a resource group. The following command creates a resource group named *MyResourceGroup* in the *eastus* location.
31
+
32
+
>[!NOTE]
33
+
> Optionally, you can set a different location. To see available locations, run `az account list-locations`.
34
+
35
+
```azurecli-interactive
36
+
az group create --name MyResourceGroup --location eastus
37
+
```
38
+
39
+
1. Run the [az iot hub create](/cli/azure/iot/hub#az_iot_hub_create) command to create an IoT hub. It might take a few minutes to create an IoT hub.
40
+
41
+
*YourIotHubName*. Replace this placeholder and the surrounding braces in the following command, using the name you chose for your IoT hub. An IoT hub name must be globally unique in Azure. Use your IoT hub name in the rest of this quickstart wherever you see the placeholder.
42
+
43
+
```azurecli-interactive
44
+
az iot hub create --resource-group MyResourceGroup --name {YourIoTHubName}
This quickstart uses two Java applications: a simulated device application that responds to direct methods called from a back-end application and a service application that calls the direct method on the simulated device.
12
+
This quickstart uses two Java applications:
13
+
14
+
* A simulated device application that responds to direct methods called from a back-end application.
15
+
* A service application that calls the direct method on the simulated device.
13
16
14
17
## Prerequisites
15
18
@@ -31,27 +34,23 @@ This quickstart uses two Java applications: a simulated device application that
* Clone or download the [Azure IoT Java samples](https://github.com/Azure-Samples/azure-iot-samples-java/) from GitHub.
35
38
36
-
* Port 8883 open in your firewall. The device sample in this quickstart uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../articles/iot-hub/iot-hub-mqtt-support.md#connecting-to-iot-hub).
39
+
* Make sure that port 8883 open in your firewall. The device sample in this quickstart uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../articles/iot-hub/iot-hub-mqtt-support.md#connecting-to-iot-hub).
If you completed the previous [Quickstart: Send telemetry from a device to an IoT hub](../articles/iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-java), you can skip this step.
If you completed the previous [Quickstart: Send telemetry from a device to an IoT hub](../articles/iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-java), you can skip this step.
49
+
A device must be registered with your IoT hub before it can connect. In this quickstart, you use the Azure Cloud Shell to create a device identity.
51
50
52
-
A device must be registered with your IoT hub before it can connect. In this quickstart, you use the Azure Cloud Shell to register a simulated device.
51
+
If you already have a device registered in your IoT hub, you can skip this section.
53
52
54
-
1. Run the following command in Azure Cloud Shell to create the device identity.
53
+
1. Run the [az iot hub device-identity create](/cli/azure/iot/hub/device-identity#az_iot_hub_device_identity_create) command in Azure Cloud Shell to create the device identity.
55
54
56
55
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
57
56
@@ -62,7 +61,7 @@ A device must be registered with your IoT hub before it can connect. In this qui
2. Run the following commands in Azure Cloud Shell to get the _device connection string_ for the device you just registered:
64
+
2. Run the [az iot hub device-identity connection-string show](/cli/azure/iot/hub/device-identity/connection-string#az_iot_hub_device_identity_connection_string_show) command in Azure Cloud Shell to get the _device connection string_ for the device you just registered:
66
65
67
66
**YourIoTHubName**: Replace this placeholder below with the name you choose for your IoT hub.
68
67
@@ -95,7 +94,7 @@ Make a note of the service connection string, which looks like:
95
94
96
95
You use this value later in the quickstart. This service connection string is different from the device connection string you noted in the previous step.
97
96
98
-
## Listen for direct method calls
97
+
## Simulate a device
99
98
100
99
The simulated device application connects to a device-specific endpoint on your IoT hub, sends simulated telemetry, and listens for direct method calls from your hub. In this quickstart, the direct method call from the hub tells the device to change the interval at which it sends telemetry. The simulated device sends an acknowledgment back to your hub after it executes the direct method.
This quickstart uses two Node.js applications: a simulated device application that responds to direct methods called from a back-end application and a back-end application that calls the direct methods on the simulated device.
12
+
This quickstart uses two Node.js applications:
13
+
14
+
* A simulated device application that responds to direct methods called from a back-end application. To receive the direct method calls, this application connects to a device-specific endpoint on your IoT hub.
15
+
* A back-end application that calls the direct methods on the simulated device. To call a direct method on a device, this application connects to a service-specific endpoint on your IoT hub.
13
16
14
17
## Prerequisites
15
18
@@ -23,27 +26,23 @@ This quickstart uses two Node.js applications: a simulated device application th
* Clone or download the [Azure IoT Node.js samples](https://github.com/Azure-Samples/azure-iot-samples-node/) from GitHub.
27
30
28
-
* Port 8883 open in your firewall. The device sample in this quickstart uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../articles/iot-hub/iot-hub-mqtt-support.md#connecting-to-iot-hub).
31
+
* Make sure that port 8883 is open in your firewall. The device sample in this quickstart uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../articles/iot-hub/iot-hub-mqtt-support.md#connecting-to-iot-hub).
If you completed the previous [Quickstart: Send telemetry from a device to an IoT hub](../articles/iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-nodejs), you can skip this step.
If you completed the previous [Quickstart: Send telemetry from a device to an IoT hub](../articles/iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-nodejs), you can skip this step.
41
+
A device must be registered with your IoT hub before it can connect. In this quickstart, you use Azure CLI to create a device identity.
43
42
44
-
A device must be registered with your IoT hub before it can connect. In this quickstart, you use the Azure Cloud Shell to register a simulated device.
43
+
If you already have a device registered in your IoT hub, you can skip this section.
45
44
46
-
1. Run the following command in Azure Cloud Shell to create the device identity.
45
+
1. Run the [az iot hub device-identity create](/cli/azure/iot/hub/device-identity#az_iot_hub_device_identity_create) command in Azure Cloud Shell to create the device identity.
47
46
48
47
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
49
48
@@ -54,7 +53,7 @@ A device must be registered with your IoT hub before it can connect. In this qui
2. Run the following commands in Azure Cloud Shell to get the _device connection string_ for the device you just registered:
56
+
2. Run the [az iot hub device-identity connection-string show](/cli/azure/iot/hub/device-identity/connection-string#az_iot_hub_device_identity_connection_string_show) command in Azure Cloud Shell to get the _device connection string_ for the device you just registered:
58
57
59
58
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
60
59
@@ -71,23 +70,24 @@ A device must be registered with your IoT hub before it can connect. In this qui
71
70
72
71
You use this value later in the quickstart.
73
72
74
-
3. You also need a _service connection string_ to enable the back-end application to connect to your IoT hub and retrieve the messages. The following command retrieves the service connection string for your IoT hub:
73
+
## Retrieve the service connection string
75
74
76
-
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
75
+
You also need your IoT hub's _service connection string_ to enable the back-end application to connect to your IoT hub and retrieve the messages. The following command retrieves the service connection string for your IoT hub:
77
76
78
-
```azurecli-interactive
79
-
az iot hub connection-string show \
80
-
--policy-name service --name {YourIoTHubName} --output table
77
+
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
81
78
82
-
```
79
+
```azurecli-interactive
80
+
az iot hub connection-string show \
81
+
--policy-name service --name {YourIoTHubName} --output table
82
+
```
83
83
84
-
Make a note of the service connection string, which looks like:
84
+
Make a note of the service connection string, which looks like:
You use this value later in the quickstart. This service connection string is different from the device connection string you noted in the previous step.
88
+
You use this value later in the quickstart. This service connection string is different from the device connection string you noted in the previous step.
89
89
90
-
## Listen for direct method calls
90
+
## Simulate a device
91
91
92
92
The simulated device application connects to a device-specific endpoint on your IoT hub, sends simulated telemetry, and listens for direct method calls from your hub. In this quickstart, the direct method call from the hub tells the device to change the interval at which it sends telemetry. The simulated device sends an acknowledgment back to your hub after it executes the direct method.
93
93
@@ -110,7 +110,7 @@ The simulated device application connects to a device-specific endpoint on your
110
110
111
111
## Call the direct method
112
112
113
-
The back-end application connects to a service-side endpoint on your IoT Hub. The application makes direct method calls to a device through your IoT hub and listens for acknowledgments. An IoT Hub back-end application typically runs in the cloud.
113
+
The back-end application connects to a service-side endpoint on your IoT hub. The application makes direct method calls to a device through your IoT hub and listens for acknowledgments. An IoT Hub back-end application typically runs in the cloud.
114
114
115
115
1. In another local terminal window, navigate to the root folder of the sample Node.js project. Then navigate to the **iot-hub\Quickstarts\back-end-application** folder.
0 commit comments