You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 90fd1a7
Browse filesBrowse the repository at this point in the historyBrowse files
if ($tokenExitCode-ne0-or [string]::IsNullOrWhiteSpace($keyVaultAccessToken)) {
73
-
Write-PipelineTelemetryError-Category 'Build'-Message "'az account get-access-token' exited with code $tokenExitCode while acquiring an Azure Key Vault access token."
79
+
if ($secretExitCode-ne0-or [string]::IsNullOrWhiteSpace($appId)) {
80
+
Write-PipelineTelemetryError-Category 'Build'-Message "'az rest' failed with exit code $secretExitCode while reading App ID secret '$AppIdSecretName' from vault '$KeyVaultName'. Verify the service connection can read this App-ID projection."
Write-PipelineTelemetryError-Category 'Build'-Message "Failed to read secret '$SecretName' from vault '$KeyVaultName': $_. Verify the secret exists and the service connection has 'Key Vault Secrets User' access to it."
90
-
exit1
91
-
}
92
-
if ([string]::IsNullOrWhiteSpace($response.value)) {
93
-
Write-PipelineTelemetryError-Category 'Build'-Message "Secret '$SecretName' in vault '$KeyVaultName' is empty."
94
-
exit1
95
-
}
96
-
return [string] $response.value
97
-
}
98
-
99
-
Write-Host"Reading GitHub App credentials from vault '$KeyVaultName'..."
# Azure CLI can emit non-fatal Python warnings to stderr.
114
+
$PSNativeCommandUseErrorActionPreference=$false
115
+
$signatureBase64= az keyvault key sign `
116
+
--vault-name $KeyVaultName`
117
+
--name $KeyName`
118
+
--algorithm RS256 `
119
+
--digest $digestBase64`
120
+
--query signature `
121
+
--output tsv `
122
+
--only-show-errors
123
+
$signExitCode=$LASTEXITCODE
137
124
}
138
125
catch {
139
-
Write-PipelineTelemetryError-Category 'Build'-Message "Failed to sign the GitHub App JWT with the supplied private key: $_"
126
+
Write-PipelineTelemetryError-Category 'Build'-Message "Failed to sign the JWT via Key Vault (key '$KeyName', vault '$KeyVaultName'): $_. Verify the service connection has the Sign action on the key."
if ($signExitCode-ne0-or [string]::IsNullOrWhiteSpace($signatureBase64)) {
133
+
Write-PipelineTelemetryError-Category 'Build'-Message "'az keyvault key sign' exited with code $signExitCode for key '$KeyName' in vault '$KeyVaultName'. Verify the service connection has the Sign action on the key."
0 commit comments