Instead of SDK am directly calling azure iot provisioning rest api to enroll device and then register it.
Enroll call to rest api works fine but register call fails with error
""Authorization required, resend request using supplied key""
- gives me keyname and authenticationkey in error response.
I intercepted using fiddler how sdk makes register call and noted that sdk first gets 401 with above error and then it reissues another request which succeeds.
Currently am generating sas token based on shared keyname and primary key of azure dps.
I have windows app which will call this webapi to enroll+register the device in one call. I pass registrationid, tpmendoresmentkey, storagekey to api. This api internally makes 2 httpclient calls to azure rest api :
- to enroll the device as individual enrollment.
- to register device
Please help with any ideas or pointers that help understand resolve it.