From 42f85577618ee1f4c4fee8de5656225ce031a453 Mon Sep 17 00:00:00 2001 From: Jean-Benoit Paux <9682558+jbpaux@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:18:03 +0100 Subject: [PATCH] Fix routine to find AD domain name When user login is @live.com @hotmail.com the domain used in these commands were using these logins. Instead it should use the @accountlive.onmicrosoft.com or @accounthotmail.onmicrosoft.com The change here find the correct domain name using the user UPN retrieved directly in Azure AD which is something like "account_live.com#EXT#@accountlive.onmicrosoft.com" --- byos/containers/deploy/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/byos/containers/deploy/deploy.sh b/byos/containers/deploy/deploy.sh index 9b3224c..1849bb6 100755 --- a/byos/containers/deploy/deploy.sh +++ b/byos/containers/deploy/deploy.sh @@ -271,7 +271,7 @@ fi if "$createAdUsers"; then if [[ -z "$azureUserName" ]]; then - azureUserName=$(az account show --query user.name -o tsv) + azureUserName=$(az ad signed-in-user show --query 'userPrincipalName' -o tsv ) fi domain=$(cut -d "@" -f 2 <<< $azureUserName)