Skip to content

Commit ab71a48

Browse files
committed
Persist environment variables across quickstarts
1 parent bd3e66f commit ab71a48

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

articles/iot-operations/get-started/quickstart-add-assets.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ To add an asset endpoint:
8484

8585
These quickstarts use the **OPC PLC simulator** to generate sample data. To enable the quickstart scenario, you need to configure the OPC UA Broker to accept untrusted server certificates and your asset endpoint to connect without mutual trust established. This configuration is not recommended for production or pre-production environments. For more information, see [Deploy the OPC PLC simulator](../manage-devices-assets/howto-configure-opc-plc-simulator.md):
8686

87+
Run the following commands in your Codespaces terminal, which has all of your environment variables configures.
88+
8789
1. To configure the simulator for the quickstart scenario, run the following command:
8890

8991
```azurecli
90-
az k8s-extension update --version 0.3.0-preview --name opc-ua-broker --release-train preview --cluster-name <CLUSTER_NAME> --resource-group <RESOURCE_GROUP> --cluster-type connectedClusters --auto-upgrade-minor-version false --config opcPlcSimulation.deploy=true --config opcPlcSimulation.autoAcceptUntrustedCertificates=true
92+
az k8s-extension update --version 0.3.0-preview --name opc-ua-broker --release-train preview --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --cluster-type connectedClusters --auto-upgrade-minor-version false --config opcPlcSimulation.deploy=true --config opcPlcSimulation.autoAcceptUntrustedCertificates=true
9193
```
9294

9395
> [!CAUTION]
@@ -251,10 +253,10 @@ aio-akri-otel-collector-5c775f745b-g97qv 1/1 Running 3 (4h15m ago)
251253
aio-akri-agent-daemonset-mp6v7 1/1 Running 3 (4h15m ago) 2d23h
252254
```
253255

254-
On the machine where your Kubernetes cluster is running, run the following command to apply a new configuration for the discovery handler:
256+
In your Codespaces terminal, run the following command to apply a new configuration for the discovery handler:
255257

256258
```console
257-
kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/main/samples/quickstarts/akri-opcua-asset.yaml
259+
kubectl apply -f /workspaces/explore-iot-operations/samples/quickstarts/akri-opcua-asset.yaml
258260
```
259261

260262
The following snippet shows the YAML file that you applied:

articles/iot-operations/get-started/quickstart-deploy.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,21 @@ This helper command checks connectivity to Azure Resource Manager and Microsoft
8383

8484
In this section, you use the [az iot ops init](/cli/azure/iot/ops#az-iot-ops-init) command to configure your cluster so that it can communicate securely with your Azure IoT Operations components and key vault, then deploy Azure IoT Operations.
8585

86-
1. Create a key vault. Replace the placeholder parameters with your own information.
86+
Run the following CLI commands in your Codespaces terminal.
8787

88-
| Placeholder | Value |
89-
| ----------- | ----- |
90-
| **RESOURCE_GROUP** | The name of your resource group that contains the connected cluster. |
91-
| **KEYVAULT_NAME** | A name for a new key vault. |
88+
1. Create a key vault. For this scenario, use the same name and resource group as your cluster.
9289

9390
```azurecli
94-
az keyvault create --enable-rbac-authorization false --name $KEYVAULT_NAME --resource-group $RESOURCE_GROUP
91+
az keyvault create --enable-rbac-authorization false --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP
9592
```
9693

9794
>[!TIP]
9895
> You can use an existing key vault for your secrets, but verify that the **Permission model** is set to **Vault access policy**. You can check this setting in the Azure portal in the **Access configuration** section of an existing key vault. Or use the [az keyvault show](/cli/azure/keyvault#az-keyvault-show) command to check that `enableRbacAuthorization` is false.
9996
100-
1. Run the following CLI command on your development machine or in your codespace terminal. Replace the placeholder parameters with your own information.
101-
102-
| Placeholder | Value |
103-
| ----------- | ----- |
104-
| **CLUSTER_NAME** | The name of your connected cluster. |
105-
| **RESOURCE_GROUP** | The name of your resource group that contains the connected cluster. |
106-
| **KEYVAULT_NAME** | The name of your key vault. |
97+
1. Deploy Azure IoT Operations.
10798

10899
```azurecli
109-
az iot ops init --simulate-plc --cluster <CLUSTER_NAME> --resource-group <RESOURCE_GROUP> --kv-id $(az keyvault show --name <KEYVAULT_NAME> -o tsv --query id)
100+
az iot ops init --simulate-plc --cluster $CLUSTER_NAME --resource-group $RESOURCE_GROUP --kv-id $(az keyvault show --name $CLUSTER_NAME -o tsv --query id)
110101
```
111102

112103
If you get an error that says *Your device is required to be managed to access your resource*, run `az login` again and make sure that you sign in interactively with a browser.

articles/iot-operations/includes/connect-cluster-codespaces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ To connect your cluster to Azure Arc:
6767

6868
1. Use the [az connectedk8s enable-features](/cli/azure/connectedk8s#az-connectedk8s-enable-features) command to enable custom location support on your cluster. This command uses the `objectId` of the Microsoft Entra ID application that the Azure Arc service uses.
6969

70-
```azurecli
71-
az connectedk8s enable-features -n $CLUSTER_NAME -g $RESOURCE_GROUP --custom-locations-oid $OBJECT_ID --features cluster-connect custom-locations
72-
```
70+
```azurecli
71+
az connectedk8s enable-features -n $CLUSTER_NAME -g $RESOURCE_GROUP --custom-locations-oid $OBJECT_ID --features cluster-connect custom-locations
72+
```

articles/iot-operations/includes/prepare-codespaces.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ To get started with your codespace:
3535
| LOCATION | An Azure region close to you. The following regions are supported in public preview: eastus, eastus2, westus, westus2, westus3, westeurope, or northeurope. |
3636

3737
>[!TIP]
38-
> The values you provide as secrets in this step get saved on your GitHub account to be used in this and future codespaces. They're also automatically added as environment variables in the codespace terminal, and you can use those environment variables in the CLI commands in the next section.
38+
>The values you provide as secrets in this step get saved on your GitHub account to be used in this and future codespaces. They're also automatically added as environment variables in the codespace terminal, and you can use those environment variables in the CLI commands in the next section.
39+
>
40+
>Additionally, this codespace automatically creates a `CLUSTER_NAME` environment variable which is set with the codespace name.
3941
4042
1. Select **Create new codespace**.
4143

0 commit comments

Comments
 (0)