Skip to content
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

Update AzureRM preference to rely on auth scheme rather than connecti… #1714

Merged
merged 1 commit into from
May 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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