Is the Application variable shared when the web application has multiple role instances in window azure? And I am using Dedicated cache worker role. Is Application Variable is preserved the cache? If not then how we can do it?
Is the Application variable shared when the web application has multiple role instances in
Share
The Application variable is stored in-memory (see this MSDN reference article). There’s no option to persist it or externalize it, so there’s no way to share application state across web role instances. The article points this out, in terms of inability to share application state across servers in a web farm.
As this SO answer suggests, you’d need to use some shareable resource for application-level content. In other words, just don’t use the Application variable. You could store app-level variables easily in a Windows Azure Table or Cache (either dedicated cache role or shared cache within your web role).