Setting Up Credentials for Microsoft Azure Data Collection
To setup credentials for Azure data collection:
Install the Azure PowerShell Client on a Windows Computer
Use the Azure with Windows PowerShell to access the information required for data collection. You must execute Windows PowerShell as administrator.
To install the Azure with Windows PowerShell
1.
Navigate to http://go.microsoft.com/fwlink/p/?linkid=320376&clcid=0x409 2. Install and at the prompt enter the following to import modules:
Install-Module PowerShellGet -Force
Install-Module -Name AzureRM -AllowClobber
Import-Module -Name AzureRM
Find Your Tenant and Subscription ID
1. Execute Azure Windows PowerShell as an administrator.
2. Log into your Azure account:
Login-AzureRMAccount
3. View the Tenant ID and Subscription ID in the output:
Get-AzureRmSubscription
Register a New Application for the Data Collector
Azure requires a new Application be registered before you can interact with it.
To register a new Application for the Data Collector
You must be logged into your account within Microsoft Azure PowerShell. The following steps are performed at the Microsoft Azure PowerShell prompt.
1. Set the context using your Tenant ID and Subscription ID by entering:
Set-AzureRMContext -SubscriptionId <SUBSCRIPTIONID> -TenantId <TENANTID>
2. Set the Password in a SecureString:
$securePwd = ConvertTo-SecureString "<PASSWORD>" -AsPlainText -Force
3. Revise the DisplayName, Hostname, and Azure Default Directory. Copy/paste the following at the prompt:
Note: Azure Default Directory can be found in your Azure account under Subscription > Overview.
$azureAdApplication = New-AzureRmADApplication -DisplayName "<DISPLAYNAME>" -HomePage "https://<HOSTNAME>.<AZURE-DEFAULT-DIRECTORY>" -IdentifierUris "https://<HOSTNAME>.<AZURE-DEFAULT-DIRECTORY>" -Password $securePwd -AvailableToOtherTenants $true
4. Enter the following to display your application parameters:
$azureAdApplication
5. Write down the Subscription ID, Tenant ID, Application ID, and the Password you chose. The Application ID is displayed in the output.The Data Collector requires those four parameters.
Create a Principal and Assign Contributor Role to the Application
This step enables the newly registered Application to have access rights to the Subscription.
1. Create a Principal for the Application:
New-AzureRmADServicePrincipal -ApplicationId <APPLICATIONID>
2. Create a Contributor role:
New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName <APPLICATIONID>