Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.04 KB

how-to-create-azure-service-principal.md

File metadata and controls

34 lines (25 loc) · 1.04 KB

How to Create Azure Service Principal

Open the Azure Cloud Shell and select Bash.

Run the az account show command and make sure Azure Subscription you selected is your intended choice.

az account show

Run the az ad sp create-for-rbac command to create a new Service Principal.
After that, you should save the credential generated and outputted on the console.

az ad sp create-for-rbac --name=provisioning-owner\
 --role="Owner"\
 --scopes=/subscriptions/$(az account show --query='id' --output=tsv)
{
  "appId": "xxxxxxxx-0000-0000-0000-xxxxxxxxxxxx",
  "displayName": "provisioning-owner",
  "password": "********",
  "tenant": "zzzzzzzz-0000-0000-0000-zzzzzzzzzzzz"
}

References