繁体   English   中英

有没有Azure 数据工厂活动获取宇宙收藏列表?

[英]Is there any Azure Data factory activity to get cosmos collection list?

Azure 数据工厂中是否有任何选项可以了解 Azure cosmos 帐户中特定数据库中可用的 collections 列表?

想要执行特定活动 - 每次执行 Azure 数据工厂管道时,它都会返回 cosmos db 中的 collections 列表。

确切要求:想要从 cosmos db 中复制所有 collections 的数据,但 cosmos db 中的 collections 列表可能会随着时间的推移而变化。 如果已将任何新集合添加到 cosmos db,则需要将该新集合动态地视为复制活动的一部分,而无需任何外部干预。

While using Azure function activity in Azure Data factory to query the list of cosmos collection, it returns output like the below,

{
"Response": "[{\"source\": 
 {\"collectionName\":\"model1\"},\"destination\": 
 {\"fileName\":\"model1.txt\"}},{\"source\": 
{\"collectionName\":\"model2\"},\"destination\": 
{\"fileName\":\"model2.txt\"}}]"
}

预期 output

{
"Response": [
    {
     source:{collectionName:model1},
     destination: {fileName:model1.txt}
    },
  {
  source:{collectionName:model2},
  destination:{fileName:model2.txt}}]
  }
 ]
}

为什么 Azure function 活动将数组 object 作为字符串返回?

ps:当我运行 azure function 与 V22017 或 azure 门户网站时,它返回数组 ZC1C4269689ACFZDC496269668EBFZDC4

我不确定是否存在直接方法,但对于解决方法,您可以

  1. 对 API 进行 HTTP 调用, 获取 Collections 的列表 拨打 REST API 电话将确保您始终拥有最新数据。
  1. 解析 JSON 响应以获取 collections。 随后可能是 For-Each 活动。

编辑-在答案的评论中添加讨论

  1. 制作一个 Http 触发器 function 可以由 Web 活动调用。
  2. 获取function里面的AAD令牌
  3. 调用 REST Api 获取宇宙列表 collections
  4. 返回 json-array 作为响应
  5. 在 ADF 中添加一个 For-each 活动以遍历 collections 列表。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM