Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Retrieve provider information from IConfiguration

I have an Azure Function I’m trying to retrieve the data from a provider located within IConfiguration, the issue is no matter how I approach this I’m unable to extract the data.

Below is how the data is structured in the IConfiguration

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This information initially lives inside an App Configuration resource in Azure and it’s loaded in via run time.

I have tried:

var azureAppConfigurationData = _configuration.GetSection("AzureAppConfigurationProvider");
var azureAppConfigurationData = _configuration.GetValue<string,string>("AzureAppConfigurationProvider:Data");
var azureAppConfigurationData = _configuration.GetValue<object>("AzureAppConfigurationProvider:Data");

However, each result in null

I’m trying to extract the clientId, clientSecret and the tenantId which is then passed into the Microsoft Graph SDK to communicate with Azure B2C

>Solution :

There are many ways to do this, however, the simplest (without creating a concrete class) would be just to reference the Config Item directly

var clientId = _configuration["UserManagement:Settings:B2CClient:ClientId"]

Assuming, I have typed this correctly

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading