Azure slots. External folder for logs and files?
a
We are migrating a site to azure and would like to use deployment slots. Currently we deploy updates to a staging slot and then swap them. When we swap the slots, the umbraco folder is also swapped, including the caches and log files. This coould lead to corrupted indexes. Is it possible to use an external storage for the umbraco log and cache files?
d
Hi there! We use this approach a lot. In my experience, corrupt caches and indexes are very rare, as long as you follow the guidelines for hosting in azure from the Umbraco docs
That being said, logging in Umbraco is done with serilog. Serilog has a lot of providers that you can chose from. Other files you really don't need to worry about
k
I don't understand why swapping the cache and log files would potentially corrupt indices. Surely the "Azure mode" in Umbraco would handle the index-vs-cache in a way that prevents this? Is this a known problem? We use Azure for all Umbraco and haven't seen this but don't really slot-swap in the way it sounds here. But now you got me worried. 🙂
d
Following up on @D_Inventor and @kdx-perbol I have been using deployment slot swapping on Azure for years with Umbraco from 7-13 with no issues.
j
This is kind of a known issue, but it doesn't seem to affect everyone and I don't think anyone really knows why. Firstly, be sure to use the settings here: https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/azure-web-apps Secondly, if you're running v13.2+ try setting the "SiteName" in appsettings to a different value for each slot.
Copy code
json
  "Umbraco": {
    "CMS": {
      "Hosting": {
        "SiteName": "SomethingUniqePerSLot"
This will force indexes to be stored in different locations. Without it the indexes can get locked because of how Azure warms up slots for swapping. You can see the full details in the PR here. https://github.com/umbraco/Umbraco-CMS/pull/15571
d
I wasn't aware of this issue so thanks for the tip @Jason
a
Do I need to set up load balancing for this to work? I see these error messages in the log now again after a swap Lucene.Net.Index.CorruptIndexException at Lucene.Net.Index.SegmentInfos.Read invalid deletion count: 630 vs docCount=9 (resource: BufferedChecksumIndexInput(MMapIndexInput(path="/home/site/wwwroot/umbraco/Data/TEMP/ExamineIndexes/MembersIndex/segments_en")))
k
j
No need for load balancing. This particular issue can affect both load balancing and slot swapping because for a very brief moment when slots are swapped Umbraco may try and write indexes to the same location.
43 Views