With multiple instances of an Azure Website running, how do static variables work? This is a fundamental question of not fully understanding "what" an azure website is. Take the below simplified code.
static int MyCachedInt=10;
public ActionResult SetMyCachedInt(int a)
{
MyCachedInt = a;
return this.Content(MyCachedInt.ToString());
}
public ActionResult GetMyCachedInt()
{
return this.Content(MyCachedInt.ToString());
}
On a single web-server, or a traditional virtual machine I would expect each website to either return 10, or whatever the last value was set. With Azure would all websites return the same value or would each instance be updated individually? If Azure scales up a new website, would the value be 10 or the last instance of one of the previously scaled?