From 4be643034184791296edb28691388bcb1e0cbdca Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Wed, 19 Jan 2022 13:18:18 -0800 Subject: [PATCH 01/15] Generate token for aad app. --- eng/common/scripts/Generate-AddToken.ps1 | 108 +++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 eng/common/scripts/Generate-AddToken.ps1 diff --git a/eng/common/scripts/Generate-AddToken.ps1 b/eng/common/scripts/Generate-AddToken.ps1 new file mode 100644 index 000000000..71bf1c987 --- /dev/null +++ b/eng/common/scripts/Generate-AddToken.ps1 @@ -0,0 +1,108 @@ +<# +.DESCRIPTION +Generate aadToken for Azure Directory app. +.PARAMETER TenantId +The aad tenant id/Directory ID. +.PARAMETER ClientId +The aad client id/application id. +.PARAMETER ClientSecret +The client secret generates from add. +.PARAMETER Resource +The App ID URI of the web service. +E.g. https://graph.windows.net/ +.PARAMETER Scope +The full scope string defining the requested permissions. +.PARAMETER GrantType +OAuth defines four grant types: authorization code, implicit, +resource owner password credentials, and client credentials. +.PARAMETER ContentType +Content type of http requests. +.PARAMETER AdditionalHeaders +Additional parameters for http request headers in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} +.PARAMETER AdditionalBody +Additional parameters for http request body in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} +.PARAMETER TestMode + +#> +[CmdletBinding(SupportsShouldProcess = $true)] +param( + [Parameter(Mandatory = $true)] + [string]$TenantId, + + [Parameter(Mandatory = $true)] + [string]$ClientId, + + [Parameter(Mandatory = $true)] + [string]$ClientSecret, + + [Parameter(Mandatory = $false)] + [string]$Resource, + + [Parameter(Mandatory = $false)] + [string]$Scope, + + [Parameter(Mandatory = $false)] + [string]$GrantType = "client_credentials", + + [Parameter(Mandatory = $false)] + [string]$ContentType = "application/x-www-form-urlencoded", + + [Parameter(Mandatory = $false)] + [hashtable]$AdditionalHeaders, + + [Parameter(Mandatory = $false)] + [hashtable]$AdditionalBody, + + [Parameter(Mandatory = $false)] + [switch]$TestMode +) +. "${PSScriptRoot}\logging.ps1" + +$LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token" + +$Headers = @{ + content_type = $ContentType +} + +$Body = @{ + grant_type = $GrantType + client_id = $ClientId + client_secret = $ClientSecret +} + +function Load-RequestHeaders() { + if ($AdditionalHeaders) { + return $Headers + $AdditionalHeaders + } + return $Headers +} + +function Load-RequestBody() { + if ($Resource) { + $Body.Add("resource", $Resource) + } + if ($Scope) { + $Body.Add("scope", $Scope) + } + if ($AdditionalBody) { + return $Body + $AdditionalBody + } + return $Body +} + +try { + $headers = Load-RequestHeaders + $body = Load-RequestBody + $resp = Invoke-RestMethod $LoginAPIBaseURI -Method 'POST' -Headers $headers -Body $body +} +catch { + LogError $PSItem.ToString() + exit 1 +} + +$resp | Write-Verbose + +return $resp.access_token + + + \ No newline at end of file From 9a7fdaf0da5e229f3b2010c0de98de3548bad613 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Wed, 19 Jan 2022 13:23:39 -0800 Subject: [PATCH 02/15] Remove testing mode --- eng/common/scripts/Generate-AddToken.ps1 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/eng/common/scripts/Generate-AddToken.ps1 b/eng/common/scripts/Generate-AddToken.ps1 index 71bf1c987..6f6e01227 100644 --- a/eng/common/scripts/Generate-AddToken.ps1 +++ b/eng/common/scripts/Generate-AddToken.ps1 @@ -1,6 +1,6 @@ <# .DESCRIPTION -Generate aadToken for Azure Directory app. +Generate aadToken for Azure Directory app using client secrets. .PARAMETER TenantId The aad tenant id/Directory ID. .PARAMETER ClientId @@ -51,10 +51,7 @@ param( [hashtable]$AdditionalHeaders, [Parameter(Mandatory = $false)] - [hashtable]$AdditionalBody, - - [Parameter(Mandatory = $false)] - [switch]$TestMode + [hashtable]$AdditionalBody ) . "${PSScriptRoot}\logging.ps1" @@ -103,6 +100,3 @@ catch { $resp | Write-Verbose return $resp.access_token - - - \ No newline at end of file From 89492894f96d1d46b39b94ecd5115a0accd7718b Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Wed, 19 Jan 2022 13:36:39 -0800 Subject: [PATCH 03/15] Update Generate-AddToken.ps1 --- eng/common/scripts/Generate-AddToken.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Generate-AddToken.ps1 b/eng/common/scripts/Generate-AddToken.ps1 index 6f6e01227..b1a8bf070 100644 --- a/eng/common/scripts/Generate-AddToken.ps1 +++ b/eng/common/scripts/Generate-AddToken.ps1 @@ -1,28 +1,35 @@ <# .DESCRIPTION Generate aadToken for Azure Directory app using client secrets. + .PARAMETER TenantId The aad tenant id/Directory ID. + .PARAMETER ClientId The aad client id/application id. + .PARAMETER ClientSecret The client secret generates from add. + .PARAMETER Resource The App ID URI of the web service. E.g. https://graph.windows.net/ + .PARAMETER Scope The full scope string defining the requested permissions. + .PARAMETER GrantType OAuth defines four grant types: authorization code, implicit, resource owner password credentials, and client credentials. + .PARAMETER ContentType Content type of http requests. + .PARAMETER AdditionalHeaders Additional parameters for http request headers in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} + .PARAMETER AdditionalBody Additional parameters for http request body in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} -.PARAMETER TestMode - #> [CmdletBinding(SupportsShouldProcess = $true)] param( From a51e5c4ca6397145f886fa521ad393d3323cc201 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Wed, 19 Jan 2022 14:07:12 -0800 Subject: [PATCH 04/15] Update Generate-AddToken.ps1 --- eng/common/scripts/Generate-AddToken.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/common/scripts/Generate-AddToken.ps1 b/eng/common/scripts/Generate-AddToken.ps1 index b1a8bf070..8f15786cc 100644 --- a/eng/common/scripts/Generate-AddToken.ps1 +++ b/eng/common/scripts/Generate-AddToken.ps1 @@ -65,13 +65,13 @@ param( $LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token" $Headers = @{ - content_type = $ContentType + "content-type" = $ContentType } $Body = @{ - grant_type = $GrantType - client_id = $ClientId - client_secret = $ClientSecret + "grant_type" = $GrantType + "client_id" = $ClientId + "client_secret" = $ClientSecret } function Load-RequestHeaders() { @@ -100,7 +100,7 @@ try { $resp = Invoke-RestMethod $LoginAPIBaseURI -Method 'POST' -Headers $headers -Body $body } catch { - LogError $PSItem.ToString() + LogError $_ exit 1 } From 2adc2afd664d450052375af4b8447782971ce518 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Fri, 21 Jan 2022 10:59:42 -0800 Subject: [PATCH 05/15] Generate token inside of opensource API call scripts --- eng/common/scripts/Generate-AddToken.ps1 | 109 ----------------------- 1 file changed, 109 deletions(-) delete mode 100644 eng/common/scripts/Generate-AddToken.ps1 diff --git a/eng/common/scripts/Generate-AddToken.ps1 b/eng/common/scripts/Generate-AddToken.ps1 deleted file mode 100644 index 8f15786cc..000000000 --- a/eng/common/scripts/Generate-AddToken.ps1 +++ /dev/null @@ -1,109 +0,0 @@ -<# -.DESCRIPTION -Generate aadToken for Azure Directory app using client secrets. - -.PARAMETER TenantId -The aad tenant id/Directory ID. - -.PARAMETER ClientId -The aad client id/application id. - -.PARAMETER ClientSecret -The client secret generates from add. - -.PARAMETER Resource -The App ID URI of the web service. -E.g. https://graph.windows.net/ - -.PARAMETER Scope -The full scope string defining the requested permissions. - -.PARAMETER GrantType -OAuth defines four grant types: authorization code, implicit, -resource owner password credentials, and client credentials. - -.PARAMETER ContentType -Content type of http requests. - -.PARAMETER AdditionalHeaders -Additional parameters for http request headers in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} - -.PARAMETER AdditionalBody -Additional parameters for http request body in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} -#> -[CmdletBinding(SupportsShouldProcess = $true)] -param( - [Parameter(Mandatory = $true)] - [string]$TenantId, - - [Parameter(Mandatory = $true)] - [string]$ClientId, - - [Parameter(Mandatory = $true)] - [string]$ClientSecret, - - [Parameter(Mandatory = $false)] - [string]$Resource, - - [Parameter(Mandatory = $false)] - [string]$Scope, - - [Parameter(Mandatory = $false)] - [string]$GrantType = "client_credentials", - - [Parameter(Mandatory = $false)] - [string]$ContentType = "application/x-www-form-urlencoded", - - [Parameter(Mandatory = $false)] - [hashtable]$AdditionalHeaders, - - [Parameter(Mandatory = $false)] - [hashtable]$AdditionalBody -) -. "${PSScriptRoot}\logging.ps1" - -$LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token" - -$Headers = @{ - "content-type" = $ContentType -} - -$Body = @{ - "grant_type" = $GrantType - "client_id" = $ClientId - "client_secret" = $ClientSecret -} - -function Load-RequestHeaders() { - if ($AdditionalHeaders) { - return $Headers + $AdditionalHeaders - } - return $Headers -} - -function Load-RequestBody() { - if ($Resource) { - $Body.Add("resource", $Resource) - } - if ($Scope) { - $Body.Add("scope", $Scope) - } - if ($AdditionalBody) { - return $Body + $AdditionalBody - } - return $Body -} - -try { - $headers = Load-RequestHeaders - $body = Load-RequestBody - $resp = Invoke-RestMethod $LoginAPIBaseURI -Method 'POST' -Headers $headers -Body $body -} -catch { - LogError $_ - exit 1 -} - -$resp | Write-Verbose - -return $resp.access_token From 43ed2a20ef5f8d42627043d0a562a3d5c70ca1c1 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Fri, 21 Jan 2022 11:03:01 -0800 Subject: [PATCH 06/15] Add resource --- eng/common/scripts/Get-MsAliasFromGithub.ps1 | 79 ++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 eng/common/scripts/Get-MsAliasFromGithub.ps1 diff --git a/eng/common/scripts/Get-MsAliasFromGithub.ps1 b/eng/common/scripts/Get-MsAliasFromGithub.ps1 new file mode 100644 index 000000000..722340ac3 --- /dev/null +++ b/eng/common/scripts/Get-MsAliasFromGithub.ps1 @@ -0,0 +1,79 @@ +<# +.DESCRIPTION +Get the corresponding ms alias from github identity +.PARAMETER AadToken +The aad access token. +.PARAMETER GithubName +Github identity. E.g sima-zhu +.PARAMETER ContentType +Content type of http requests. +.PARAMETER AdditionalHeaders +Additional parameters for http request headers in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3} +#> +[CmdletBinding(SupportsShouldProcess = $true)] +param( + [Parameter(Mandatory = $true)] + [string]$TenantId, + + [Parameter(Mandatory = $true)] + [string]$ClientId, + + [Parameter(Mandatory = $true)] + [string]$ClientSecret, + + [Parameter(Mandatory = $true)] + [string]$GithubName +) +. "${PSScriptRoot}\logging.ps1" + +$OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubName" + +function Generate-AadToken ($TenantId, $ClientId, $ClientSecret) { + $LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token" + try { + $headers = @{ + "content-type" = "application/x-www-form-urlencoded" + } + + $body = @{ + "grant_type" = "client_credentials" + "client_id" = $ClientId + "client_secret" = $ClientSecret + "resource" = "api://repos.opensource.microsoft.com/audience/7e04aa67" + } + Write-Host "Generating aad token..." + $resp = Invoke-RestMethod $LoginAPIBaseURI -Method 'POST' -Headers $headers -Body $body + } + catch { + LogError $_ + exit 1 + } + + $resp | Write-Verbose + + return $resp.access_token +} + +$Headers = @{ + "Content-Type" = "application/json" + "api-version" = "2019-10-01" +} + +try { + $aadToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret + $Headers["Authorization"] = "Bearer $aadToken" + Write-Host "Fetching ms alias for github identity: $GithubName." + $resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers +} +catch { + LogError $_ + exit 1 +} + +$resp | Write-Verbose + +if ($resp.aad) { + return $resp.aad.alias +} + +LogError "Failed to retrieve the ms alias from given github identity: $GithubName." From 2961404390d8f50d8aebc947b7d38275fac39583 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Fri, 21 Jan 2022 11:07:34 -0800 Subject: [PATCH 07/15] Address feedback --- ...mGithub.ps1 => Get-AADIdentityFromGithubUser.ps1} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename eng/common/scripts/{Get-MsAliasFromGithub.ps1 => Get-AADIdentityFromGithubUser.ps1} (83%) diff --git a/eng/common/scripts/Get-MsAliasFromGithub.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 similarity index 83% rename from eng/common/scripts/Get-MsAliasFromGithub.ps1 rename to eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index 722340ac3..b4dbad174 100644 --- a/eng/common/scripts/Get-MsAliasFromGithub.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -22,11 +22,11 @@ param( [string]$ClientSecret, [Parameter(Mandatory = $true)] - [string]$GithubName + [string]$GithubUser ) . "${PSScriptRoot}\logging.ps1" -$OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubName" +$OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubUser" function Generate-AadToken ($TenantId, $ClientId, $ClientSecret) { $LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token" @@ -60,9 +60,9 @@ $Headers = @{ } try { - $aadToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret - $Headers["Authorization"] = "Bearer $aadToken" - Write-Host "Fetching ms alias for github identity: $GithubName." + $opsAuthToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret + $Headers["Authorization"] = "Bearer $opsAuthToken" + Write-Host "Fetching aad identity for github user: $GithubName." $resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers } catch { @@ -76,4 +76,4 @@ if ($resp.aad) { return $resp.aad.alias } -LogError "Failed to retrieve the ms alias from given github identity: $GithubName." +LogError "Failed to retrieve the aad identity from given github user: $GithubName." From 79037958612ffbdae334a908d708323ffff168ec Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:55:23 -0800 Subject: [PATCH 08/15] Update eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index b4dbad174..39a76bd38 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -62,7 +62,7 @@ $Headers = @{ try { $opsAuthToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret $Headers["Authorization"] = "Bearer $opsAuthToken" - Write-Host "Fetching aad identity for github user: $GithubName." + Write-Host "Fetching aad identity for github user: $GithubName" $resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers } catch { From a3c7c53e68bc06cca75853bcde893ff5208d24f0 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:55:32 -0800 Subject: [PATCH 09/15] Update eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index 39a76bd38..d634e52d4 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -76,4 +76,4 @@ if ($resp.aad) { return $resp.aad.alias } -LogError "Failed to retrieve the aad identity from given github user: $GithubName." +LogError "Failed to retrieve the aad identity from given github user: $GithubName" From 43fae94b9a0661032a92846004efb699f2602f21 Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Fri, 21 Jan 2022 11:56:21 -0800 Subject: [PATCH 10/15] Remove the printout --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index d634e52d4..ee3b95a12 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -49,8 +49,6 @@ function Generate-AadToken ($TenantId, $ClientId, $ClientSecret) { exit 1 } - $resp | Write-Verbose - return $resp.access_token } From aea815e42131bd9eb48f8740a349ef0b9011d5b6 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 24 Jan 2022 08:49:41 -0800 Subject: [PATCH 11/15] Update eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 Co-authored-by: Wes Haggard --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index ee3b95a12..f0f3c59eb 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -24,7 +24,7 @@ param( [Parameter(Mandatory = $true)] [string]$GithubUser ) -. "${PSScriptRoot}\logging.ps1" +. "${PSScriptRoot}\common.ps1" $OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubUser" From 8c099abd7a3d5ec996f3f777fc79db98c94cd9d9 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 24 Jan 2022 08:49:56 -0800 Subject: [PATCH 12/15] Update eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index f0f3c59eb..5dc8bfc78 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -75,3 +75,4 @@ if ($resp.aad) { } LogError "Failed to retrieve the aad identity from given github user: $GithubName" +exit 1 From f08c1944200e2166383c2de808ac9332d34841a8 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 24 Jan 2022 08:51:35 -0800 Subject: [PATCH 13/15] Added PS script strict mode --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index 5dc8bfc78..de2e96900 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -24,6 +24,8 @@ param( [Parameter(Mandatory = $true)] [string]$GithubUser ) +Set-StrictMode -Version 3 + . "${PSScriptRoot}\common.ps1" $OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubUser" From 79657ae539a485f4621ef8823b2c59742c3264d0 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:43:44 -0800 Subject: [PATCH 14/15] Update Get-AADIdentityFromGithubUser.ps1 --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index de2e96900..29ee2ad17 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -73,6 +73,7 @@ catch { $resp | Write-Verbose if ($resp.aad) { + Write-Host "Fetched aad identity $($resp.aad.alias)." return $resp.aad.alias } From 54aedf6075285e62a02f8422924a5436e57ef5a4 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:44:14 -0800 Subject: [PATCH 15/15] Update Get-AADIdentityFromGithubUser.ps1 --- eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 index 29ee2ad17..a179a3f93 100644 --- a/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 +++ b/eng/common/scripts/Get-AADIdentityFromGithubUser.ps1 @@ -73,7 +73,7 @@ catch { $resp | Write-Verbose if ($resp.aad) { - Write-Host "Fetched aad identity $($resp.aad.alias)." + Write-Host "Fetched aad identity $($resp.aad.alias) for github user $GithubName." return $resp.aad.alias }