[英]How to use Jenkins to upload to Azure Data Lake Storage Gen1?
I found the Windows Azure Storage Plugin for Jenkins. 我找到了Jenkins的Windows Azure存储插件。 But it seems that it works only with blob storage.
但它似乎只适用于blob存储。 Is there a way to upload files to Azure Data Lake Storage Gen1 from Jenkins ?
有没有办法从Jenkins上传文件到Azure Data Lake Storage Gen1? Thanks for your help !
谢谢你的帮助 !
AFAIK currently there is no Jenkins plugin to upload files to Azure Data Lake Storae Gen1 from Jenkins. AFAIK目前没有Jenkins插件可以将文件从Jenkins上传到Azure Data Lake Storae Gen1。 You could use Azure PowerShell or Azure CLI to accomplish your requirement.
您可以使用Azure PowerShell或Azure CLI来完成您的要求。
Sample Azure PowerShell command: 示例Azure PowerShell命令:
Import-AzDataLakeStoreItem -AccountName $dataLakeStorageGen1Name -Path "C:\sampledata\vehicle1_09142014.csv" -Destination $myrootdir\mynewdirectory\vehicle1_09142014.csv
Sample Azure CLI command: 示例Azure CLI命令:
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/en-us/azure/data-lake-store/data-lake-store-get-started-powershell#upload-data-to-your-data-lake-storage-gen1-account https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-get-started-powershell#upload-data-to-your-data-lake-storage-gen1-帐户
https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-get-started-cli-2.0 https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-get-started-cli-2.0
https://docs.microsoft.com/en-us/powershell/module/az.datalakestore/import-azdatalakestoreitem?view=azps-1.5.0 https://docs.microsoft.com/en-us/powershell/module/az.datalakestore/import-azdatalakestoreitem?view=azps-1.5.0
https://docs.microsoft.com/en-us/cli/azure/dls/fs?view=azure-cli-latest#az-dls-fs-upload https://docs.microsoft.com/en-us/cli/azure/dls/fs?view=azure-cli-latest#az-dls-fs-upload
Few pre-requisites to make this work without any issues are: 没有任何问题使这项工作的先决条件很少:
Have Azure PowerShell / Azure CLI installed in the node where you run the command(s). 在运行命令的节点中安装Azure PowerShell / Azure CLI。
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 按照此处的说明将Azure服务主体添加到Jenkins凭证 - > https://docs.microsoft.com/en-us/azure/jenkins/execute-cli-jenkins-pipeline#add-azure-service-principal-to-jenkins-凭据
Hope this helps!! 希望这可以帮助!! Cheers!!
干杯!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.