Umbraco as a Cloud Service in Azure, losing templates after redeploy
So I have set up an Umbraco installation on a Windows Azure Cloud Service. This all went okay, I set up Umbraco locally (with the Azure SQL db) and then used a TFS link to publish the whole thing to Azure. I used a Starter Kit as well.
When publishing for the first time, I had to make sure to re-include all of the files and templates created by the Starter Kit into the project, or the published site would be empty. So afterwards I had a new Umbraco installation with a Starter Kit ready to go on a Windows Azure Cloud Service. I created a custom document type and template and all went well. So far so good.
I decided to try and test multiple instances and Session Caching by using the NuGet Package Manager in Visual Studio and editing the Web.Config file. I checked in the changes to the TFS server, and it built the solution succesfully. It deploys to the Cloud Service as well, but the custom document type and template were gone. They were still listed in the back-end of Umbraco, but they had no content in them. The database however did contain the pages with their content, so I kept investigating.
I suppose the problem is that when Visual Studio or TFS deploys to a Cloud Service, the previous version of Umbraco gets deleted and replaced, so the master page of the custom template for example, no longer exist in the file system (I checked this via Remote Desktop). My guess is that the pages get listed, because they still exist in the database. No content is displayed however.
Does anyone have any idea on how to synchronize custom content to the TFS or local solution, so that the project can be deployed again without losing the custom pages? Perhaps only publishing a part of Umbraco? Or a better idea how to manage this on a Windows Azure Cloud Service?
Edit: Only solution I can come up with is that users edit templates etc locally, include them in their project and then upload them to TFS... But this is not very user friendly.
Basically it turns out that using Umbraco as a cloud service is not possible at the moment, because cloud services on Windows Azure do not support persistent changes in the file structure...
Have you tried using Azure Websites instead? If a folder isn't included in your Visual Studio solution, other folders like the media folder will stay put.
Have you thought about using AWS? You could then have a single S3 bucket attached to your Umbraco installs. That said it must be possible to do the same in Azure using their storage.
At the Umbraco UK Festival Darren Ferguson stated that the current based approach to having Umbraco installed via Azure is with websites (using 1 website purely for back-office editing).
Yeah I think that would David. Although you'd have to attach the S3 bucket as a virtual directory. Same applies for Azure Storage. Otherwise, image references within data types such as the Rich Text Editor will only reference the local media folder. I don't think there is a way to override where the RTE pulls images from.
You can mount persistent drives based on Azure Blod storage to your web services. Setting such a drive as the drive to persist your changes should work without hassle, but you will have to tell azure the other drive you are using for the media and templates you are using.
I don't update templates on the server, I prefer using Visual Studio to alter my templates, and republish the site. The Media folder is the only folder I have on azure blob storage.
I am using Azure Websites right now, but the only thing I'm worried about now is scaling. Now I haven't been able to properly load test the site, and I can't find statistics on how Azure Websites handle different load levels, so I hope it will be enough. Does the Azure Cache work with an Umbraco Azure Website? I got it to work on a cloud service, and my sessions were succesfully handled. Guess I have some more testing to do :)
You may struggle to scale your Azure Website out to multiple instances. Umbraco Distributed Calling requires a predefined list of machine names/IP addresses in order to talk to other instances. As you won't know this list within your Azure Website on deployment, it will be hard to implement such a feature.
You will however, be able to scale your Azure Website up. For example, increase a single instance's memory or processing power. If you scale up rather out, you shouldn't encounter any caching issues. The only downside with this approach is that you are limited to only one instance wthin your Azure Website.
Also consider if the issue is automatic scaling or manual. If you don't need to cater for unexpected spikes then there is nothign to stop you manually adding and removing VMs as your site becomes more popular.
Umbraco as a Cloud Service in Azure, losing templates after redeploy
So I have set up an Umbraco installation on a Windows Azure Cloud Service. This all went okay, I set up Umbraco locally (with the Azure SQL db) and then used a TFS link to publish the whole thing to Azure. I used a Starter Kit as well.
When publishing for the first time, I had to make sure to re-include all of the files and templates created by the Starter Kit into the project, or the published site would be empty. So afterwards I had a new Umbraco installation with a Starter Kit ready to go on a Windows Azure Cloud Service. I created a custom document type and template and all went well. So far so good.
I decided to try and test multiple instances and Session Caching by using the NuGet Package Manager in Visual Studio and editing the Web.Config file. I checked in the changes to the TFS server, and it built the solution succesfully. It deploys to the Cloud Service as well, but the custom document type and template were gone. They were still listed in the back-end of Umbraco, but they had no content in them. The database however did contain the pages with their content, so I kept investigating.
I suppose the problem is that when Visual Studio or TFS deploys to a Cloud Service, the previous version of Umbraco gets deleted and replaced, so the master page of the custom template for example, no longer exist in the file system (I checked this via Remote Desktop). My guess is that the pages get listed, because they still exist in the database. No content is displayed however.
Does anyone have any idea on how to synchronize custom content to the TFS or local solution, so that the project can be deployed again without losing the custom pages? Perhaps only publishing a part of Umbraco? Or a better idea how to manage this on a Windows Azure Cloud Service?
Edit: Only solution I can come up with is that users edit templates etc locally, include them in their project and then upload them to TFS... But this is not very user friendly.
Basically it turns out that using Umbraco as a cloud service is not possible at the moment, because cloud services on Windows Azure do not support persistent changes in the file structure...
Have you tried using Azure Websites instead? If a folder isn't included in your Visual Studio solution, other folders like the media folder will stay put.
Have you thought about using AWS? You could then have a single S3 bucket attached to your Umbraco installs. That said it must be possible to do the same in Azure using their storage.
At the Umbraco UK Festival Darren Ferguson stated that the current based approach to having Umbraco installed via Azure is with websites (using 1 website purely for back-office editing).
Yeah I think that would David. Although you'd have to attach the S3 bucket as a virtual directory. Same applies for Azure Storage. Otherwise, image references within data types such as the Rich Text Editor will only reference the local media folder. I don't think there is a way to override where the RTE pulls images from.
You can mount persistent drives based on Azure Blod storage to your web services. Setting such a drive as the drive to persist your changes should work without hassle, but you will have to tell azure the other drive you are using for the media and templates you are using.
I don't update templates on the server, I prefer using Visual Studio to alter my templates, and republish the site. The Media folder is the only folder I have on azure blob storage.
I am using Azure Websites right now, but the only thing I'm worried about now is scaling. Now I haven't been able to properly load test the site, and I can't find statistics on how Azure Websites handle different load levels, so I hope it will be enough. Does the Azure Cache work with an Umbraco Azure Website? I got it to work on a cloud service, and my sessions were succesfully handled. Guess I have some more testing to do :)
You may struggle to scale your Azure Website out to multiple instances. Umbraco Distributed Calling requires a predefined list of machine names/IP addresses in order to talk to other instances. As you won't know this list within your Azure Website on deployment, it will be hard to implement such a feature.
You will however, be able to scale your Azure Website up. For example, increase a single instance's memory or processing power. If you scale up rather out, you shouldn't encounter any caching issues. The only downside with this approach is that you are limited to only one instance wthin your Azure Website.
Also consider if the issue is automatic scaling or manual. If you don't need to cater for unexpected spikes then there is nothign to stop you manually adding and removing VMs as your site becomes more popular.
is working on a reply...