MSBuild Task To Mark Azure Git Deployment in Rollbar
I prefer using git to deploy to Azure: it’s great that a production deployment is
only a git push azure master away. Git deployment comes with a number of
benefits like making it easier to rollback, forcing you to always commit, and
making it hard to forget to deploy an asset.
As I’ve written before, I like using
Rollbar for collecting errors so they can be notified, triaged, and addressed.
Rollbar has the ability to mark a deployment so that you know which version of
the software is causing problems. All you need to do is POST to their API
passing along the environment and your access key.
Rollbar provides a link to a gist from
Matt Hensley showing how to read the values from
your web.config in order to make the API call.
Luckily, in Azure, any application settings you configure through the portal
are available as environment variables. If you create a setting called
RollbarAccessToken, it will be available to all processes as
I forked Matt’s
gist and simplified it to use the environment variables rather than reading