webrole

Environment.GetEnvironmentVariable(“RoleRoot”) returning null when called in a WebRole

ⅰ亾dé卋堺 提交于 2019-12-03 14:40:13
I have a method (in a separated class library) which is called by a WebRole and a WorkerRole. This method contains the path of a file, which is returned using Environment.GetEnvironmentVariable("RoleRoot") , as follows: private string FooPath() { string appRoot = Environment.GetEnvironmentVariable("RoleRoot"); return Path.Combine(appRoot + @"\", @"approot\file.foo"); } When I call this method from a WorkerRole the path is returned normally. But when I call it from a WebRole I get null . Any ideas? EDIT: I am using APNS-Sharp to send push messages to iOS and it requires a .p12 certificate in

Force Application Start on Azure Web Role

孤人 提交于 2019-11-29 07:27:07
I have a web role on azure and I would like to force a Application_Start without waiting for the first request. I managed to set the "Start Automatically" property to true on my site AutoStart a WCF on Azure WebRole But the Application_Start is not called until the first request comes. I don't know exactly if I am missing something important here. The server is a W2008 R2 and the IIS version is 7.5 Thanks! SOLUTION I put the solution code here. I hope will help someone. I just added a WebRole.cs and just put that code to perform a ping every 30 seconds. Please netice I'm browsing Service.svc

What's the difference between the webrole onStart() event and Application_Start() global.asax event?

半世苍凉 提交于 2019-11-29 04:03:57
I'm just starting to get my feet wet learning the technical details of Azure, so apologies if this is a silly question. If I create a cloud service project in visual studio and add a webrole for an mvc application, within the mvc application I can see the "WebRole.cs" file. However, when I start with an MVC application as the starting point, and later want to enable it for Azure, by right clicking on the project and selecting "Add Windows Azure Cloud Service Project", no WebRole.cs is created. So where would I go to make things happen on the start event of the WebRole? The Application_Start()

Force Application Start on Azure Web Role

喜夏-厌秋 提交于 2019-11-28 00:46:40
问题 I have a web role on azure and I would like to force a Application_Start without waiting for the first request. I managed to set the "Start Automatically" property to true on my site AutoStart a WCF on Azure WebRole But the Application_Start is not called until the first request comes. I don't know exactly if I am missing something important here. The server is a W2008 R2 and the IIS version is 7.5 Thanks! SOLUTION I put the solution code here. I hope will help someone. I just added a WebRole

What's the difference between the webrole onStart() event and Application_Start() global.asax event?

徘徊边缘 提交于 2019-11-27 18:02:28
问题 I'm just starting to get my feet wet learning the technical details of Azure, so apologies if this is a silly question. If I create a cloud service project in visual studio and add a webrole for an mvc application, within the mvc application I can see the "WebRole.cs" file. However, when I start with an MVC application as the starting point, and later want to enable it for Azure, by right clicking on the project and selecting "Add Windows Azure Cloud Service Project", no WebRole.cs is created