Azure Python SDK管道JSON序列化问题:缺失DataFlow信息
解决Azure Data Factory管道JSON数据缺失dataflow节点的问题
问题根源:
list_by_factory方法返回的是管道的精简元数据,为了提升列表查询性能,不会包含完整的activity配置细节(比如typeProperties里的dataflow节点)。解决方案:遍历管道列表时,对每个管道调用
get方法获取完整定义:from azure.mgmt.datafactory import DataFactoryManagementClient client = DataFactoryManagementClient(cred, sub_id) pipelines = client.pipelines.list_by_factory(fac_resource_group_name, fac_name) for pipeline in pipelines: # 调用get方法拉取完整管道配置 full_pipeline = client.pipelines.get( fac_resource_group_name, fac_name, pipeline.name ) # 此时输出的activities会包含完整的typeProperties及dataflow节点 print(full_pipeline.serialize()["properties"]["activities"])补充说明:
get方法会从Azure API获取该管道的完整配置信息,和Azure门户上展示的内容完全一致,能满足你提取typeProperties中dataflow及其组成部分的需求。
内容的提问来源于stack exchange,提问作者Nicholas Franz
相关产品推荐
相关产品推荐

