An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
Hello @Dhruvesh Sheladiya ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
Azure IoT Hub provides a secure, scalable device connectivity model based on per-device identity, strong authentication, and centralized provisioning. It supports MQTT, AMQP, and HTTPS protocols while ensuring every device is authenticated and authorized before communication is allowed.
- Device identity management and runtime validation All devices are managed through a central identity registry, where each device must be registered before it can connect. Each device identity includes:
- Unique device ID
- Authentication configuration (SAS, X.509, or TPM via provisioning)
- Status (enabled/disabled)
- Access permissions and metadata
- A TLS-secured connection is established with the IoT Hub endpoint
- Device identity is validated against the identity registry
- Authentication is performed based on configured credentials
- Authorization rules are evaluated before access is granted
- Authentication mechanisms - IoT Hub supports multiple authentication methods depending on device capability and security requirements. SAS token-based authentication (symmetric keys)
- Each device is assigned a unique symmetric key in the identity registry
- A Shared Access Signature (SAS) token is generated using this key
- IoT Hub validates the token by:
- Verifying the signature using the stored key
- Checking expiry and scope
- The symmetric key is never transmitted over the network
- Lightweight and easy to implement
- Suitable for constrained devices and development scenarios
- Requires secure key storage on device
-
- Each device is assigned a unique symmetric key in the identity registry
- A Shared Access Signature (SAS) token is generated using this key
- IoT Hub validates the token by:
- Verifying the signature using the stored key
- Checking expiry and scope
- The symmetric key is never transmitted over the network
- Lightweight and easy to implement
- Suitable for constrained devices and development scenarios
- Requires secure key storage on device Please refer to the following - Control access with shared access signatures - Azure IoT Hub | Microsoft Learn
- Device identity is validated during the TLS handshake using certificates
- IoT Hub validates:
- Certificate chain of trust (CA-based scenarios), or
- Thumbprint mapping to a registered device identity
- Certificate must be associated with a device in the identity registry
- No shared secrets required
- Strong PKI-based security model
- Supports certificate lifecycle management (rotation and revocation)
- Recommended for enterprise and production deployments Please refer to the following - https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-certificate-management-concepts
- Uses hardware-backed secure key storage
- Private keys remain within secure hardware boundaries
- Typically used during provisioning to establish device identity securely
- Device provisioning at scale Azure IoT Hub Device Provisioning Service enables automated and secure onboarding of large device fleets. Key capabilities:
- Zero-touch provisioning at device first boot
- Automatic assignment of devices to IoT Hub instances
- Support for SAS, X.509, and TPM attestation
- Secure identity creation and configuration at scale
- Scaling to millions of devices IoT Hub is designed for large-scale IoT workloads through:
- Distributed identity management for devices
- Independent authentication validation per connection request
- Horizontally scalable MQTT, AMQP, and HTTPS endpoints
- Partitioned backend processing for telemetry ingestion
- Integration with Device Provisioning Service for automated onboarding
SAS authentication
Best suited for:
- Development and testing
- Constrained or legacy devices
Considerations:
- Simpler to implement
- Requires careful key protection and rotation
X.509 authentication
Best suited for:
- Enterprise-scale deployments
- Security-sensitive environments
- Long-term device lifecycle management
Advantages:
- No shared secrets
- Strong cryptographic identity assurance
- Supports scalable certificate lifecycle operations
Please consider the following troubleshooting steps-
- For authentication failures (401 / 403)
- Verify device exists and is enabled in the identity registry
- Validate SAS token expiry and device clock synchronization
- Confirm certificate chain, thumbprint, or CA configuration
- Ensure correct device-to-identity mapping
- For Connectivity issues
- Ensure TLS 1.2 or later is enabled on device runtime
- Validate protocol compatibility (MQTT/AMQP/HTTPS)
- Check firewall or network restrictions for IoT endpoints
- For orovisioning issues
- Validate Device Provisioning Service scope ID and enrollment configuration
- Confirm correct attestation type (SAS/X.509/TPM)
- Review provisioning logs for assignment or registration failures
The best practices are to :
- Use unique identities per device
- Prefer X.509 certificates for production workloads
- Use Device Provisioning Service for large-scale automated onboarding
- Protect credentials using secure hardware (TPM/HSM where available)
- Minimize reliance on shared access policies for service operations
- Use Microsoft Entra ID for service-side authentication and RBAC
Please let us know if the response was helpful
Thank you