Skip to content

Instantly share code, notes, and snippets.

View timwebster9's full-sized avatar

Tim Webster timwebster9

View GitHub Profile
@timwebster9
timwebster9 / New-CloneServicePrincipal.sh
Last active July 23, 2020 14:20 — forked from MarkWarneke/New-CloneServicePrincipal.sh
Create a Clone Service Principal https://markwarneke.me/2020-04-02-Clone-AzureAd-Service-Principal/ you can run the following automation steps. Make sure the authenticated user executing the steps has at least the Application Administrator Azure AD role - as this role is needed for the last step to grant permissions.
#!/usr/bin/env bash
# Name of the Clone Service Principal
appName="CloneServicePrincipal"
# Retrieve the teannt it
tenantId=$(az account show --query tenantId -o tsv)
# Create the Clone Service Principal
appId=$(az ad app create --display-name $appName --query appId -o tsv)