1. {
  2. "fileUrl": "any url",
  3. "otherKey":"any other key"
  4. }
  1. public class AnyClass /Controller
  2. {
  3. private readonly IConfiguration _config ;
  4. public AnyClass(IConfiguration config)
  5. {
  6. _config=config;
  7. }
  8. public void AnyMethod()
  9. {
  10. var fileUrl=_config.GetValue("fileUrl");
  11. //other logic
  12. }
  13. }
 If it is hierarchical 
  1. {  
  2. "AllUrls":{  
  3. "fileUrl": "any url",  
  4. "WebUrl":"any other url"  
  5. }  
  6. "otherKey":"any other key"  
  7. }  
 Then
 
  1. public class AnyClass /Controller  
  2. {  
  3. private readonly IConfiguration _config ;  
  4. public AnyClass(IConfiguration config)  
  5. {  
  6. _config=config;  
  7. }  
  8. public void AnyMethod()  
  9. {  
  10. var fileUrl=_config.GetValue("AllUrls:fileUrl");  
  11. //other logic  
  12. }  
  13. }  
 
I gave the example using IConfiguration, you can also use IOptions if you wish.