This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k
stars
4.59k
forks
source link
[BUG] Await when using Azure.Security.KeyVault.Certificates.GetCertificateAsync doesn't really wait for a success result #45405
This will trigger an Error Exception on the next line because the first line dodn't provide a success certificateWithPolicy object to next line.
As a workaround I have to insert additional code to wait for 2 seconds just to properly wait for the certificateWithPolicy object from first line to have a proper value like this
Library name and version
Azure.Security.KeyVault.Certificates 4.6.0
Describe the bug
I tried to use these lines of code in an async method
This will trigger an Error Exception on the next line because the first line dodn't provide a success certificateWithPolicy object to next line. As a workaround I have to insert additional code to wait for 2 seconds just to properly wait for the certificateWithPolicy object from first line to have a proper value like this
Expected behavior
There should be no need to put a Timer just to wait for the proper result from the first line
Actual behavior
Running the code without the Timer Delay will throw an Exception
Reproduction Steps
Run the API that will call the endpoint that uses the line of codes describe above.
Environment
Function App, Windows .NET 8