Log in with Azure CLI ```bash az login ``` Preview the list of associated subscriptions ```bash az account list ``` Gather Subscription `id` and point to the target Subscription ```bash az account set --subscription="<ID-GOES-HERE>" ``` Create Service Principal with Permissions to manage resources in selected subscription ```bash az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/00000000-0000-0000-0000-000000000000" --name "EAAS PROJECT" ``` Example output: ```bash $ az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" Creating 'Contributor' role assignment under scope '/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli "appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "displayName": "example", "password": "XXX", "tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" } ``` ### See Also 1. [[What is Service Principal?]] 2. [[Azure Subscription]] 3. [[Azure CLI]]