通过其余部分使用Azure DPS创建IoT设备 [英] Creating IoT device with Azure DPS via rest

查看:74
本文介绍了通过其余部分使用Azure DPS创建IoT设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个REST API可以与设备供应服务一起使用.

I've found a rest api to work with device provisioning service.

我创建了一个单独的注册,以创建一个与我的DPS IoT中心相关联的具有SaS身份验证的IoT设备.当我尝试使用https://docs.microsoft.com/en-us/rest/api/iot-dps/getindividualenrollment/getindividualenrollment时,我遇到了问题 具有授权:

I've created indyvidual enrolment to create an IoT device with SaS authentication on associated with my DPS IoT Hub. When I try to use https://docs.microsoft.com/en-us/rest/api/iot-dps/getindividualenrollment/getindividualenrollment I have a problem with Authorization:

{
    "errorCode":401002,
    "trackingId":"de436235-c3c1-48c7-86aa-ab8fdb5db270",
    " message":无效的授权标头",
    " timestampUtc" ;:" 2019-01-20T17:46:34.0267552Z"
}

{
    "errorCode": 401002,
    "trackingId": "de436235-c3c1-48c7-86aa-ab8fdb5db270",
    "message": "Invalid authorization header",
    "timestampUtc": "2019-01-20T17:46:34.0267552Z"
}

我使用了全部" Ive可以找到用于生成承载的方法,即:https://blog.jongallant.com/2017/11/azure-rest-apis-postman/或使用C#API,无论我每次使用的生成令牌是什么有这个消息.有人可以帮我吗? 通过IoT DPS授权我的REST调用的正确方法是什么?

I've used "all" methods for bearer generation Ive could find, ie: https://blog.jongallant.com/2017/11/azure-rest-apis-postman/ or use an C# api, whatever generated token I'm using each time I have this message. Can someone help me with that? What is a correct way to Authorize my REST call against IoT DPS?

推荐答案

Hello Pawel,

Hello Pawel,

我和您有同样的问题.请允许我花一些时间在内部进行研究.

I am having the same issue as you. Please allow me some time to research this internally.

您可以利用Azure Iot SDK C#作为变通方法吗? https://github.com/Azure/azure-iot-sdk-csharp/tree/master/provisioning/service/samples

Can you leverage azure iot sdk C# as a workaround? https://github.com/Azure/azure-iot-sdk-csharp/tree/master/provisioning/service/samples

谢谢


这篇关于通过其余部分使用Azure DPS创建IoT设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆