diff --git a/Actions/AL-Go-Helper.ps1 b/Actions/AL-Go-Helper.ps1 index c8e190b77..04497a7d5 100644 --- a/Actions/AL-Go-Helper.ps1 +++ b/Actions/AL-Go-Helper.ps1 @@ -2412,7 +2412,8 @@ function ConnectAz { Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue if ($azureCredentials.PSObject.Properties.Name -eq 'ClientSecret' -and $azureCredentials.ClientSecret) { Write-Host "Connecting to Azure using clientId and clientSecret." - $credential = New-Object PSCredential -argumentList $azureCredentials.ClientId, $azureCredentials.ClientSecret + $azureCredentials.clientSecret.GetType() | Out-Host + $credential = New-Object pscredential -ArgumentList $azureCredentials.ClientId, $azureCredentials.ClientSecret Connect-AzAccount -ServicePrincipal -Tenant $azureCredentials.TenantId -Credential $credential -WarningAction SilentlyContinue | Out-Null } else { diff --git a/Actions/Deliver/Deliver.ps1 b/Actions/Deliver/Deliver.ps1 index 33d05da62..9ea581267 100644 --- a/Actions/Deliver/Deliver.ps1 +++ b/Actions/Deliver/Deliver.ps1 @@ -33,7 +33,7 @@ function ConnectAzStorageAccount { $azStorageContext = New-AzStorageContext -StorageAccountName $storageAccountCredentials.StorageAccountName -SasToken $storageAccountCredentials.sastoken } catch { - $message = "Unable to create AzStorageContext based on StorageAccountName and sastoken.`nError was: $($_.Exception.Message)" + $message = "Unable to create AzStorageContext based on StorageAccountName and sastoken. Error was: $($_.Exception.Message)" } } elseif ($storageAccountCredentials.PSObject.Properties.Name -eq 'StorageAccountKey') { @@ -42,7 +42,7 @@ function ConnectAzStorageAccount { $azStorageContext = New-AzStorageContext -StorageAccountName $storageAccountCredentials.StorageAccountName -StorageAccountKey $storageAccountCredentials.StorageAccountKey } catch { - $message = "Unable to create AzStorageContext based on StorageAccountName and StorageAccountKey.`nError was: $($_.Exception.Message)" + $message = "Unable to create AzStorageContext based on StorageAccountName and StorageAccountKey. Error was: $($_.Exception.Message)" } } elseif (($storageAccountCredentials.PSObject.Properties.Name -eq 'clientID') -and ($storageAccountCredentials.PSObject.Properties.Name -eq 'tenantID')) { @@ -53,7 +53,7 @@ function ConnectAzStorageAccount { $azStorageContext = New-AzStorageContext -StorageAccountName $storageAccountCredentials.StorageAccountName -UseConnectedAccount } catch { - $message = "Unable to create AzStorageContext based on StorageAccountName and managed identity.`nError was: $($_.Exception.Message)" + $message = "Unable to create AzStorageContext based on StorageAccountName and managed identity. Error was: $($_.Exception.Message)" } } else {