azure-industrial-iot
by Helm
Azure Industrial IoT allows plant operators to discover OPC UA enabled servers in a factory network and register them in Azure IoT Hub.
About this chart
Azure Industrial IoT
Azure Industrial IoT allows users to discover OPC UA enabled servers in a factory network, register them in Azure IoT Hub and start collecting data from them.
Table Of Contents
- Introduction
- Prerequisites
- Required Azure Resources
- Azure AAD Tenant
- Azure IoT Hub
- Azure Cosmos DB Account
- Azure Storage Account
- Data Protection Container (Optional)
- Azure Event Hub Namespace
- Azure Event Hub
- Azure Event Hub Consumer Groups
- Azure Service Bus Namespace
- Azure Key Vault
- Data Protection Key (Optional)
- Recommended Azure Resources
- Azure AAD App Registration
- Optional Azure Resources
- Azure SignalR
- Azure Application Insights
- Azure Log Analytics Workspace
- Required Azure Resources
- Installing the Chart
- Configuration
- Image
- Azure Resources
- Load Configuration From Azure Key Vault
- External Service URL
- RBAC
- Service Account
- Application Runtime Configuration
- Deployed Components
- Deployment Resource Configuration
- Service Resource Configuration
- Ingress Resource Configuration
- Prometheus
- Minimal Configuration
- Special Notes
- Resource Requests And Limits
- Data Protection
- Azure Storage Account Container
- Azure Key Vault Key
- Swagger
- NGINX Ingress Controller
- Controller configuration
- Ingress Annotations
Introduction
This chart bootstraps Azure Industrial IoT deployment on a Kubernetes cluster using the Helm package manager.
Prerequisites
- Helm 3.0+
- Azure CLI to run the commands bellow.
The chart requires several Azure resources to be present for components of Azure Industrial IoT solution to function.
Their details should be passed via either values.yaml or command-line arguments.
Required Azure Resources
The following Azure resources are mandatory for the operation of Azure Industrial IoT components.
Azure AAD Tenant
This will be present if you have an Azure account. The chart only needs Guid representing the TenantId. This can be obtained with the following command:
$ az account show --query "tenantId"
"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
Azure IoT Hub
You would need to have an existing Azure IoT Hub. Here are the steps to create an IoT Hub using the Azure portal. S1 Standard tier with 1 IoT Hub unit capacity IoT Hub would suffice.
The following details of the Azure IoT Hub would be required:
-
Details of built-it Event Hub-compatible endpoint. Details on how to get this information from Azure portal can be found here.
-
Endpoint in
sb://<iot_hub_unique_identifier>.servicebus.windows.net/format. This can be obtained with the following command:$ az iot hub show --name MyIotHub --query "properties.eventHubEndpoints.events.endpoint" "sb://iothub-ns-XXXXXX-XXX-XXXXXXX-XXXXXXXXXX.servicebus.windows.net/" -
Several consumer groups. Please create new consumer groups for components of Azure Industrial IoT. The consumer groups can be created with the following commands:
$ az iot hub consumer-group create --hub-name MyIotHub --name events $ az iot hub consumer-group create --hub-name MyIotHub --name telemetry $ az iot hub consumer-group create --hub-name MyIotHub --name onboardingHere are our recommended names for them:
events: will be used byeventsProcessormicroservicestelemetry: will be used bytelemetryProcessormicroservicesonboarding: will be used byonboardingmicroservices
-
-
Connection string of
iothubownerpolicy for the Azure IoT Hub. This can be obtained with the following command:$ az iot hub show-connection-string --name MyIotHub --policy-name iothubowner --query "connectionString" "HostName=MyIotHub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"iothubownerpolicy is required because the components will perform management activities on Azure IoT Hub (such as adding a new device).
Azure Cosmos DB Account
You would need to have an existing Azure Cosmos DB account. You can follow these steps to
create an Azure Cosmos DB account from the Azure portal.
For the API please select Core (SQL).
The following details of the Azure Cosmos DB account would be required:
-
Connection string. This can be obtained with the following command:
$ az cosmosdb keys list --resource-group MyResourceGroup --name MyCosmosDBDatabaseAccount --type connection-strings --query "connectionStrings[0].connectionString" "AccountEndpoint=https://MyCosmosDBDatabaseAccount.documents.azure.com:443/;AccountKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;"If you remove
--query "primaryMasterKey"part, you would see four connection strings in output. We require either Primary or Secondary SQL Connection String, not Read-Only ones. This is required because Azure Industrial IoT components will create containers and databases in the Azure Cosmos DB account.
Azure Storage Account
You would need to have an existing Azure Storage account. Here are the steps to create an Azure Storage account. When creating it please make sure to:
- Set
Account kindtoStorageV2 (general-purpose v2), step 7 - Set
Hierarchical namespacetoDisabled, step 8
The following details of the Azure Storage account would be required:
-
Connection string for Azure Storage account. This can be obtained with the following command:
$ az storage account show-connection-string --name MyStorageAccount --query "connectionString" "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=MyStorageAccount;AccountKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Data Protection Container (Optional)
Data protection functionality is present only if
engineeringToolcomponent is enabled.
Data protection
is an ASP.Net Core feature that is used by engineeringTool component. It takes care of encryption of cookies that
are used by the engineeringTool.
We use Azure Storage as
storage provider
for storing data protection keys, and as such we require an Azure Storage Container. You can specify the
name of Azure Storage Container to be used for storing keys or the value will default to dataprotection.
This Azure Storage Container will be created automatically (if it doesn't already exist) when engineeringTool
component is enabled.
Configuration parameter for data protection Azure Storage Container is
azure.storageAccount.container.dataProtection.name.
Azure Event Hub Namespace
You would need to have an existing Azure Event Hub namespace. Here are the steps to create an Event Hubs namespace. Please note that we require Event Hub Namespace with Standard pricing tier because we need it to have two consumer groups.
The following details of the Azure Event Hub namespace would be required:
-
Connection string of
RootManageSharedAccessKeypolicy for the Azure Event Hub namespace. This can be obtained with the following command:$ az eventhubs namespace authorization-rule keys list --resource-group MyResourceGroup --namespace-name mynamespace --name RootManageSharedAccessKey --query "primaryConnectionString" "Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Both
primaryConnectionStringandsecondaryConnectionStringwould work.RootManageSharedAccessKeyis required because components will perform management activities, such as creating an Event Hub.
Azure Event Hub
Please create an Azure Event Hub in your Azure Event Hub Namespace. This can be created with the command bellow. Please note that you need to specify your Resource Group, Event Hub Namespace, desired name of Event Hub, desired message retention period (in days) and desired number of partitions. More details about the command and its parameters can be found here.
$ az eventhubs eventhub create --resource-group MyResourceGroup --namespace-name mynamespace --name myeventhub --message-retention 2 --partition-count 2
Azure Event Hub Consumer Groups
Please create a consumer group for the Event Hub. For example, you can call it telemetry_ux.
These can be created with the commands bellow. More details about the command and its
parameters can be found
here.
$ az eventhubs eventhub consumer-group create --resource-group MyResourceGroup --namespace-name mynamespace --eventhub-name myeventhub --name telemetry_ux
Azure Service Bus Namespace
You would need to have an existing Azure Service Bus namespace. Here are the steps to create a Service Bus namespace in the Azure portal.
The following details of the Azure Event Hub namespace would be required:
-
Connection string of
RootManageSharedAccessKeypolicy for the Azure Service Bus namespace. This can be obtained with the following command:$ az servicebus namespace authorization-rule keys list --resource-group MyResourceGroup --namespace-name mynamespace --name RootManageSharedAccessKey --query "primaryConnectionString" "Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Both
primaryConnectionStringandsecondaryConnectionStringwould work.RootManageSharedAccessKeyis required because components will perform management activities, such as creating Service Bus topics.
Azure Key Vault
You would need to have an existing Azure Key Vault. Here are the steps to create a Key Vault in the Azure portal.
The following details of the Azure Key Vault would be required:
-
URI, also referred as DNS Name. This can be obtained with the following command:
$ az keyvault show --name MyKeyVault --query "properties.vaultUri" "https://MyKeyVault.vault.azure.net/"
Data Protection Key (Optional)
Data protection functionality is present only if
engineeringToolcomponent is enabled.
Data protection
is an ASP.Net Core feature that is used by engineeringTool component. It takes care of encryption of cookies that
are used by the engineeringTool.
We use a key in Azure Key Vault to protect keys that are stored in
data protection Azure Storage Container. So you can either create
your own key in Azure Key Vault and provide that or one will be created for you automatically. More
precisely, if the key with the provided name already exists in the Key Vault, then it will be used.
Otherwise a key with the provided name will be created. If a key name is not specified then it defaults
to dataprotection.
Configuration parameter for data protection key in Azure Key Vault is `azure.keyVault.key
Deploy azure-industrial-iot with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has azure-industrial-iot on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartazure-industrial-iot is pinned at v0.4.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply