如何使用Jenkins上载到Azure Data Lake Storage Gen1? [英] How to use Jenkins to upload to Azure Data Lake Storage Gen1?

查看:77
本文介绍了如何使用Jenkins上载到Azure Data Lake Storage Gen1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了Jenkins的Windows Azure存储插件.但似乎它仅适用于Blob存储.有没有一种方法可以将文件从Jenkins上载到Azure Data Lake Storage Gen1?感谢您的帮助!

I found the Windows Azure Storage Plugin for Jenkins. But it seems that it works only with blob storage. Is there a way to upload files to Azure Data Lake Storage Gen1 from Jenkins ? Thanks for your help !

推荐答案

AFAIK当前没有Jenkins插件可以将文件从Jenkins上载到Azure Data Lake Storae Gen1.您可以使用Azure PowerShell或Azure CLI来满足您的要求.

AFAIK currently there is no Jenkins plugin to upload files to Azure Data Lake Storae Gen1 from Jenkins. You could use Azure PowerShell or Azure CLI to accomplish your requirement.

示例Azure PowerShell命令:

Sample Azure PowerShell command:

Import-AzDataLakeStoreItem -AccountName $dataLakeStorageGen1Name -Path "C:\sampledata\vehicle1_09142014.csv" -Destination $myrootdir\mynewdirectory\vehicle1_09142014.csv

示例Azure CLI命令:

Sample Azure CLI command:

az dls fs upload --account mydatalakestoragegen1 --source-path "C:\SampleData\AmbulanceData\vehicle1_09142014.csv" --destination-path "/mynewfolder/vehicle1_09142014.csv"

有关更多信息,请参见以下文章:

For more information, refer below articles:

https://docs.microsoft.com/zh-CN/azure/data-lake-store/data-lake-store-get-started-cli-2.0

https://docs.microsoft.com/zh-CN/powershell/module/az.datalakestore/import-azdatalakestoreitem?view = azps-1.5.0

要使这项工作正常进行,没有几个先决条件是:

Few pre-requisites to make this work without any issues are:

  1. 在运行命令的节点中已安装Azure PowerShell/Azure CLI.

  1. Have Azure PowerShell / Azure CLI installed in the node where you run the command(s).

按照此处的说明将Azure服务主体添加到Jenkins凭据->

Add Azure service principal to Jenkins credential as instructed here -> https://docs.microsoft.com/en-us/azure/jenkins/execute-cli-jenkins-pipeline#add-azure-service-principal-to-jenkins-credential

希望这会有所帮助!!干杯!

Hope this helps!! Cheers!!

这篇关于如何使用Jenkins上载到Azure Data Lake Storage Gen1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆