Skip to content

Commit

Permalink
Merge pull request #1714 from Microsoft/users/ersciple/m101azpssppref
Browse files Browse the repository at this point in the history
Update AzureRM preference to rely on auth scheme rather than connecti…
  • Loading branch information
ericsciple committed May 12, 2016
2 parents f82b12d + ec62101 commit d5ff5a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Tasks/Common/VstsAzureHelpers_/VstsAzureHelpers_.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Initialize-Azure {

# Determine which modules are preferred.
$preferredModules = @( )
if ($serviceNameInput -eq 'ConnectedServiceNameARM') {
if ($endpoint.Auth.Scheme -eq 'ServicePrincipal') {
$preferredModules += 'AzureRM'
} elseif ($endpoint.Auth.Scheme -eq 'UserNamePassword') {
$preferredModules += 'Azure'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ param()
. $PSScriptRoot/../../lib/Initialize-Test.ps1
Microsoft.PowerShell.Core\Import-Module $PSScriptRoot/../../../Tasks/AzurePowerShell/ps_modules/VstsAzureHelpers_
$variableSets = @(
@{
ConnectedServiceNameSelector = 'ConnectedServiceName'
DeploymentEnvironmentName = $null
Endpoint = @{ Auth = @{ Scheme = 'ServicePrincipal' } }
StorageAccount = $null
ExpectedServiceNameInput = 'ConnectedServiceName'
ExpectedPreferredModule = ,'AzureRM'
}
@{
ConnectedServiceNameSelector = 'ConnectedServiceName'
DeploymentEnvironmentName = $null
Expand All @@ -24,31 +32,31 @@ $variableSets = @(
@{
ConnectedServiceNameSelector = 'ConnectedServiceName'
DeploymentEnvironmentName = $null
Endpoint = 'Some endpoint'
Endpoint = @{ Auth = @{ Scheme = 'Certificate' } }
StorageAccount = $null
ExpectedServiceNameInput = 'ConnectedServiceName'
ExpectedPreferredModule = ,'Azure'
}
@{
ConnectedServiceNameSelector = 'ConnectedServiceName'
DeploymentEnvironmentName = $null
Endpoint = 'Some endpoint'
Endpoint = @{ Auth = @{ Scheme = 'Certificate' } }
StorageAccount = 'Some storage account'
ExpectedServiceNameInput = 'ConnectedServiceName'
ExpectedPreferredModule = ,'Azure'
}
@{
ConnectedServiceNameSelector = 'ConnectedServiceNameARM'
DeploymentEnvironmentName = $null
Endpoint = 'Some endpoint'
Endpoint = @{ Auth = @{ Scheme = 'ServicePrincipal' } }
StorageAccount = $null
ExpectedServiceNameInput = 'ConnectedServiceNameARM'
ExpectedPreferredModule = ,'AzureRM'
}
@{
ConnectedServiceNameSelector = 'ConnectedServiceNameARM'
DeploymentEnvironmentName = $null
Endpoint = 'Some endpoint'
Endpoint = @{ Auth = @{ Scheme = 'ServicePrincipal' } }
StorageAccount = 'Some storage account'
ExpectedServiceNameInput = 'ConnectedServiceNameARM'
ExpectedPreferredModule = ,'AzureRM'
Expand Down

0 comments on commit d5ff5a5

Please sign in to comment.