2

I added all my connection strings to the App Service -> Settings screen.

I'm using Redis to share Sessions between the different instances. Everything is good if I have the connection in the ConnectionString section in the web.config but if I remove it from there and just add it to the Connection string section under the settings screen then it all breaks.

I'm running a classic .net web application on .net 4.7

I've tried the following so far:

  1. Added a connection string in web.config without a value hoping it will overwrite it
  2. Completely removed the connection strings in the web.config file.
  3. Just for a test, I added an extra connection string which I can later retrieve and show on a web page.

How early do the connection strings from azure get applied? Is there a workaround or is this a known issue (haven't managed to find anything about it)?

EDIT: Here is a sample of what I'm trying to do.

I have a connection string called <add name="redis.sessions" value=""/> and a session state provider that points to that connection string <add name="redis" type="Sitecore.SessionProvider.Redis.RedisSessionStateProvider, Sitecore.SessionProvider.Redis" applicationName="private" connectionString="redis.sessions" pollingInterval="2"/> and in the session provider on Initialization it tries to initialise the Redis connection with a blank connection string. Even through one has been provided in the App Service Settings.

marto
  • 4,170
  • 1
  • 28
  • 39
  • `I remove it from there and just add it to the Connection string section under the settings screen then it all breaks.` Could you give more info about `it all breaks`? What info is in the share sessions? It is better that if there is a snippet reproduced demo code. – Tom Sun - MSFT Oct 05 '17 at 08:52
  • @TomSun I updated the answer with more information. I'm just using a custom SessionState provider that fails to initialize – marto Oct 05 '17 at 10:31
  • Sorry I am not familiar with `Sitecore.SessionProvider.Redis.RedisSessionStateProvider`. Have you referenced the [How to create a Web App with Redis Cache](https://learn.microsoft.com/en-us/azure/redis-cache/cache-web-app-howto) and [Microsoft.Web.Redis.RedisSessionStateProvider](https://learn.microsoft.com/en-us/azure/redis-cache/cache-aspnet-session-state-provider). – Tom Sun - MSFT Oct 06 '17 at 08:58
  • This answer says it is not possible... https://stackoverflow.com/questions/26978187/configure-redis-session-state-on-azure – MPavlak Jan 03 '18 at 22:47
  • I too would love this ability to configure the redis connection string in the azure app settings. where to post a request? – MPavlak Jan 03 '18 at 22:48
  • 1
    https://stackoverflow.com/questions/35529052/how-to-define-connection-string-for-session-state-in-azure this works! trick is that it MUST be an app setting. it cannot be a connection string. – MPavlak May 03 '18 at 14:54

0 Answers0