Skip to content

KeyVaultClient base URL #1

@ChristianWeyer

Description

@ChristianWeyer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions