Dude, Where's My Upgrade Folder?

The upgrade folder is a great place to have handy during the installation of a package. It will hold information and items related to what you just installed, like logs, backup of files, what was deleted, etc. While browsing about a new Sitecore Managed Cloud installation I couldn't find it, so just to be safe I went looking before any critical packages were installed.

Normally you'd find this folder under temp\__Upgrade of your site, so that's the first place to look. It would be created automatically after first package installation if it was missing for some reason, but having already installed some packages, I knew this wasn't the issue. The next thing to do was check the configuration of Sitecore at /sitecore/admin/showconfig.aspx, where the following path was found:

<sc.variable name="tempFolder" value="d:\local\temp" patch:source="Sitecore.Settings.Azure.config"/>

So, I was expecting to see “/temp/” here, but it's not unusual to see Azure changes in this case. No problem! Let's just run over to Kudu and have a look at the local directory. So here's the only place where it gets confusing. The d:\local\temp folder as set in the config file doesn't have the __Upgrade folder. I ran another installation while monitoring the logs and still, I see no reason why this isn't visible in Kudu.

So Where's the Folder?

It seems that temp folder in Sitecore is configured to use the local cache on Azure by default. This can be enabled by manually specifying the environment variable in the application settings of the app service, but Sitecore will not be able to support such a change in case issues occur.

Patching this temp path back to /temp will rectify the issue. Since Sitecore.Settings.Azure.config already exists, a lower path must be created. Creating the following patch file in <website>/App_Config/Include/zzz/ will take as the final setting for this value. 

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"></configuration><configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
        <sc.variable name="tempFolder" role:require="(PROD or UAT) and CM">
            <patch:attribute name="value">/temp</patch:attribute>

A Role is defined in this example as we have other environments not needing this change. 

The folder was created and populated after this config was deployed and a test package installed. All is well!