-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for AzureRm SPN with certificate for Azure PowerShell based t…
…asks. (#7719) * SPN with certificates: Initial commit * SPN with certificate - updated tasks based up on AzurePS rest APIs * SPN Certificate - code refactoring * Updated password * Resource localization * Added L0 test for VstsAzureRestHelpers_ * Test file rename * Added more L0 tests * Remove unnecessary log messages * Bug fix * Incorporated review comments * Fixing L0 test failure * Added support for ADFS authentication * Fixing L0 test failure * Addressing review comments * Review comments * Added third party notice for VstsAzureRestHelpers_
- Loading branch information
Showing
39 changed files
with
614 additions
and
35 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 139 | ||
"Patch": 140 | ||
|
||
}, | ||
"demands": [ | ||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 139 | ||
"Patch": 140 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 2, | ||
"Minor": 0, | ||
"Patch": 7 | ||
"Patch": 8 | ||
|
||
}, | ||
"preview": true, | ||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 2, | ||
"Minor": 0, | ||
"Patch": 7 | ||
"Patch": 8 | ||
}, | ||
"preview": true, | ||
"demands": [ | ||
|
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
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
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
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
35 changes: 35 additions & 0 deletions
35
...mmon/VstsAzureHelpers_/Tests/Initialize-AzureSubscription.PassesValuesWhenSPNCertAuth.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,35 @@ | ||
[CmdletBinding()] | ||
param() | ||
|
||
# Arrange. | ||
. $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1 | ||
|
||
$endpoint = @{ | ||
Url = "https://management.azure.com" | ||
Auth = @{ | ||
Parameters = @{ | ||
TenantId = 'Tenant Id' | ||
ServicePrincipalId = 'Service Principal Id 1' | ||
AuthenticationType = 'SPNCertificate' | ||
ServicePrincipalCertificate = 'Service Principal Certificate' | ||
} | ||
Scheme = 'ServicePrincipal' | ||
} | ||
Data = @{ | ||
SubscriptionId = 'Subscription ID' | ||
SubscriptionName = 'Subscription name' | ||
Environment = "AzureCloud" | ||
ActiveDirectoryServiceEndpointResourceId = "https://management.azure.com" | ||
} | ||
} | ||
|
||
Register-Mock Add-Tls12InSession { } | ||
Register-Mock Add-AzureRMAccount { 'Add-AzureRmAccount' } | ||
Register-Mock Set-CurrentAzureRMSubscription { 'Set-CurrentAzureRMSubscription' } | ||
Register-Mock Set-UserAgent { } | ||
Register-Mock Add-Certificate { } | ||
|
||
$module = Microsoft.PowerShell.Core\Import-Module $PSScriptRoot\.. -PassThru | ||
$result = & $module Initialize-AzureSubscription -Endpoint $endpoint | ||
|
||
Assert-WasCalled Add-AzureRMAccount |
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
Oops, something went wrong.