azure-data-factory - 通过 Web 活动使用 Azure 事件中心进行数据工厂 MSI 身份验证
问题描述
我正在尝试通过数据工厂的 Web 活动向事件中心发送消息。
我的数据工厂设置有系统分配的托管标识 (MSI),并且该标识已在事件中心命名空间 (RBAC / IAM) 上被赋予“Azure 事件中心数据发送者”角色。
Web活动设置如下:
{
"name": "Send to Event Hub",
"type": "WebActivity",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "https://<eventhubnamespace>.servicebus.windows.net/<eventhub>/messages?timeout=60&api-version=2014-01",
"method": "POST",
"body": {
"DeviceId": "dev-01",
"Temperature": "37.0"
},
"authentication": {
"type": "MSI",
"resource": "https://servicebus.azure.net"
}
}
}
不幸的是,该请求似乎总是未经授权的。Web 活动失败并显示以下消息:
{
"errorCode": "2108",
"message": "Invoking Web Activity failed with HttpStatusCode - 'Unauthorized'.",
"failureType": "UserError",
"target": "Event Hub",
"details": []
}
我还尝试根据发送事件 REST API docs指定 Content-Type 标头,但没有任何区别。
根据这篇文章,应该可以使用带有 OAuth2.0 Bearer 令牌的服务主体对事件中心进行身份验证。我的理解是 ADF 的 MSI 与服务主体没有什么不同,只是我不必自己管理机密和令牌。我错过了什么?
解决方案
推荐阅读
- reactjs - React,Graphql CRUD 应用程序 - 删除突变删除列表中的第一个
- android - 菜单模板在 Android Studio 中显示不正确
- sqlalchemy - SQLAlchemy 哈希函数
- linux - 告诉我们是否在 WSL 中运行 linux?
- php - 如何使用三元运算符检查资产存储是否为空
- cygwin - Cygwin - 找不到标题
- xcode - 无法分发 Mac Catalyst 扩展
- javascript - 如何在从父窗口调用的子窗口中设置输入文本值?
- json - 使用来自 rest.response 的值
- ruby-on-rails - rails ancestry 从根上获取所有最后的孩子