Skip to content

Instantly share code, notes, and snippets.

@cwoolum
Last active January 6, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwoolum/0a81de57dbdf3d5482d8f2a5c69e7da8 to your computer and use it in GitHub Desktop.
Save cwoolum/0a81de57dbdf3d5482d8f2a5c69e7da8 to your computer and use it in GitHub Desktop.
AKS-Deploy Part 1
echo Enter the name of the environment you would like to create
read envName
serverApplicationSecret="$(openssl rand -base64 30)"
serverApplicationId="$(az ad app create --display-name kube-aad-server-$envName --identifier-uris "https://kube-aad-server-$envName" --end-date "2050-1-1" --password $serverApplicationSecret --query appId -o tsv)"
az ad app update --id $serverApplicationId --set groupMembershipClaims=All
az ad app permission add --id $serverApplicationId --api 00000003-0000-0000-c000-000000000000 --api-permissions e1fe6dd8-ba31-4d61-89e7-88639da4683d=Scope 06da0dbc-49e2-44d2-8312-53f166ab848a=Scope 7ab1d382-f21e-4acd-a863-ba3e13f7da61=Role
az ad app permission grant --id $serverApplicationId --api 00000003-0000-0000-c000-000000000000
oAuthPermissionId="$(az ad app show --id $serverApplicationId --query "oauth2Permissions[0].id" -o tsv)"
clientApplicationId="$(az ad app create --display-name kube-aad-client-$envName --native-app --reply-urls https://kube-aad-client-$envName --query appId -o tsv)"
az ad app permission add --id $clientApplicationId --api $serverApplicationId --api-permissions $oAuthPermissionId=Scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment