# Azure IoT **nx_azure_iot_create** ***
This routine creates the Azure IoT subsystem. An internal thread is created to manage activities related to Azure IoT services. Only one `NX_AZURE_IOT` instance is needed to manage instances for Azure IoT hub, IoT Central, and Device Provisioning Services (DPS).
**Parameters** | Name | Description | | - |:-| | nx_azure_iot_ptr [in] | A pointer to a NX_AZURE_IOT | | name_ptr [in] | A pointer to a NULL-terminated string indicating the name of the Azure IoT instance. | | ip_ptr [in] | A pointer to a `NX_IP`, which is the IP stack used to connect to Azure IoT Services. | | pool_ptr [in] | A pointer to a `NX_PACKET_POOL`, which is the packet pool used by Azure IoT Services. | | dns_ptr [in] | A pointer to a `NX_DNS`. | | stack_memory_ptr [in] | A pointer to memory to be used as a stack space for the internal thread. | | stack_memory_size [in] | Size of stack memory area. | | priority [in] | Priority of the internal thread. | | unix_time_callback [in] | Callback to fetch unix time from platform. | **Return Values** * NX_AZURE_IOT_SUCCESS Successfully created the Azure IoT instance. * NX_AZURE_IOT_INVALID_PARAMETER Fail to create the Azure IoT instance due to invalid parameter. * NX_OPTION_ERROR Fail to create the Azure IoT instance due to invalid priority. * NX_PTR_ERROR Fail to create the Azure IoT instance due to invalid parameter. * NX_SIZE_ERROR Fail to create the Azure IoT instance due to insufficient size of stack memory. **Allowed From** Initialization, Threads **Example** **See Also** **nx_azure_iot_delete** ***This routine stops all Azure services managed by this instance, and cleans up internal resources.
**Parameters** | Name | Description | | - |:-| | nx_azure_iot_ptr [in] | A pointer to a `NX_AZURE_IOT` | **Return Values** * NX_AZURE_IOT_SUCCESS Successful stopped Azure IoT services and cleaned up internal resources. * NX_AZURE_IOT_INVALID_PARAMETER Fail to delete the Azure IoT instance due to invalid parameter. * NX_AZURE_IOT_DELETE_ERROR Fail to delete the Azure IoT instance due to resource is still in use. **Allowed From** Threads **Example** **See Also** **nx_azure_iot_log_init** ***This routine initialized the logging with customer specific callback to output the logs for different classifications
* AZ_LOG_IOT_AZURERTOS * AZ_LOG_MQTT_RECEIVED_TOPIC * AZ_LOG_MQTT_RECEIVED_PAYLOAD * AZ_LOG_IOT_RETRY * AZ_LOG_IOT_SAS_TOKEN **Parameters** | Name | Description | | - |:-| | log_callback [in] | A pointer to a callback | **Allowed From** Threads **Example** **See Also**