How to access settings.xml in Azure Service Fabric statefull / stateless?

How can I access and read the parameters defined in the PackageRoot / Settings / Settings.xml file from my statefull / stateless status code? For example, I have a DocumentDbConfig section with an EndpointUrl parameter:

<Section Name="DocumentDbConfig"> <Parameter Name="EndpointUrl" Value="{url}"/> </Section> 

And I would like to read it in my code:

 public async Task<ServiceActionResult<Result>> GetResult() { _client = new Client({{ EndpointUrl }}); //HOW TO GET ENDPOINT URL FROM SETTINGS? } 
+5
source share
1 answer

This SO answer shows how to configure and read the settings very well

Where do you install and access runtime configuration settings for each service environment?

+5
source

Source: https://habr.com/ru/post/1247182/


All Articles