Force update Diagnostic configuration file under wad-control-container for Azure

I want to update the Diagnostic configuration file for the azure role whenever I update my deployment. How to do it automatically?

From time to time, we change our diagnostics (using the code) and update the service. But whenever we update the service, it still uses the old diagnostic configuration, and we do not see any new logs that we configured with the new code.

How can I achieve this so that whenever I update my deployment, it also updates the diagnostic configuration.

+4
source share
1 answer

I wonder if you have a bug in your diagnostic code update. If each role ran code in OnStart or Run to configure diagnostics at startup, there would be no reason why your instances would not be configured correctly. I tend to think that imperative code that sets up diagnostics is inherently a bad idea in the long run, but it should work anyway. If you split the code, maybe I can find the problem.

The best ** I have found to update and provide configuration is to use the dialogics.wadcfg file and update it. When updating the deployment, it will use these parameters if you have not redefined it in the code somewhere. Contrary to Microsoft’s instructions at this link, this should be the preferred method rather than code that should be supported and orthogonal to the purpose of your application. On the other hand, a declarative configuration file that your ops team can support when writing code is usually a better idea. To use this, simply include it in the deployment as content and delete all existing files in the wad-control-container (and remove any code that configured the diagnostics). It will simply configure itself from this file, and then on the next update.

** You can also use third-party SaaS monitoring to configure and support diagnostic configurations. I am working on one of them, but I assume that you want to know how to do it yourself. :)

+2
source

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


All Articles