Skip to content

Commit a2c4efc

Browse files
authored
Issue 1164 (#1172)
Fixes #1164 --------- Co-authored-by: freddydk <[email protected]>
1 parent 6c58752 commit a2c4efc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Actions/ReadSecrets/ReadSecretsHelper.psm1

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function GetAzureCredentials {
2626
return $null
2727
}
2828

29-
3029
function MaskValue {
3130
Param(
3231
[string] $key,
@@ -119,6 +118,16 @@ function GetKeyVaultCredentials {
119118
$creds = $null
120119
}
121120
}
121+
if ($creds) {
122+
try {
123+
# check that we have access to get secrets from the keyvault by trying to get a dummy secret
124+
GetKeyVaultSecret -secretName 'algodummysecret' -keyVaultCredentials $creds -encrypted | Out-Null
125+
}
126+
catch {
127+
Write-Host "Unable to get secrets from Azure Key Vault. Error was $($_.Exception.Message). Using Github secrets instead."
128+
$creds = $null
129+
}
130+
}
122131
return $creds
123132
}
124133

RELEASENOTES.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Fix issue with github ref when running reusable workflows
1111
- Issue 1098 Support for specifying the name of the AZURE_CREDENTIALS secret by adding a AZURE_CREDENTIALSSecretName setting
1212
- Fix placeholder syntax for git ref in PullRequestHandler.yaml
13+
- Issue 1164 Getting secrets from Azure key vault fails in Preview
1314

1415
### Dependencies to PowerShell modules
1516

0 commit comments

Comments
 (0)