Conversation
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
| [string]$ContentType = "application/json", | ||
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [hashtable]$AdditionalHeaders |
There was a problem hiding this comment.
Do we we have a need to pass extra headers?
| [string]$ApiVersion = "2019-10-01", | ||
|
|
||
| [Parameter(Mandatory = $false)] | ||
| [string]$ContentType = "application/json", |
There was a problem hiding this comment.
Why do we need to pass in the apiversion or contenttype as parameters?
| @@ -0,0 +1,64 @@ | |||
| <# | |||
There was a problem hiding this comment.
Lets name this something like:
Get-AADIdentityFromGithubUser
| [string]$AadToken, | ||
|
|
||
| [Parameter(Mandatory = $true)] | ||
| [string]$GithubName, |
There was a problem hiding this comment.
| [string]$GithubName, | |
| [string]$GithubUser, |
| [CmdletBinding(SupportsShouldProcess = $true)] | ||
| param( | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$AadToken, |
There was a problem hiding this comment.
| [string]$AadToken, | |
| [string]$opsAuthToken, |
|
|
||
| try { | ||
| $headers = Load-RequestHeaders | ||
| Write-Host "Fetching ms alias for github identity: $GithubName." |
There was a problem hiding this comment.
| Write-Host "Fetching ms alias for github identity: $GithubName." | |
| Write-Host "Fetching aad identity for github user: $GithubName." |
| return $resp.aad.alias | ||
| } | ||
|
|
||
| LogError "Failed to retrieve the ms alias from given github identity: $GithubName." |
There was a problem hiding this comment.
| LogError "Failed to retrieve the ms alias from given github identity: $GithubName." | |
| LogError "Failed to retrieve the aad identity from given github user: $GithubName." |
Should we exit 1 here as well, or is what is the expected way to handle the errors from this script?
|
Combined this PR with #2581 |
Summary
The PR is using opensource rest API call to get ms alias from github identity.
Expect returns:
Return ms alias directly when call the scripts.
Print the API call error response and exit 1.
Testing locally