as per the code below, I am connecting to an azure app configuration service in program.cs. This is tested and I can use the config settings in the function app. But I'd also like to configure other services, such as a blob container client.
is it possible for me to access the app configuration values in ConfigureServices?
var host = new HostBuilder()
.ConfigureAppConfiguration(builder =>
{
string uriString = "https://sixdg-appconfigservice-uks-reportingservice.azconfig.io";
builder.AddAzureAppConfiguration(options =>
{
options.Connect(new Uri(uriString), new DefaultAzureCredential());
});
})
.ConfigureServices(s =>
{
//configure services here using AppConfiguration
Uri blobUri = new Uri(Environment.GetEnvironmentVariable("ReportBlobUri")); // use appconfig here instead of environmental variables
BlobServiceClient blobServiceClient = new BlobServiceClient(blobUri, new DefaultAzureCredential());
BlobContainerClient blobContainerClient = blobServiceClient.GetBlobContainerClient(Environment.GetEnvironmentVariable("ReportBlobContainer"));
s.AddSingleton(blobContainerClient);
})
.ConfigureFunctionsWorkerDefaults()
.Build();
host.Run();