1

Closed

Bug/Problem when using CDF 1.4 with Umbraco in Azure

description

When running Umbraco on Azure (setup with the Windows Azure Umbraco Accelerator), the App_Data folder is placed in the storage account and gets replicated to all servers/instances. The App_Data\Temp folder is excluded from the replication so this is where I put the CDF generated composite files (compositeFilePath="~/App_Data/Temp/ClientDependency" parameter in clientdependency.config).

The map files however are always written to the App_Data\ClientDependency folder. So in a load balanced environment /Azure the are 2 (in my case 2 instances) different files. This leads to unexpected and unwanted situations in which the Umbraco Backoffice is not working well.

If the map file is placed in the same \App_Data\Temp\Clientdependency folder, the desired behavior is achieved: no unnecessary replication of generated files and a working environment on each server/instance.

To put the map file in the \App_Data\Temp\Clientdependency folder, line 33 of the file XmlFileMapper.cs can be changed from
private string _fileMapVirtualFolder = "~/App_Data/ClientDependency";
to
private string _fileMapVirtualFolder = "~/App_Data/Temp/ClientDependency";

Even nicer would be if the value for this would be read from the composite FilePath parameter I mentioned earlier.

No files are attached

Closed Jan 20 at 2:38 PM by irobinson

comments

vnbaaij wrote Jan 19 at 11:54 AM

Ok, should have looked at the source a little better. It turns out you can already set the folder through config. Add the following to the clientdependency.config compositeFiles section:
<fileMapProviders>
<add name="XmlFileMap"
type="ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper, ClientDependency.Core"
mapPath="~/App_Data/Temp/ClientDependency"/>
</fileMapProviders>

I've kept the original description so googling/binging for clientdependency + azure leads to this solution.