Poul K. Sørensen
Poul K. Sørensen

Reputation: 17530

Microsoft.Azure.KeyVault.KeyVaultClientException :Service Error information was not available

Unhandled Exception: Microsoft.Azure.KeyVault.KeyVaultClientException: Service Error information was not available
   at Microsoft.Azure.KeyVault.KeyVaultClient.<Do>d__11b`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.KeyVault.KeyVaultClient.<GetSecretAsync>d__cb.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CertificateEncryptValueTask.CertificateEncryptValueTask.Main(String[] args) in C:\dev\sinnovations-vsts-tasks\src\CertificateEncryptValueTask\CertificateEncryptValueTask.cs:line 92
Press any key to continue . . .

is thrown when trying to retrieve a secret from Azure Keyvault when using https://vault.azure.net/

  var valueToken = options.ConnectedServiceName.GetToken("https://vault.azure.net/");

Upvotes: 1

Views: 1308

Answers (1)

Poul K. S&#248;rensen
Poul K. S&#248;rensen

Reputation: 17530

Looking deeper at the exceptions the followign status was found: System.Net.HttpStatusCode.Unauthorized which indicate that the token is authorized.

It turns out that the reason is the last slash of the resource uri.

  var valueToken = options.ConnectedServiceName.GetToken("https://vault.azure.net");

On the management.azure.com resource - they are nicely including this information in the error if its because of missing slashes and such.

Upvotes: 1

Related Questions