Skip to content

Commit 272c7ce

Browse files
committed
adding arc-enable steps
1 parent f29c781 commit 272c7ce

File tree

2 files changed

+82
-7
lines changed

2 files changed

+82
-7
lines changed

articles/iot-operations/develop-edge-apps/quickstart-get-started-sdks.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ Before you begin, prepare the following prerequisites:
2525

2626
## Setting up
2727

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).
2932
3033
### [Codespaces](#tab/codespaces)
3134

@@ -36,7 +39,8 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
3639

3740
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure/iot-operations-sdks?quickstart=1&editor=vscode)
3841

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+
4044

4145
### [Ubuntu](#tab/ubuntu)
4246

@@ -62,6 +66,19 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
6266
sudo ./tools/deployment/initialize-cluster.sh
6367
```
6468

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+
6582
### [Visual Studio Code Dev Containers](#tab/vscode-dev-containers)
6683

6784
> [!WARNING]
@@ -133,11 +150,24 @@ Developing with the Azure IoT Operations SDKs requires a Kubernetes cluster with
133150
sudo ./tools/deployment/initialize-cluster.sh
134151
```
135152

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+
136166
---
137167

138168
## Deploy Azure IoT Operations
139169

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.
141171

142172
### [Codespaces](#tab/codespaces)
143173

@@ -152,6 +182,8 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
152182

153183
### [Visual Studio Code Dev Containers](#tab/vscode-dev-containers)
154184

185+
Open a new bash terminal in the VS Code Dev Container and do the following steps:
186+
155187
[!INCLUDE [deploy-aio-sdks-linux](../includes/deploy-aio-sdks-linux.md)]
156188

157189
### [Windows Subsystem for Linux (WSL)](#tab/wsl)
@@ -160,6 +192,10 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
160192

161193
---
162194

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 set for your development environment:
198+
163199
1. Check that Azure IoT Operations is successfully installed and **resolve any errors before continuing**:
164200

165201
```azurecli
@@ -189,6 +225,13 @@ Follow the instructions in [Quickstart: Run Azure IoT Operations in GitHub Codes
189225
./tools/deployment/configure-aio.sh
190226
```
191227

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+
192235
## Shell configuration
193236

194237
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 for your environment, or use the default values provided in the file.

articles/iot-operations/includes/deploy-aio-sdks-linux.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,41 @@ ms.author: sergaz
1313
az group create --location <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID>
1414
```
1515

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:
1717

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).
1920
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.
31+
32+
```azurecli
33+
az connectedk8s connect --name <CLUSTER_NAME> -l <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID> --disable-auto-upgrade
34+
```
35+
36+
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:
48+
49+
```azurecli
50+
az connectedk8s enable-features -n <CLUSTER_NAME> -g <RESOURCE_GROUP> --custom-locations-oid $OBJECT_ID --features cluster-connect custom-locations
51+
```
52+
53+
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

Comments
 (0)