Database Reference
In-Depth Information
Running the MapReduce Job
Just before running the job, you need to upload the input file Numbers.txt to the storage account. Here is the content
of a sample input file:
100
200
300
400
500
Use the PowerShell script shown in Listing 5-5 to upload the file to your blob container.
Listing 5-5. Using PowerShell to upload a file
$subscriptionName = "Your_Subscription_Name"
$storageAccountName = "democluster"
$containerName = "democlustercontainer"
#This path may vary depending on where you place the source .csv files.
$fileName ="C:\Numbers.txt"
$blobName = "\example\data\Numbers.txt"
# Get the storage account key
Select-AzureSubscription $subscriptionName
$storageaccountkey = get-azurestoragekey $storageAccountName | %{$_.Primary}
# Create the storage context object
$destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey
$storageaccountkey
# Copy the file from local workstation to the Blob container
Set-AzureStorageBlobContent -File $fileName -Container $containerName
-Blob $blobName -context $destContext
On successful execution, you should see output similar to the following:
Container Uri:
https://democluster.blob.core.windows.net/democlustercontainer
Name BlobType Length ContentType LastModified SnapshotTime
---- -------- ------ ----------- ------------ ------------
/example/d... BlockBlob 23 applicatio... 12/9/2013 ...
You can also verify that the file exists in your blob container through the Azure Management portal,
as shown in Figure 5-3 .
Figure 5-3. Numbers.txt uploaded in blob
 
Search WWH ::




Custom Search