Tamás Varga
Tamás Varga

Reputation: 635

Change ServiceConfiguration.csfg from an other role

I have several roles in my azure deployment, and one of them is kinda "admin" role, which provides a web interface to see trace and exception logs, etc.

In my roles I use the dafault azure dianostic tools. I set up an initial config in every role's onstart method (sheduledtransferperiod, loglevelfilter etc). My goal is to provide web interface in my adminrole, to change these values of the other roles. For this, I moved these values to the serviceConfiguration file, and i would like to change these values from an other role. (like I can start on demand transfer whith the DeploymentDiagnosticManager). How can i do that?

I know, there is an opportunity to do this, on the azure management portal, but i would not like to provide acces to this.

Thansk for your help.

T

Upvotes: 1

Views: 181

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136196

What you would need to do is make use of Service Management API to get the configuration data by calling Get Deployment operation. Since the configuration file is an XML file, you could just parse that XML file and present it in a way it is done on the portal. One thing you would want to do is only expose diagnostics related key/value pairs and not all. Once the user has changed the values, you can recreate the configuration file and call Change Deployment Configuration operation. This will update the configuration file.

Upvotes: 3

Related Questions