Skip to content

Commit

Permalink
Merge pull request #356 from OctopusDeploy/disable-shared-context
Browse files Browse the repository at this point in the history
Call Disable-AzureRMContextAutosave
  • Loading branch information
johnsimons committed Jan 17, 2019
2 parents aa5db12 + 4ec59b6 commit a4b857d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/Calamari.Azure/Scripts/AzureContext.ps1
Expand Up @@ -66,6 +66,10 @@ Execute-WithRetry{
# Authenticate via Service Principal
$securePassword = ConvertTo-SecureString $OctopusAzureADPassword -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ($OctopusAzureADClientId, $securePassword)

# Turn off context autosave, as this will make all authentication occur in memory, and isolate each session from the context changes in other sessions
Disable-AzureRMContextAutosave -Scope Process

$AzureEnvironment = Get-AzureRmEnvironment -Name $OctopusAzureEnvironment
if (!$AzureEnvironment) {
Write-Error "No Azure environment could be matched given the name $OctopusAzureEnvironment"
Expand Down

0 comments on commit a4b857d

Please sign in to comment.