We are encountering issues while attempting to register devices using an enrollment group in Azure IoT Device Provisioning Service (DPS) with symmetric key authentication. Despite following all the documented steps, the device registration fails with an HTTP 401 Unauthorized error (errorCode: 401002).
Here’s a summary of our setup and the steps taken:
DPS Configuration:
- Attestation Mechanism: Symmetric Key.
Device Details:
- Registration ID is explicitly set in the curl request and aligns with the enrollment group settings.
**Steps Taken**:
- Generated a SAS token using the primary key and the following formula:
php
Copy code
SharedAccessSignature sr=<resourceUri>&sig=<generatedSignature>&se=<expiry>
Example SAS Token:
php
Copy code
SharedAccessSignature sr=<scope>/registrations/<registrationId>&sig=<signature>&se=<expiry>
- Used curl to send a PUT request to:
```
bash
Copy code
https://global.azure-devices-provisioning.net/<scope>/registrations/<registrationId>/register?api-version=2019-03-31
```
- Headers included:
- `Content-Type: application/json`
- `Authorization: SharedAccessSignature sr=<resourceUri>&sig=<generatedSignature>&se=<expiry>`
- Payload:
```
json
Copy code
{"registrationId":
```
**Observed Behavior**:
- The DPS endpoint resolves successfully, and the request is sent without connection issues.
- However, the response is consistently:
```
json
Copy code
{
```
**Troubleshooting Steps**:
- Verified network connectivity to `global.azure-devices-provisioning.net`.
- Confirmed the primary key and registration ID are correct.
- Regenerated the primary key and retried the process.
- Used multiple tools (curl, PowerShell) for manual testing.
- Verified that the enrollment group settings in DPS are correctly configured.
- Referenced Azure documentation and community forums for guidance.
```---
Request for Support
- Can you help identify why the registration is failing with
401 Unauthorized?
- Are there additional configuration steps or settings that we may have overlooked?
- Could you assist in analyzing the issue using the
trackingId provided in the error response?
We can provide additional logs or screenshots as needed. Thank you!We are encountering issues while attempting to register devices using an enrollment group in Azure IoT Device Provisioning Service (DPS) with symmetric key authentication. Despite following all the documented steps, the device registration fails with an HTTP 401 Unauthorized error (errorCode: 401002).
Here’s a summary of our setup and the steps taken:
DPS Configuration:
- Attestation Mechanism: Symmetric Key.
Device Details:
- Registration ID is explicitly set in the curl request and aligns with the enrollment group settings.
**Steps Taken**:
- Generated a SAS token using the primary key and the following formula:
php
Copy code
SharedAccessSignature sr=<resourceUri>&sig=<generatedSignature>&se=<expiry>
Example SAS Token:
php
Copy code
SharedAccessSignature sr=<scope>/registrations/<registrationId>&sig=<signature>&se=<expiry>
- Used curl to send a PUT request to:
```
bash
Copy code
https://global.azure-devices-provisioning.net/<scope>/registrations/<registrationId>/register?api-version=2019-03-31
```
- Headers included:
- `Content-Type: application/json`
- `Authorization: SharedAccessSignature sr=<resourceUri>&sig=<generatedSignature>&se=<expiry>`
- Payload:
```
json
Copy code
{"registrationId":
```
**Observed Behavior**:
- The DPS endpoint resolves successfully, and the request is sent without connection issues.
- However, the response is consistently:
```
json
Copy code
{
```
**Troubleshooting Steps**:
- Verified network connectivity to `global.azure-devices-provisioning.net`.
- Confirmed the primary key and registration ID are correct.
- Regenerated the primary key and retried the process.
- Used multiple tools (curl, PowerShell) for manual testing.
- Verified that the enrollment group settings in DPS are correctly configured.
- Referenced Azure documentation and community forums for guidance.
```---
Request for Support
- Can you help identify why the registration is failing with
401 Unauthorized?
- Are there additional configuration steps or settings that we may have overlooked?
- Could you assist in analyzing the issue using the
trackingId provided in the error response?
We can provide additional logs or screenshots as needed. Thank you!