If I use the auto scaling features of Azure Web Sites do I need to set a specific machine key? -
If you use auto scaling with Aesur Web sites, then you need to set the machine key so that encrypted authentication Can tokens be shared between machines?
Here is a question that I am asking for. However this question refers to Azure Web roles. I am asking about Azure Web sites.
No, you do not need it. The weird website will set the same machine key for all your instances when they are running 2 (or 10) different VMs.
If you want a quick and dirty way to verify this, the code of the following code is basically the machine key in your Application_Start () code
% WEBSITE_INSTANCE_ID% writes in a file named . This example is a unique environment variable Scale for 2 machines, turn on
always setting and in 2 minutes your files will have 2 files in your
D : \ Home \ site \ wwwroot should be written in the folder for which the long route path Complaints and s is an example for the name (2 machines ID) and they will have the same key.
Secure void Application_Start () {var section = (MachineKeySection) Configuration Manager.GetSection ("system.web / machineKey"); Binding flag = binding flag.instance | Binding Flags Nonpolic | BindingFlags.GetProperty; Function & lt; String, byte [] & gt; PropertyReader = name = & gt; (Byte []) section .GetType () .GetProperty (names, flags) .GetValue (section, blank); (Var author = new streamwire (Environmental expand environment environment) (@ "% HOME% \ site \ wwwroot \% WEBSITE_INSTANCE_ID% .log")) {var key = ConvertToHex (propertyReader ("decryption keyintele")); Author. Write line ("decryptkey: {0}", key); Var iv = ConvertToHex (propertyreader ("Internationalization of Validation")); Author. Written line ("Verification Key: {0}", iv); }} Private string convertorhex (byte [] binary) {return binary.grrget (new stringbilder (), (ACC, C) => ACC.form format ("{0: x2}", c), ACC => ; ACC .tar ()); }
Comments
Post a Comment