Project Description
Azure Config Generator is a MSBuild task for turning a simple JSON-based configuration file into CSDEF/CSCFG files.


Azure Config Generator is a MSBuild task for turning a simple JSON-based configuration file into CSDEF/CSCFG files. This is entirely unnecessary unless you have several environments, multiple roles, and configuration values that are shared between them.

As part of running Socl and experimenting in FUSE Labs, we have several environments for different purposes, with web and worker roles in each. Both the roles and the environments share some settings (e.g. all scratch environments share the same storage stamps, all roles in a set of environments share the same queue names), but since not all environments are the same (only subsets), the fancy Visual Studio editor didn't meet our needs and we wound up violating the DRY principle quite a bit.

In an effort to fix this DRY problem, I decided to write a tool that'd allow me to use a simple "source" configuration to splat out all of the different CSCFG files required. This project includes the tool to do that, and a simple MSBuild Task wrapper to make it part of the build process. Given JSON's relatively human-readable format and JSON.Net's easy serialization, I decided to use that as the format for the master configuration, but I've tried to abstract that out so it can be extended to other formats.

The tool takes in this configuration file, and template csdef/cscfg files, and generates csdef/cscfg files for all configured environments. There is also a tool for taking in an existing set of csdef/cscfgs and abstracting a configuration file from them, pulling out common settings using simple inheritance.

TODO

NOTES