SQL AZURE as Session State provider Configuring in Web.config

Unanswered SQL AZURE as Session State provider Configuring in Web.config

  • Tuesday, April 03, 2012 11:14 AM
     
     

    Hi ,

    It is suggested by Azure Programming model on Web Roles the setting that we want to be configurable at runtime should be added to the Service Configuration file... Since any change to web.config requires redeployment...

    Is  there any way to configure the SQL Azure session provider in sevice configuration file... Or still we have to live with putting it in web.config file...

    Regards,

    Anshul

All Replies

  • Wednesday, April 04, 2012 1:14 AM
     
     
  • Wednesday, April 04, 2012 5:09 PM
     
     

    Please Do read the question before replying randomly...

    Any way thanks for reply...

  • Thursday, April 26, 2012 1:22 PM
     
     

    Hi Anshul.Rastogi,

    Have you successfull in using the SQL AZURE as Session State provider, If you are can please share the code of how to set up to use the SQL Azure as session state provider.

    After googling for some time we are able to find that some thing called ASP.NET Universal providers are there that uses SQL Azure as session state, almost every blog is shown this link. hanselman link

    We can also use SQL Azure as session state by following this link it seems that we need to execute the legacy scripts with modified version, legacy link

    Please let us know if you can help us in this issue, we are also based in hyderabad.

    Thanks

    sivakumar.

  • Sunday, April 29, 2012 2:05 AM
     
     
    You can't set the session provider in the service configuration file; the session provider is a property of the application, not the service. You could change it an run time if you have a requirement for that, but otherwise, static configuration in web.config is the standard approach.

    Check out my book: Ultra-fast ASP.NET: Building Ultra-Fast and Ultra-Scalable Websites using ASP.NET and SQL Server

  • Monday, April 30, 2012 9:51 AM
     
     

    Issue is only if i need to change the password of my DB then do i need to rebuild the code for it and redeploy ????

    Changing the password is very common scenario...

    As you said that web.config is standard practice but recommended practice on Azure is that if any thing you want to change at run time then add to Service Configuration file....

    Regards,

    Anshul

  • Monday, April 30, 2012 10:51 AM
     
     

    Hi,

    AFAIK, you can pass the connection string in the service configuration file and update web.config with the appropriate connection string. This connection string can be used in the web.config for session state management. On how to update connection string in web.config from the service configuration file, please check out the link: http://blogs.msdn.com/b/benko/archive/2012/03/29/cloud-tip-1-how-to-set-a-connection-string-programmatically-at-runtime-in-windows-azure.aspx 

    I hope it helps!! 


    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful". Thanks! Vaibhav Gujral.

  • Friday, May 11, 2012 5:22 AM
     
     

    Hi Anshul,

    WE can configure the connection string in Serviceconfiguration.cscfg and in application_start event we can update web config with this connection string at runtime so that, <sessionstate> tag can get the connection string value.

    For details please see the link - http://sanganakauthority.blogspot.com/2012/05/using-sql-azure-for-session-state.html

    This link talks exactly what you are talking about.

    Hope it helps.

    Regards,

    kunal


    Mark As Answer if it helps you | My Blog


  • Friday, May 11, 2012 3:27 PM
     
     

    Hi,

    As per my knowledge ,we can keep DB connection string in service configration file  even we implemented in one of the project.

    but i dont think we can keep sql session provider in service configration file.


    cpsingh