Posted with : Cloud Platforms
Activate HTTPS on Azure Website
My story is that the website deployed on Azure needs to have Disqus function… It should be trivial
because Disqus provide a nice plugin and just some simple configuration steps are required.
It’s nothing but https is required. It impires me to create a new attribute called RequireHttpsInProductionAttribute.
Available ways
There are some ways already to make it working from Two Methods or HTTPS only on Windows Azure Web Sites

but it doesn’t fit to my case : development environment shouldn’t be effected, it changes only the production. Then the new attribute was born ;)
RequireHttpsInProductionAttribute
So it adapts for these requirements
- Locally should not be effected by default, otherwise it needs to be set.
- When having some test environments (based on hostname) it should exclude this check.
Then it will be registered as usual
filters.Add(new RequireHttpsInProductionAttribute());
Below is main part of the attribute, and full version here
