How to Solve Problem Deploying a WebRole with Windows Live ID Authentication to the Azure Cloud?
Separate registrations are required for the Development and Cloud Fabrics because you can’t change the domain of the Return URL in either of the two registrations. This is a serious PITA.
The Default.aspx page’s DefaultPage class uses static WindowsLiveLogin wll = new WindowsLiveLogin(true); to specify the registration from wll_appid and wll_secret values in Web.config. You can’t edit Web.config in the Azure Development Portal, so I use the StorageAccountInfo.GetConfigurationSetting() method because IntelliSense says that the method “Gets a configuration setting from application settings in the Web.config or App.config file. When running in a hosted environment, configuration settings are read from .cscfg files.
My tests show that the preceding sentence isn't true. See Problems Deploying a WebRole with Windows Live ID Authentication to the Azure Cloud (fully illustrated) for details.
Thanks for any light you can shed on this issue.
OakLeaf Blog
Respostas
Hello, this scenario is working fine for me. Actually if you have specified a value in cscfg, GetConfigurationSetting will always try to get the value there even if you run your application locally. It is when the value in cscfg cannot be found that GetConfigurationSetting will try to get the value from app/web.config. Can you please use Response.Write to output the value you got from GetConfigurationSetting? That will help to verify if the problem is in GetConfigurationSetting or in another place.
Also can you tell me how are you authenticating the user? If you're using the IDLoginStatus Control, the values always come from web.config. IDLoginStatus doesn't have any knowledge about Azure and thus cscfg. Its properties such as ApplicationIDConfigKey
always read values from web.config. So if you want to use IDLoginStatus, you'll have to manually modify the web.config file before publishing the project. This story will get better when ASP.NET 4.0 comes out, where you'll be able to supply different configurations for developing and deploying in the same web.config file.If you're using del/web authentication, can you post some code? For example, for web authentication, are you displaying the login link using the following iframe?
<iframe
id="WebAuthControl"
name="WebAuthControl"
src="http://login.live.com/controls/WebAuth.htm?appid=<%=AppId%>&context=myContext&style=font-size%3A+10pt%3B+font-family%3A+verdana%3B+background%3A+white%3B"
width="80px"
height="20px"
marginwidth="0"
marginheight="0"
align="middle"
frameborder="0"
scrolling="no"
style="border-style: hidden; border-width: 0">
And in code behind:
public string AppId;
protected void Page_Load(object sender, EventArgs e)
{
this.AppId = StorageAccountInfo.GetConfigurationSetting("wll_appid", "", true);
}
Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.- Marcado como RespostaRoger Jennings terça-feira, 30 de junho de 2009 16:19
Lin-Lun's suggestions fixed the problem and the demonstration project is now live at http://oakleaf7.cloudapp.net. Give it a try.
--rj
OakLeaf Blog- Marcado como RespostaRoger Jennings quarta-feira, 1 de julho de 2009 17:50
Todas as Respostas
Hello, this scenario is working fine for me. Actually if you have specified a value in cscfg, GetConfigurationSetting will always try to get the value there even if you run your application locally. It is when the value in cscfg cannot be found that GetConfigurationSetting will try to get the value from app/web.config. Can you please use Response.Write to output the value you got from GetConfigurationSetting? That will help to verify if the problem is in GetConfigurationSetting or in another place.
Also can you tell me how are you authenticating the user? If you're using the IDLoginStatus Control, the values always come from web.config. IDLoginStatus doesn't have any knowledge about Azure and thus cscfg. Its properties such as ApplicationIDConfigKey
always read values from web.config. So if you want to use IDLoginStatus, you'll have to manually modify the web.config file before publishing the project. This story will get better when ASP.NET 4.0 comes out, where you'll be able to supply different configurations for developing and deploying in the same web.config file.If you're using del/web authentication, can you post some code? For example, for web authentication, are you displaying the login link using the following iframe?
<iframe
id="WebAuthControl"
name="WebAuthControl"
src="http://login.live.com/controls/WebAuth.htm?appid=<%=AppId%>&context=myContext&style=font-size%3A+10pt%3B+font-family%3A+verdana%3B+background%3A+white%3B"
width="80px"
height="20px"
marginwidth="0"
marginheight="0"
align="middle"
frameborder="0"
scrolling="no"
style="border-style: hidden; border-width: 0">
And in code behind:
public string AppId;
protected void Page_Load(object sender, EventArgs e)
{
this.AppId = StorageAccountInfo.GetConfigurationSetting("wll_appid", "", true);
}
Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.- Marcado como RespostaRoger Jennings terça-feira, 30 de junho de 2009 16:19
- Hi, Yi-Lun,
Thanks for your detailed response.
I'm using the IDLoginStatus control in the page, not WebAuth, so will switch to the latter in an IFrame. Also, I'll also try removing the three values from ServiceConfiguration.cscfg when running in the Dev Fabric and report the results.
It appears that the GetConfigurationSetting() method's needs some additional documentation.
I'll update the post as I go through the exercise.
--rj
OakLeaf Blog Lin-Lun's suggestions fixed the problem and the demonstration project is now live at http://oakleaf7.cloudapp.net. Give it a try.
--rj
OakLeaf Blog- Marcado como RespostaRoger Jennings quarta-feira, 1 de julho de 2009 17:50

