I need to add keys into Configuration for multi-tenants azure function while the function is executing.
For example :
Key 1 => "api:url:tenantId1", "www.tenant1.com"
Key 2 => "api:url:tenantId2", "www.tenant2.com"
Key 3 => "api:url:tenantId3", "www.tenant3.com"
When I try to add the first key for example then it adds 3 keys … it adds
"api" null
"api:url" null
"api"url:tenantId1" "www.tenant1.com"
and when I try to bind then it returns null
ApiOptions apiOptions = new ApiOptions();
configuration.Bind(apiOptions);
then apiOptions is null.
And when I try:
configuration.GetSection(nameof(ApiOptions)).Get<ApiOptions>();
It throws exception:
"Cannot create instance of type 'System.String' because it has multiple public
parameterized constructors."
1