Reputation: 4178
What happens to an Azure website while it's being upgraded through an deployment? Usually it goes so quick so you don't see it. But what if you have a huge database that through migration scripts will take several minutes to upgrade, then what happens in the meantime? Are all users trying to access the website denied access? Will they get access to a partially upgraded website or will they see the old one?
Is there any way to have a temporary website being shown, just a static one showing "Right now we're upgrading our systems" or something?
Upvotes: 1
Views: 265
Reputation: 7609
If you only have one instance in the "scale" tab, your site will be upgraded while it's running. As @Fabrizio says this will cause unexpected behavior if many files have been changed.
If your site uses .NET you can connect to it via FTP before updating it and add an app_offline.htm
file to the root, which will be displayed to all visitors while the deployment is completed. Then delete the file when it's finished updating.
Alternatively, change the instance count to 2 or more. This will apply the concept of "update domains" used by Azure cloud services, which means the load balancer will route traffic to other instances while each is being updated. However, this approach can cause problems when you do database migrations - you need to make sure any migrations you make are backwards compatible with previous versions of your application's domain. Update: Can't find anything to support this but I assume this behavior is only used in reserved mode because it replicates much of the VM infrastructure.
Update
I've discovered that websites (in shared mode at least) use the ARRAffinity cookie to apply sticky IP load balancing. This means users will be routed back to the same instance on every request when this cookie is present, I can't find anything to determine whether this also applies to requests while an instance is being updated.
Another update
It looks like "instances" in shared mode aren't actually instances, they're worker "threads" that allow you to handle more load. Although this will get you closer to the account limits it will increase throughput. I would therefore expect the filesystem to be shared in shared mode and replicated in reserved mode. However, you still only see one FTP endpoint so it looks like the files you upload are replicated between all instances. Will do some testing and get back on this :)
Yet another update
The files in your FTP are mounted to a network share that is mapped to d:\home\site. This suggests that files are not replicated between instances. Read more here: http://azure.microsoft.com/en-us/documentation/articles/web-sites-available-operating-system-functionality/
Upvotes: 2
Reputation: 2292
If you have a long migration database script to run, the only solutions I see are:
- stop web site (manually or through powershell) and restart at the end of migration
or
- use the app_offline.htm to put your site "offline", run scripts and then remove the app_offline.htm
Upvotes: 1