【问题标题】:ADF - Pipeline with powershell scriptADF - 带有 powershell 脚本的管道
【发布时间】:2019-05-12 05:25:08
【问题描述】:

我编写了一个小型 Powershell 脚本,以便从我的组织中检索一些信息并将其导出到 .csv 文件中:

Get-ADUser -Filter {company -Like "*COMPANYNAME*"} -Properties department | Select sAMAccountName, department, userprincipalname | export-csv -path C:\temp\test.csv

我的目标是在 Azure 数据工厂中创建一个管道,以便启动此脚本并将 csv 导出到数据集中,以便我可以获取 SQL Azure 中的所有数据。

如何创建管道并插入此脚本?

【问题讨论】:

  • 您好,我的回答对您有帮助吗?

标签: azure powershell csv azure-pipelines azure-data-factory


【解决方案1】:

基于这个feedback,Powershell Script目前还不能直接在adf管道中运行。也许你可以投票赞成这个帖子。

您可以从 document 配置 custom activity 来运行您的 ps 脚本,也可以按照 github tutorial 创建 c# 自定义活动。

【讨论】:

    【解决方案2】:

    您可以通过使用运行以下命令的自定义 Activity 创建 DataFactory 来运行 PowerShell 脚本:powershell .\script.ps1 您必须复制与您的自定义活动关联的 StorageAccount 中的 script.ps1。

    要复制活动输出,您可以关注此线程https://social.msdn.microsoft.com/Forums/en-US/5ceda984-874e-417b-8a28-7a512ede61d0/custom-activity-output-values-for-use-in-sequential-task?forum=AzureDataFactory,它对我有用。 并在这里找到一些额外的信息:Copy output data from Custom Activity Powershell script

    【讨论】:

    • 非常感谢 RuanoLin!
    猜你喜欢
    • 2017-10-10
    • 2015-03-20
    • 1970-01-01
    • 1970-01-01
    • 2021-12-24
    • 2021-09-22
    • 2022-01-20
    • 1970-01-01
    • 2023-01-25
    相关资源
    最近更新 更多