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
Copy file name to clipboardExpand all lines: articles/iot-operations/develop-edge-apps/quickstart-get-started-sdks.md
+46-3Lines changed: 46 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,10 @@ Before you begin, prepare the following prerequisites:
25
25
26
26
## Setting up
27
27
28
-
Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with Azure IoT Operations deployed. Additional configuration will allow MQTT broker to be accessed directly from the developer environment. The following development environment setup options use [k3d](https://k3d.io/#what-is-k3d) to simplify Kubernetes cluster creation. GitHub Codespaces provides the most streamlined experience and can get the development environment up and running in a couple of minutes.
28
+
Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with Azure IoT Operations deployed. Additional configuration will allow MQTT broker to be accessed directly from the developer environment. The following development environment setup options use [K3s](https://k3s.io/) running in [K3d](https://k3d.io/) for a lightweight Kubernetes cluster. GitHub Codespaces provides the most streamlined experience and can get the development environment up and running in a couple of minutes.
29
+
30
+
> [!IMPORTANT]
31
+
> The following development environment setup options, use [K3s](https://k3s.io/) running in [K3d](https://k3d.io/) for a lightweight Kubernetes cluster, and deploys Azure IoT Operations with [test settings](../deploy-iot-ops/overview-deploy.md#test-settings-deployment). If you want to use [secure settings](../deploy-iot-ops/overview-deploy.md#secure-settings-deployment), we recommend you follow the instructions in [Prepare your Azure Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-prepare-cluster.md) to create a K3s cluster on Ubuntu and [Deploy Azure IoT Operations to an Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-deploy-iot-operations.md) to deploy with secure settings. Then proceed to [configure Azure IoT Operations for deployment](#configure-azure-iot-operations-for-deployment).
29
32
30
33
### [Codespaces](#tab/codespaces)
31
34
@@ -36,7 +39,8 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
36
39
37
40
[](https://codespaces.new/Azure/iot-operations-sdks?quickstart=1&editor=vscode)
38
41
39
-
1. Once the codespace is created, you will have a container with the developer tools and a local k3s cluster pre-installed.
42
+
1. Once the codespace is created, you will have a container with the developer tools and a local k3s cluster running in k3d pre-installed.
43
+
40
44
41
45
### [Ubuntu](#tab/ubuntu)
42
46
@@ -62,6 +66,19 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
62
66
sudo ./tools/deployment/initialize-cluster.sh
63
67
```
64
68
69
+
This script does the following:
70
+
71
+
1. Installs prerequisites including:
72
+
1. Install k3d
73
+
1. Install Step CLI
74
+
1. Helm
75
+
1. AZ CLI
76
+
1. Step
77
+
1. **DELETE** the existing default k3d cluster
78
+
1. Deploy a new k3d cluster
79
+
1. Set up port forwarding for ports `1883`, `8883`, and `8884` to enable TLS
80
+
1. Create a local registry
81
+
65
82
### [Visual Studio Code Dev Containers](#tab/vscode-dev-containers)
66
83
67
84
> [!WARNING]
@@ -133,11 +150,24 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
133
150
sudo ./tools/deployment/initialize-cluster.sh
134
151
```
135
152
153
+
This script does the following:
154
+
155
+
1. Installs prerequisites including:
156
+
1. Install k3d
157
+
1. Install Step CLI
158
+
1. Helm
159
+
1. AZ CLI
160
+
1. Step
161
+
1. **DELETE** the existing default k3d cluster
162
+
1. Deploy a new k3d cluster
163
+
1. Set up port forwarding for ports `1883`, `8883`, and `8884` to enable TLS
164
+
1. Create a local registry
165
+
136
166
---
137
167
138
168
## Deploy Azure IoT Operations
139
169
140
-
Azure IoT Operations will be deployed on the development cluster that you created in the previous step, and then the configuration will be altered with the `configure-aio.sh` script to provide additional off-cluster access methods to streamline development:
170
+
Azure IoT Operations will be deployed on the development cluster that you created in the previous step.
141
171
142
172
### [Codespaces](#tab/codespaces)
143
173
@@ -152,6 +182,8 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
152
182
153
183
### [Visual Studio Code Dev Containers](#tab/vscode-dev-containers)
154
184
185
+
Open a new bash terminal in the VS Code Dev Container and do the following steps:
@@ -160,6 +192,10 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
160
192
161
193
---
162
194
195
+
## Configure Azure IoT Operations for development
196
+
197
+
After Azure IoT Operations is deployed, you need to configure it for development. This includes setting up the MQTT broker and authentication methods, as well as ensuring that the necessary environment variables are setfor your development environment:
198
+
163
199
1. Check that Azure IoT Operations is successfully installed and **resolve any errors before continuing**:
164
200
165
201
```azurecli
@@ -189,6 +225,13 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
189
225
./tools/deployment/configure-aio.sh
190
226
```
191
227
228
+
This script does the following:
229
+
230
+
1. Setup certificate services, if missing
231
+
1. Create root and intermediate CAs for x509 authentication
232
+
1. Create the trust bundle ConfigMap for the Broker to authentication x509 clients
233
+
1. Configure a `BrokerListener` and `BrokerAuthentication` resources for SAT and x509 auth
234
+
192
235
## Shell configuration
193
236
194
237
The samples within [Azure IoT Operations SDKs github repository](https://github.com/Azure/iot-operations-sdks) read configuration from environment variables. We have provided an `.env` file in the repository root that exports the variables used by the samples to connect to the MQTT Broker. Edit the `.env` file to set the values foryour environment, or use the default values providedin the file.
Copy file name to clipboardExpand all lines: articles/iot-operations/includes/deploy-aio-sdks-linux.md
+36-4Lines changed: 36 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,41 @@ ms.author: sergaz
13
13
az group create --location <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID>
14
14
```
15
15
16
-
1.Follow the instructions in [Prepare your Azure Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-prepare-cluster.md#arc-enable-your-cluster) to arc-enable your cluster in Ubuntu.
16
+
1.Register the required resource providers in your subscription:
17
17
18
-
1. Follow the instructions in [Deploy Azure IoT Operations to an Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-deploy-iot-operations.md) to deploy Azure IoT Operations to your cluster.
18
+
>[!NOTE]
19
+
>This step only needs to be run once per subscription. To register resource providers, you need permission to do the `/register/action` operation, which is included in subscription Contributor and Owner roles. For more information, see [Azure resource providers and types](../../azure-resource-manager/management/resource-providers-and-types.md).
19
20
20
-
> [!NOTE]
21
-
> You can start with test settings, and then [enable secure settings](../deploy-iot-ops/howto-enable-secure-settings.md) later.
21
+
```azurecli
22
+
az provider register -n "Microsoft.ExtendedLocation"
23
+
az provider register -n "Microsoft.Kubernetes"
24
+
az provider register -n "Microsoft.KubernetesConfiguration"
25
+
az provider register -n "Microsoft.IoTOperations"
26
+
az provider register -n "Microsoft.DeviceRegistry"
27
+
az provider register -n "Microsoft.SecretSyncController"
28
+
```
29
+
30
+
1. Use the [az connectedk8s connect](/cli/azure/connectedk8s#az-connectedk8s-connect) command to Arc-enable your Kubernetes cluster and manage it as part of your Azure resource group.
To prevent unplanned updates to Azure Arc and the system Arc extensions that Azure IoT Operations uses as dependencies, this command disables autoupgrade. Instead, [manually upgrade agents](/azure/azure-arc/kubernetes/agent-upgrade#manually-upgrade-agents) as needed.
37
+
38
+
1. Prepare for enabling the Azure Arc service, custom location, on your Arc cluster by getting the custom location object ID and saving it as the environment variable, OBJECT_ID. You must be logged into Azure CLI with a Microsoft Entra user account to successfully run the command, not a service principal. Run the following command **exactly as written**, without changing the GUID value.
39
+
40
+
```azurecli
41
+
export OBJECT_ID=$(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)
42
+
```
43
+
44
+
> [!NOTE]
45
+
>If you receive the error: "Unable to fetch oid of 'custom-locations' app. Proceeding without enabling the feature. Insufficient privileges to complete the operation," then your service principal might lack the necessary permissions to retrieve the object ID of the custom location. Log into Azure CLI with a Microsoft Entra user account that meets the prerequisites. For more information, see [Create and manage custom locations](https://aka.ms/enable-cl-sp).
46
+
47
+
1. Use the [az connectedk8s enable-features](/cli/azure/connectedk8s#az-connectedk8s-enable-features) command to enable the custom location feature on your Arc cluster. This command uses the OBJECT_ID environment variable saved from the previous step to set the value for the custom-locations-oid parameter:
1. Follow the instructions in [Deploy Azure IoT Operations to an Arc-enabled Kubernetes cluster](../deploy-iot-ops/howto-deploy-iot-operations.md) to deploy Azure IoT Operations to your cluster with **Test settings**.
0 commit comments