Azure LocalCache not setting the Ready environment variable on ASE
Asked Answered
S

2

4

I have moved my WebApp to the Azure App Service Environment and have enabled the new LocalCache option as documented at https://azure.microsoft.com/en-us/documentation/articles/app-service-local-cache/

Proof of AppSettings options

However, the environment variable that is supposed to tell you that the cache is ready does not exist.

If I use Kudo and go to Process Explorer, Click on properties for the w3wp (without the scm label) process, then click on Environment Variables the only variables I see are:

WEBSITE_LOCAL_CACHE_OPTION  Always
APPSETTING_WEBSITE_LOCAL_CACHE_OPTION   Always
WEBSITE_LOCAL_CACHE_SIZEINMB    1000
APPSETTING_WEBSITE_LOCAL_CACHE_SIZEINMB 1000
WEBSITE_LOCALCACHE_ENABLED  True

But not the one I need:

WEBSITE_LOCALCACHE_READY

Kudo Process Environment Variable List

I am stuck as to what is happening; can anyone give any ideas for me to try?

Sonde answered 6/4, 2016 at 18:33 Comment(0)
S
1

Local Cache is a feature which is not currently enabled in App Service Environment.

Swop answered 13/4, 2016 at 17:7 Comment(3)
Perhaps you need to inform Azure Support who suggested i enable Local Cache due to the large amount of 'transient' downtime webapps seem to get; and update the documentation.Sonde
Why was this downvoted? It may not be the answer you want, but it's certainly a helpful answer, at least for me!Hiroshima
Because the feature IS Available in an ASE, so its a misleading comment.Jacklighter
J
5

The correct answer here is this:

As the documentation you referenced mentioned:

How can I tell if my site has switched to using Local Cache?

If you're using the Local Cache feature with Staging Environments, the swap operation does not complete until Local Cache is warmed up. To check if your site is running against Local Cache, you can check the worker process environment variable WEBSITE_LOCALCACHE_READY. Use the instructions on the worker process environment variable page to access the worker process environment variable on multiple instances.

You stated: If I use Kudo and go to Process Explorer, Click on properties for the w3wp (without the scm label) process, then click on Environment Variables the only variables I see are:

WEBSITE_LOCAL_CACHE_OPTION Always

APPSETTING_WEBSITE_LOCAL_CACHE_OPTION Always

WEBSITE_LOCAL_CACHE_SIZEINMB 1000

APPSETTING_WEBSITE_LOCAL_CACHE_SIZEINMB 1000

WEBSITE_LOCALCACHE_ENABLED True

This environment variable WEBSITE_LOCALCACHE_READY is part of the "Worker Process", not the host process w3wp.exe

You need to get a memory dump of the worker process as outlined here: https://github.com/projectkudu/kudu/wiki/Process-Threads-list-and-minidump-gcdump-diagsession#process-environment-variable

Start with:

GET /api/processes/0 => detail process information of scm site's w3wp.exe. Or use -1 for main site. https://(kudu-site).scm.azurewebsites.net/api/processes/0 (Shows the w3wp.exe process)

The "main site" is the worker process. https://(kudu-site).scm.azurewebsites.net/api/processes/-1

This shows a full process dump, in the contents you will see your variable: "WEBSITE_LOCALCACHE_ENABLED":"True","WEBSITE_LOCALCACHE_READY":"TRUE"

I have this running in an ASEv2 as well, so I don't think the comment earlier from cory-fowler that this isn't supported in an ASE is correct. Maybe it was when he wrote it, but currently it is supported.

Jacklighter answered 15/11, 2017 at 17:12 Comment(4)
I guess you can change that url.. when i said {kudu-site} I meant whatever.scm or I would have just said {site}.scmJacklighter
So maybe the best answer would be: https://(sitename).scm.azurewebsites.net/api/processes/-1Jacklighter
Yeah I think https://(sitename).scm.azurewebsites.net/api/processes/-1 would make it easier! Great write up by the way! Love itMastership
Keep in mind this feature appears not to be supported when you use the run-from-package deployment method. learn.microsoft.com/en-us/azure/app-service/…Wallinga
S
1

Local Cache is a feature which is not currently enabled in App Service Environment.

Swop answered 13/4, 2016 at 17:7 Comment(3)
Perhaps you need to inform Azure Support who suggested i enable Local Cache due to the large amount of 'transient' downtime webapps seem to get; and update the documentation.Sonde
Why was this downvoted? It may not be the answer you want, but it's certainly a helpful answer, at least for me!Hiroshima
Because the feature IS Available in an ASE, so its a misleading comment.Jacklighter

© 2022 - 2024 — McMap. All rights reserved.