1

How to load .ps1 files from Azure Powershell to Azure data lake?

I have tried in my local machine (Powershell), there it is working fine.

while uploading it into the Azure Powershell, we are not able to fetch the exact location. And how do we create a file in Azure data lake using Azure Powershell?

James Z
  • 12,209
  • 10
  • 24
  • 44
pythonUser
  • 183
  • 2
  • 7
  • 20
  • What does `we are not able to fetch the exact location` mean? Is there any error information? If possible, please add the demo code. – Tom Sun - MSFT Oct 08 '18 at 08:59
  • After uploading the file into azure data lake store,not able to find the directory where the file got saved and there is no error while uploading for .ps1 files from Azure cloud shell(PowerShell).And how to create a file in Azure data lake using Azure Power Shell? – pythonUser Oct 09 '18 at 09:21

1 Answers1

1

If we want to create a file we could use Azure powershell command.

New-AzureRmDataLakeStoreItem -AccountName "AccountName" -Path "/NewFile.txt"

If we want to upload a local file to Azure data lake

Import-AzureRmDataLakeStoreItem -AccountName "ContosoADL" -Path "C:\SrcFile.csv" -Destination "/MyFiles/File.csv" -Concurrency 4

But before excute the command please make sure that you have permission to do that. How to assign the role to application or service principle, please refer to this tutorial.

For more Powershell command about data lake please refer to this document.

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47
  • Hello Tom Sun,How can we call powershell in Azure Data Factory.I have sample code which will split csv and I want to implement same in ADF.#initializing the value of I=0 $i=0; #ReadCount to read the the count of the number and making use of for each loop to output Get-Content C:\Users\dell\Desktop\Powershell\Input\bigsizeFile.csv -ReadCount 1000 | %{$i++; $_ | Out-File C:\Users\dell\Desktop\Powershell\Output\file$i.csv } Can you please help with this. This code works fine in my local system and I want the same code to be used in Azure powershell to run from Azure Data Factory – pythonUser Oct 09 '18 at 12:00