Database Reference
In-Depth Information
You should see a message in the PowerShell prompt about setting your default subscription. The message will be
similar to the following:
VERBOSE:Setting: <subscription_name> as the default and current subscription. To view other
subscriptions use Get-AzureSubscription
Next, execute the
Get-AzureSubscription
command to list your subscription details as shown next. Note the
thumbprint that is generated—you will be using this thumbprint further throughout your .NET solution:
PS C:\> Get-AzureSubscription
SubscriptionName : <subscription_name>
SubscriptionId : <subscription_Id>
ServiceEndpoint :
https://management.core.windows.net/
ActiveDirectoryEndpoint :
ActiveDirectoryTenantId :
IsDefault : True
Certificate : [Subject]
CN=Windows Azure Tools
[Issuer]
CN=Windows Azure Tools
[Serial Number]
793EE9285FF3D4A84F4F6B73994F3696
[Not Before]
12/4/2013 11:45:00 PM
[Not After]
12/4/2014 11:45:00 PM
[Thumbprint] <Thumbprint>
CurrentStorageAccountName :
CurrentCloudStorageAccount :
ActiveDirectoryUserId :
Once this is done, you are ready to code your Visual Studio application.
â–
the
.publishsettings
file contains sensitive information about your subscription and credentials. Care should
be taken to prevent unauthorized access to this file. it is highly recommended that you delete this file once it is imported
successfully into powershell.
Note
Coding the Application
In your
HadoopClient
solution, add a new class to your project and name it
Constants.cs
. There will be some
constant values, such as the subscriptionID, certificate thumbprint, user names, passwords, and so on. Instead of
writing them again and again, we are going to club these values in this class and refer to them from our program.
Listing 4-1 shows the code in the
Constants.cs
file.