Last active
March 10, 2023 09:25
-
-
Save oliverlabs/c7b199860321e09d3637ad4df9b375e1 to your computer and use it in GitHub Desktop.
Create a Service Principal in Bash using Azure CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# export MSYS_NO_PATHCONV=1 | |
# Replace <subscription_id> with your Subscription ID. | |
# You can replace the <service-principal-name> with a custom name for your environment or omit the parameter entirely. | |
# If you omit the parameter, the service principal name is generated based on the current date and time. | |
# FOR AN OWNER ROLE: | |
# az ad sp create-for-rbac --scopes "/subscriptions/<subscription_id>" --role "Owner" --name <service_principal_name> | |
# FOR A CONTRIBUTOR ROLE: | |
az ad sp create-for-rbac --name <service_principal_name> --role Contributor --scopes /subscriptions/<subscription_id> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment