8

I am unable to find the local media cache folder in azure apps, as per the configuration in the Sitecore.config it supposed to be in the Media cache folder under App_data: I checked in the Temp folder, upload folder, App_Data folder, but didn’t find.

enter image description here

Any thought or suggestion?

6

The folders (d:\local\MediaCache and d:\local\temp) are there, but Kudu tools appear to look at a different instance of 'D:\local', and they do not see the files and directories created by Sitecore. It looks like Kudu tools are running in a different but linked sandbox.

You could use the attached example code (showmediacachefolder.aspx) to examine D:\local that is visible by Sitecore and confirm that the folders and files are indeed created. To use showmediacachefolder.aspx page, please copy below code to showmediacachefolder.aspx file to you wwwroot folder of your CM instance and access it by /showmediacachefolder.aspx

<script runat="server">
    private void Scan(string path) {
        Response.Write("<li>");
        Response.Write(System.IO.Path.GetFileName(path));
        Response.Write("</li>");

        if (new [] { "local", "Temp", "MediaCache" }.Contains(System.IO.Path.GetFileName(path))) {
            Response.Write("<ul>");
            foreach (var directory in System.IO.Directory.GetDirectories(path)) {
                Scan(directory);
            }
            int count = 0;
            foreach (var file in System.IO.Directory.GetFiles(path)) {
                if (++count > 10) {
                    Response.Write("<li>...</li>");
                    break;
                }
                Response.Write("<li><i>");
                Response.Write(System.IO.Path.GetFileName(file));
                Response.Write("</i></li>");
            }
            Response.Write("</ul>");
        }
    }
</script>

<ul>
<%  
    Scan(@"D:\local");
%>
</ul>
  • Thanks, I am able to see the media cache( under folder /MediaCache) using this script, You are correct, seems like Microsoft issue to expose this folder in the Kudu properly – Ashish Bansal Nov 11 '17 at 15:12
  • I ended up expanding on this tool a little to allow browsing the temp folder in more depth, in case anyone runs across this later: gist.github.com/sincladk/2c8138279a9cbaa80458a87be8f7ca72 – Dan Sinclair May 31 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.