An Azure service principal is a security identity used by applications, services, and automation tools to access designated Azure resources. The service principal is a ‘user identity’ (username and password) with an assigned role/permissions in Azure Active Directory (AAD). The service principal should only need to do specific things, unlike a general user identity. In this example, a new Service Principal will be created in AAD and assigned to an Azure Resource Group. Read here for the steps to register a new Service Principal using the Azure ARM Portal

Using PowerShell

1. #Login to Azure Subscription

2. #Declare Variables

3. Create the Azure Active Directory Application

4. #Create the service principal for the new Azure AD Application

5. #Assign the Service Principal the Contributor Role

6. #Login to Azure Subscription Using the new Service Principal

In the Azure portal, the Login Service Principal is listed in the Azure Active Directory App Registrations: