简体   繁体   English

如何使用 .NET 数据工厂 ZF20E3C5E54C0893D36 启用 DeVOPS GIT 存储库在 Azure 数据工厂中发布管道?

[英]How to publish pipeline in Azure Data Factory enabled with DeVOPS GIT repo using .NET Data Factory SDK (C# )?

I'm facing some issue in deploying the pipeline to Data Factory with GIT enabled (DevOps) and need someone help or advise on that.在启用 GIT (DevOps) 的情况下,我在将管道部署到数据工厂时遇到了一些问题,需要有人帮助或建议。

When I deploy the pipeline through below code snippet its deploying into Data Factory Repo but instead we need to publish the code to Azure DevOps GIT Repo.当我通过下面的代码片段部署管道时,它会部署到数据工厂存储库中,但我们需要将代码发布到 Azure DevOps GIT 存储库。

Below is a code snippet used to publish pipeline to ADF using .NET Data Factory SDK (C#)下面是用于使用 .NET 数据工厂 SDK (C#) 将管道发布到 ADF 的代码片段

// Authenticate and create a data factory management client // 认证并创建数据工厂管理客户端

var context = new AuthenticationContext("https://login.windows.net/" + tenantID);
ClientCredential cc = new ClientCredential(applicationId, AuthenticationKey);
AuthenticationResult result = context.AcquireTokenAsync("https://management.azure.com/", cc).Result;
ServiceClientCredentials cred = new TokenCredentials(result.AccessToken);
DataFactoryManagementClient client = new DataFactoryManagementClient(cred) { SubscriptionId = subscriptionId,  };

// Below snippet deploys pipeline into data factory Repo // 下面的代码片段将管道部署到数据工厂 Repo

client.Pipelines.CreateOrUpdate(resourceGroup, dataFactoryName, pipelineName, pipeline);

But now we need to publish this pipeline code to master branch for the DevOps GIT enabled in our ADF.但是现在我们需要将此管道代码发布到我们 ADF 中启用的 DevOps GIT 的 master 分支。

Below is one code snippet I found but not sure how to set this object to data factory in deploying the pipeline to DevOps GIT.下面是我找到的一个代码片段,但不确定如何将此 object 设置为数据工厂,以将管道部署到 DevOps GIT。

FactoryRepoConfiguration repo = new FactoryVSTSConfiguration("account Name", "Repo name", "branch name", "/", "project name");

I have gone through many blogs but didn't find any help on that.我浏览了很多博客,但没有找到任何帮助。

So could someone please help me on this?那么有人可以帮我解决这个问题吗?

If i don't misunderstanding your requirement,you just wanna implement below creation with sdk code as same as portal(This is just sample project,no security for it then):如果我没有误解您的要求,您只想使用与门户相同的 sdk 代码实现以下创建(这只是示例项目,因此没有安全性):

在此处输入图像描述

In fact, you are very close to your goal because you already found FactoryRepoConfiguration Class.事实上,您已经非常接近您的目标,因为您已经找到FactoryRepoConfiguration Class。 Please refer to the document ,you could define 2 types of Repo: VSTS and Github .请参考文档,您可以定义两种类型的 Repo: VSTSGithub

在此处输入图像描述

I tested Github for your reference:我测试Github供您参考:

在此处输入图像描述

As per Microsoft's feedback there is no SDK which can publish code directly into a GIT branch in ADF.根据微软的反馈,没有 SDK 可以将代码直接发布到 ADF 中的 GIT 分支中。

I have posted an idea in ADF forums to implement the same and below is the link.我在 ADF 论坛上发布了一个实现相同的想法,下面是链接。 If anyone have a same requirements request to up vote the posted idea in below link.如果有人有相同的要求,请在下面的链接中对发布的想法进行投票。

https://feedback.azure.com/forums/270578-data-factory/suggestions/40195249-implement-a-net-sdk-to-publish-pipeline-code-to-a https://feedback.azure.com/forums/270578-data-factory/suggestions/40195249-implement-a-net-sdk-to-publish-pipeline-code-to-a

Thanks.谢谢。

There is another approach to publish ADF, from master (collaboration) branch or even from your local machine (if needed).还有另一种发布 ADF 的方法,从主(协作)分支,甚至从您的本地计算机(如果需要)。 With that approach, you can develop your ADF using your .NET framework and when all files ready - publish them into ADF service.通过这种方法,您可以使用 .NET 框架开发您的 ADF,并在所有文件准备就绪后 - 将它们发布到 ADF 服务中。
Check this out: azure.datafactory.tools (PowerShell module)看看这个: azure.datafactory.tools (PowerShell模块)

暂无
暂无

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

相关问题 如何使用C#.net SDK在数据工厂管道中创建kusto活动 - How to create a kusto activity in data factory pipeline using c# .net sdk .net 核心:如何从C#代码传递参数并运行Azure数据工厂流水线? - .net Core : How to pass parameters and run Azure data factory pipeline from C# Code? 使用 .net sdk 在 Azure 数据工厂 V2 中重新运行活动 - Rerun activity in Azure Data Factory V2 using .net sdk 如何在Data Factory管道中将路由传递到Azure函数(C#)http触发器? - How to pass a route to Azure function (C#) http trigger in Data Factory pipeline? 如何从 C# 代码调用 Azure 数据工厂管道? - How can I invoke an Azure Data Factory pipeline from C# code? Azure数据工厂动态复制活动,使用C#.NET在源和目标中包含多个表 - Azure Data Factory dynamic Copy Activity with multiple tables in source and destination using C# .NET Azure 数据工厂管道的 copyActivity 中 TabularTranslator(源和接收器列的映射)的 c# 代码 - c# code for TabularTranslator (Mapping of source and sink columns) in copyActivity of an Azure Data factory pipeline 批处理管道在 azure 数据工厂中不起作用 - Batch pipeline is not working in azure data factory 如何在.NET SDK中为Azure数据工厂自动创建数据集? - How do you automate the creation of a dataset within the .NET SDK for Azure Data Factory? 如何在C#数据工厂中创建长时间运行的一次性管道 - How can I create a one time pipeline run with a long delay in c# data factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM