-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msi for native support #6655
Merged
RoshanKumarMicrosoft
merged 14 commits into
master
from
users/rok/msi-native-powershell
Apr 15, 2018
Merged
msi for native support #6655
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9ec0e7e
msi for native support
RoshanKumarMicrosoft 79199a7
native powershell changes
RoshanKumarMicrosoft b1555f2
Not printing access token in log
RoshanKumarMicrosoft a28efdb
rename
RoshanKumarMicrosoft b8b3e66
Error messgae changed
RoshanKumarMicrosoft 220491b
error message changed
RoshanKumarMicrosoft 89aaae1
unused code
RoshanKumarMicrosoft 563c8dd
error message changed
RoshanKumarMicrosoft 856c041
Merge branch 'master' into users/rok/msi-native-powershell
RoshanKumarMicrosoft 08aa73a
build failure
RoshanKumarMicrosoft 93d616b
url changed
RoshanKumarMicrosoft 62756df
native powershell
RoshanKumarMicrosoft d059c7d
MSI
RoshanKumarMicrosoft 7cca967
response modifieed
RoshanKumarMicrosoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Tasks/Common/VstsAzureHelpers_/Tests/Initialize-AzureSubscription.ManagedServiceIdentity.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[CmdletBinding()] | ||
param() | ||
|
||
# Arrange. | ||
. $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 | ||
Microsoft.PowerShell.Core\Import-Module Microsoft.PowerShell.Security | ||
Unregister-Mock Import-Module | ||
Register-Mock Write-VstsTaskError | ||
$module = Microsoft.PowerShell.Core\Import-Module $PSScriptRoot\.. -PassThru | ||
|
||
$endpoint = @{ | ||
Auth = @{ | ||
Parameters = @{ | ||
ServicePrincipalId = 'Some service principal ID' | ||
ServicePrincipalKey = 'Some service principal key' | ||
TenantId = 'Some tenant ID' | ||
} | ||
Scheme = 'ManagedServiceIdentity' | ||
} | ||
Data = @{ | ||
SubscriptionId = 'Some subscription ID' | ||
SubscriptionName = 'Some subscription name' | ||
} | ||
} | ||
|
||
$content = @" | ||
{"access_token" : "Dummy Token" } | ||
"@ | ||
|
||
$response = @{ | ||
Content = $content | ||
StatusCode = 200 | ||
StatusDescription = 'OK' | ||
}; | ||
|
||
$variableSets = @( | ||
@{ StorageAccount = 'Some storage account' } | ||
) | ||
foreach ($variableSet in $variableSets) { | ||
Write-Verbose ('-' * 80) | ||
Unregister-Mock Add-AzureRMAccount | ||
Unregister-Mock Set-CurrentAzureRMSubscription | ||
Unregister-Mock Invoke-WebRequest | ||
Unregister-Mock Set-UserAgent | ||
Register-Mock Add-AzureRMAccount { 'some output' } | ||
Register-Mock Set-CurrentAzureRMSubscription | ||
Register-Mock Set-UserAgent | ||
Register-Mock Invoke-WebRequest { $response } | ||
|
||
# Act. | ||
$result = & $module Initialize-AzureSubscription -Endpoint $endpoint -StorageAccount $variableSet.StorageAccount | ||
|
||
Assert-AreEqual $null $result | ||
Assert-WasCalled Set-CurrentAzureRMSubscription -- -SubscriptionId $endpoint.Data.SubscriptionId -TenantId $endpoint.Auth.Parameters.TenantId | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ajay-MS - Can you ensure post Roshan's change, your changes to log the error code is factored in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take into separate PR.