Before starting this procedure, do the following:
- See the Azure Documentation Center and search Create Service Principal. You will use the Azure documentation to complete the steps in this procedure using the Azure portal, Azure PowerShell, or Azure CLI.
- Request your Azure subscription administrator to assign the Contributor role.
You must create an Azure Active Directory application and the service principal as part of the node failure recovery process.
- Create the Azure Active Directory application.
- Create the service principal.
-
Assign the Contributor role to the service principal.
Login-AzureRmAccount ## List all the subscriptions Get-AzureRmSubscription Select-AzureRmSubscription -SubscriptionId your_subscription_id $app = New-AzureRmADApplication -DisplayName "{app-name}" -HomePage "https://{your-domain}/{app-name}" -IdentifierUris "https://{your-domain}/{app-name}" -Password "{your-password}" New-AzureRmADServicePrincipal -ApplicationId $app.ApplicationId New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName $app.ApplicationId.Guid $app.ApplicationId
where the ApplicationID is the client ID. The password you choose is the secret key for the service principal. The tenant and subscription IDs appear in the output.