Skip to content

Commit 0e682c1

Browse files
author
Saveen Reddy
authored
Update data-lake-analytics-get-started-powershell.md
1 parent 2391635 commit 0e682c1

File tree

1 file changed

+13
-30
lines changed

1 file changed

+13
-30
lines changed

articles/data-lake-analytics/data-lake-analytics-get-started-powershell.md

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,19 @@ You must have a Data Lake Analytics account before you can run any jobs. To crea
6363
-ResourceGroupName $resourceGroupName `
6464
-Name $dataLakeAnalyticsName
6565

66-
## Upload data to Data Lake
67-
In this tutorial, you will process some search logs. The search log can be stored in either Data Lake store or Azure Blob storage.
66+
## Upload data to Data Lake Store
6867

69-
A sample search log file has been copied to a public Azure Blob container. Use the following PowerShell script to download the file to your workstation, and then upload the file to the default Data Lake Store account of your Data Lake Analytics account.
70-
71-
$dataLakeStoreName = "<The default Data Lake Store account name>"
72-
73-
$localFolder = "C:\Tutorials\Downloads\" # A temp location for the file.
74-
$storageAccount = "adltutorials" # Don't modify this value.
75-
$container = "adls-sample-data" #Don't modify this value.
76-
77-
# Create the temp location
78-
New-Item -Path $localFolder -ItemType Directory -Force
79-
80-
# Download the sample file from Azure Blob storage
81-
$context = New-AzureStorageContext -StorageAccountName $storageAccount -Anonymous
82-
$$blobs = Get-AzureStorageBlob -Container $container -Context $context
83-
$blobs | Get-AzureStorageBlobContent -Context $context -Destination $localFolder
84-
85-
# Upload the file to the default Data Lake Store account
86-
Import-AzureRmDataLakeStoreItem -AccountName $dataLakeStoreName -Path $localFolder"SearchLog.tsv" -Destination "/Samples/Data/SearchLog.tsv"
68+
```
69+
Import-AzureRmDataLakeStoreItem -AccountName $dataLakeStoreName -Path "D:\SearchLog.tsv" -Destination "/Samples/Data/SearchLog.tsv"
70+
```
8771

88-
The following PowerShell script shows you how to get the default Data Lake Store name for a Data Lake Analytics account:
72+
## Getting the Default Data Lake Store account for a Data Lake Analytics Account
8973

90-
$dataLakeAnalyticsAccount = Get-AzureRmDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $dataLakeAnalyticsName
91-
$dataLakeStoreName = $dataLakeAnalyticsAccount.Properties.DefaultDataLakeStoreAccount
92-
echo $dataLakeStoreName
74+
```
75+
$dataLakeAnalyticsAccount = Get-AzureRmDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $dataLakeAnalyticsName
76+
$dataLakeStoreName = $dataLakeAnalyticsAccount.Properties.DefaultDataLakeStoreAccount
77+
echo $dataLakeStoreName
78+
```
9379

9480
## Submit Data Lake Analytics jobs
9581
The Data Lake Analytics jobs are written in the U-SQL language. To learn more about U-SQL, see [Get started with U-SQL language](data-lake-analytics-u-sql-get-started.md) and [U-SQL language reference](http://go.microsoft.com/fwlink/?LinkId=691348).
@@ -119,7 +105,7 @@ USING Outputters.Csv();
119105
2. Run the following script:
120106

121107
```
122-
$usqlScript = "c:\tutorials\data-lake-analytics\copyFile.usql"
108+
$usqlScript = "c:\script.usql"
123109
124110
$job = Submit-AzureRmDataLakeAnalyticsJob -Name "convertTSVtoCSV" -AccountName $dataLakeAnalyticsName –ScriptPath $usqlScript
125111
@@ -128,20 +114,17 @@ Wait-AdlJob -Account $dataLakeAnalyticsName -JobId $job.JobId
128114
Get-AzureRmDataLakeAnalyticsJob -AccountName $dataLakeAnalyticsName -JobId $job.JobId
129115
```
130116

131-
In the script, the U-SQL script file is stored at c:\tutorials\data-lake-analytics\copyFile.usql. Update the file path accordingly.
132117

133118
After the job is completed, you can use the following cmdlets to list the file, and download the file:
134119

135120
```
136-
$destFile = "C:\tutorials\data-lake-analytics\SearchLog-from-Data-Lake.csv"
121+
$destFile = "c:\SearchLog-from-Data-Lake.csv"
137122
138123
$dataLakeStoreAccount = Get-AzureRmDataLakeAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $dataLakeAnalyticName
139-
140124
$dataLakeStoreName = $dataLakeStoreAccount.Properties.DefaultDataLakeAccount
141-
142125
Get-AzureRmDataLakeStoreChildItem -AccountName $dataLakeStoreName -path "/Output"
143-
144126
Export-AzureRmDataLakeStoreItem -AccountName $dataLakeStoreName -Path "/Output/SearchLog-from-Data-Lake.csv" -Destination $destFile
127+
145128
```
146129

147130
## See also

0 commit comments

Comments
 (0)