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...
Please Do read the question before replying randomly...
Any way thanks for reply...
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.
2012年4月29日 2:05You 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.
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....
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.
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.
Mark As Answer if it helps you | My Blog
- 編集済み kunal chandratre 2012年5月11日 5:23
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.