Getting an Azure IoT Hub Connector Up and Running > Step 5. Create Azure IoT Entities in ThingWorx Composer
Step 5. Create Azure IoT Entities in ThingWorx Composer
An ephemeral Thing based on the ProtocolAdapterWithAvailability Thing Template is automatically created for a ThingWorx Azure IoT Hub Connector when it starts up and first connects to the ThingWorx Platform. That the Connector Thing is ephemeral means that it lives as long as the Connector is running. The Connector Thing applies the correct ThingWorx shapes to itself. You do not need to do anything to represent the Connector in ThingWorx.
However, you do need to create Things to represent Azure IoT entities in ThingWorx, namely the Azure IoT Hub, one or more Azure Storage Containers, and, for non-OPC UA usage of the Connector, AzureIotThing Things to represent Azure IoT Edge devices that communicate with ThingWorx via the Azure IoT Hub and the ThingWorx Connector.
From ThingWorx Composer, follow these steps to create the Azure IoT entities::
1. Add at least one new Thing for an Azure Storage Container. Associate the Thing with the AzureBlobStorageTemplate Thing Template.
2. Click Save and then select Configure to display the configuration settings.
3. Supply values for the configuration settings for this Thing:
a. accountName — Your Azure Storage Account name
b. connectionString — The value from <your_Storage_Container> > Settings > Access keys- > key1 > Connection string.
4. Add an AzureIotHubTemplate Thing for the Azure IoT Hub with which the Connector will communicate. Associate the Thing with the AzureIotHubTemplate Thing Template.
Click Save and then click the Configuration tab.
5. In the Configuration page for the AzureIotHubTemplate Thing, supply values for the following settings for this Thing:
a. hubName — The name you used when creating your Azure IoT Hub. By default, this hub name serves as the group name for binding the Azure IoT Devices and Azure IoT Edge devices to their corresponding entities in the ThingWorx Platform.
b. Two properties enable bi-directional secure communication between the Azure IoT Hub and the Connector, using SSL:
consumerPolicyConnectionString— The value from <your hub. > Settings > Shared access policies > service > Shared access keys > Connection String - primary key
* 
If you enter the wrong connection string here, you will get the error, Error Failed to initialize all the egress handlers: Shared Access KeyName cannot be null or empty on startup.
registryPolicyConnectionString — The value from <your hub> > Settings > Shared access policies > registryReadWrite > Shared access keys > Connection String primary key.
c. deviceExportBlobThing — Select the Azure Blob Storage Thing created in Step 1.
d. eventHubName — Enter the value from <your hub> > Settings > Built-in Endpoints > Event-Hub compatible name.
e. eventHubEndpoint — Enter the value from <your hub> > Settings > Built-in Endpoints > Event-Hub compatible endpoint.
f. eventProcessorHostBlobThing — Select the Azure Blob Storage Thing created in Step 1.
g. fileRepositoryBlobThing — Select the Azure Blob Storage Thing created in Step 1.
h. Keep the default values for all other properties. For example, if consumerGroup is not configured in Azure, leave this field blank.
The following figures show the configuration properties for the Azure IoT Hub. Note that the connection strings and eventHubEndpoint are considered "secrets" and will be encrypted when sent to the Connector. In this page, the values are shown with asterisks.
6. If you are using the Azure IoT Hub Connector to integrate Microsoft Azure Industrial IoT OPC UA with ThingWorx Kepware Server and ThingWorx Platform, set the following properties for the Azure IoT Hub Thing under AzureOpcUa in the Configuration tab:
Property
Setting
authManagementURL
From your Azure portal, go to App registrations and find your <application-name>-service app registration. In the overview section, use the Application ID URI value.
baseUrl
Enter the DNS name label, including the entire domain, where the format of the domain is HTTPS://<region>.cloudapp.azure.com. The HTTPS:// prefix is required. You can see this label on the Configuration tab of the public IP you created earlier for your AKS ingress controller.
clientID
In Azure go to App registrations and find your <application-name>-client application registration. In the overview section locate the value of the Application ID.
clientSecret
In the same <application-name>-client application registration, go to the Certificates & secrets section. Create a new Key and use it for the value here.
publisherPath
Leave the default setting.
registryPath
Leave the default setting.
subscriptionID
Enter the Subscription ID (GUID) of the Industrial -IoT deployment.
tenantID
Enter the Tenant ID (GUID) of the Industrial IoT deployment.
twinPath
Leave the default setting.
7. Create a Thing for every Azure IoT Edge device that you want to connect to ThingWorx. Under Base Thing Template, select the AzureIotThing Thing Template for every AzureIotThing.
8. To ensure proper routing of messages, set the following property for each Azure IoT device Thing:
gatewayThing — Select the Azure IoT Hub Thing created in Step 2 above.