azure - How to Get Service Fabric Project Settings.xml Values -


i have 5 service fabric stateless services. have these service fabric settings.xml values in class library based on section name of each file. going create common class take sectionname parameter , have configuration values.

you can use starting point:

internal sealed class yourservice: statelessservice {     public yourservice(statelessservicecontext context)         : base(context)     {         var configurationpackage = context.codepackageactivationcontext.getconfigurationpackageobject("config");         var sectionparams = configurationpackage.settings.sections["sectionname"].parameters;         // can iterate through these parameters (e.g. count , access index)         //sectionparams.count;         //sectionparams[0].name;         //sectionparams[0].value; 

i not sure if there way library find servicecontext of other services. please aware not services might deployed same nodes. might affect configuration availability.

you might need create central service or actor collects configuration values of other services.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -