Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyVaultClient base URL #1

Open
ChristianWeyer opened this issue Nov 22, 2018 · 0 comments
Open

KeyVaultClient base URL #1

ChristianWeyer opened this issue Nov 22, 2018 · 0 comments

Comments

@ChristianWeyer
Copy link

When using the KeyVaultClient like this in my Startup.cs:

public class Startup : IWebJobsStartup
    {
        public void Configure(IWebJobsBuilder builder)
        {
            var tempProvider = builder.Services.BuildServiceProvider();
            var config = tempProvider.GetRequiredService<IConfiguration>();

            builder.AddAzureKeyVault(config["KeyVaultUrl"],
                "...",
                "...");
        }

and then like this in my function:

[FunctionName("RecognizeTextFromImage")]
        public static async Task Run(
            [EventGridTrigger]
            EventGridEvent eventGridEvent,

            [Blob("invoice-texts", FileAccess.Read)]
            CloudBlobContainer blobDirectory,

            [AzureKeyVaultClient]
            IKeyVaultClient keyVaultClient,

            ILogger log)
{
   keyVaultClient.GetSecretAsync("CognitiveServicesEndpoint")
   ...
}

I would expect that the keyVaultClient instance already uses the KeyVaultUrl as the base URL.
However, this is not the case right now and we need to pass it in:
keyVaultClient.GetSecretAsync(Environment.GetEnvironmentVariable("KeyVaultUrl") ,"CognitiveServicesEndpoint"))

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant