My Azure project have Web Role and a worker Role. Both roles have some common configurations.
How I could share the configurations instead repeating for both roles.
Now the cscfg file looks like this
<ServiceConfiguration serviceName="xxx" ....>
<Role name="WebRole1">
<Instances count="1" />
<ConfigurationSettings>
....
<Setting name="setting1" value="" />
<Setting name="setting2" value="" />
</ConfigurationSettings>
<Certificates>
.....
</Certificates>
</Role>
<Role name="WorkerRole1">
<Instances count="1" />
<ConfigurationSettings>
....
<Setting name="setting1" value="" />
<Setting name="setting2" value="" />
</ConfigurationSettings>
<Certificates>
.....
</Certificates>
</Role>
</ServiceConfiguration>
After googling I found this http://www.simple-talk.com/blogs/2011/03/16/sharing-configuration-settings-between-windows-azure-roles/ - is there any simple way to achieve the same?
What you've found is really interesting approach, but the mentioned attachment is missing anyway. It is also questionable what will happen if I still have some role-specific settings and I add it(them) to the specific role. That approach (most probably) is limited to providing same settings for all the roles.
What I would do to achieve your goal is a bit different. I would use an Azure Table Storage to store my configuration settings. This might be a bit harder to implement the first time, but from then on, you are free to reuse it in all the projects. The harder
bit is that you have to implement your own monitoring
logic to monitor for configuration changes. And that's it. You have a common store for settings. You can read/update settings with any free or paid Azure Storage *explorer like tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With