How to configure Web role on Azure Compute Emulator to work like local IIS (static URL) - iis

So, the question is how to configure Web role on Azure Compute Emulator to work like on local IIS? By this I mean, that, the web role have the fixed url (like you can in project properties set the "Use Local IIS Web server" and set the fixed url)?
How to set Azure Compute Emulator to work on static url or at least at static port?
Is is really annoying that everytime I start the web role I have different url (port)!

The answer is that you cannot run it on a static port, but it should run on the first available port in its port range (starting at 80 and incrementing until it finds a free port). If it increments with every "debug" session starting, then it's because the previous emulator didnt teardown completely before you started a new one.
There are some ideas how to fix this issue here:
http://social.msdn.microsoft.com/Forums/en/windowsazuredevelopment/thread/ae2df7e0-5005-4bcd-8b69-bb53323eb589

Check out this solution from Michael Collier [a fellow Windows Azure MVP]

Related

Azure Mobile Services on Local IIS rather than IIS Express

OK, I've created an Azure Mobile Services project in Visual Studio 2013.
I run it up as-is, then in the browser I test it by adding a todo item via the simple browser app that seems to get baked into these service projects. It gives me a '201 success' message - brilliant.
I then convert the project from IIS Express to Local IIS as the web host, recompile and try again, and although I get the same smiley face app telling me that everything is OK, when I try and add a todo item I get a 404 error. This is contrary to the Microsoft article that gives these instructions, which clearly says I am able to choose either IIS Express or Local IIS when setting up the project.
My guess is that web.config is missing something when this project runs on the local IIS server.
I'm hoping someone already has a solution before I spend hours trying to work out how to configure IIS for this type of project.
I've already wasted a load of time working through loads of bugs and gotchas with Azure Mobile, and I'm starting to run out of steam - so I'm hoping someone can help me before I go and grab an account at Parse.com
Many thanks in anticipation.
Dean
The easiest approach for your situation might be to just deploy to the cloud, and use that service for your testing. Visual Studio 2013 Update 2 makes it easy to deploy your app and connect to it for remote debugging. It is a little slower than using a local instance, but you are also assured that there will be no surprises when you eventually go live (since you are live the whole time).
That said, we will investigate the issue you are seeing with using IIS directly. Some things you might want to try on your own:
Verify that you can view the web side from your Mac's browser, to make sure that the firewall is letting the requests through.
Try using the "Getting Starting" link from the smiley-face page, to see if the REST endpoints are behaving correctly.

Azure website node process lifecycle

I 've found out that Azure websites (trial version) doesn't autostart my node sever process (it starts only when I load the url in the web browser); and that when there are no requests in a while, the process is killed.
I mean, when I git push my server, I would like it to start running immediately and continuously.
I read (here, for example) that this might have to do with the way iisnode manages azure websites, and that I can't do anything to change it. Is this the actual way Azure websites work? Is there any way I can deal with this?
Thanks in advance,
Bruno.
You've find the answer. There is no other answer.
The process termination because of inactivity comes from IIS - there is Idle Timeout setting. Which to my knowledge is not configurable in Azure Web Sites (at least not Free tier). Check out also this SO question and its answer to get better understanding on why you can't change this timeout on the FREE and STANDARD tiers.
And here is an interesting workaround to avoid this idle timeout. Actually if you use technique, you will also have kind-of "auto start", in terms that when your scheduler hits your site after a new deployment, it will "boot up".
This can get a little complicated, but if you don't want to use their 5-min ping service, you can keep these always on by doing the following:
Create an app setting on your website configuration tab within the portal:
WEBSITE_PRIVATE_EXTENSIONS and give it a value of 1
Create a text file named applicationhost.xdt and populate it with:
<?xml version="1.0"?><configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"><system.applicationHost><applicationPools><add name="DefaultAppPool" managedRuntimeVersion="v4.5" startMode="AlwaysRunning"><processModel identityType="ApplicationPoolIdentity" /></add></applicationPools></system.applicationHost></configuration>
ftp into your website and create a folder on the root directory called Site Extensions. (there should now be 3 folders in your root: LogFiles, site, & SiteExtensions)
Create another folder within 'Site Extensions', named ASPLimits
Upload the applicationhost.xdt into the ASPLimits folder
Restart your website using the portal

Binding an IIS website to a second ColdFusion instance

I have a Windows 2008 R2 server, IIS7, Coldfusion 9.0.2. I created a 2nd CF instance, created an IIS website, used the web server configuration tool to bind the IIS website to the CF instance. Restarted IIS & CF windows services. It does not work as expected. It does not look like the IIS website is actually bound to the 2nd CF instance. With both the Windows IIS service and the new CF service running, I am able to hit the website and click around it.I then stop the CF service and the website still works. I would expect the website to not work when the CF Windows service was stopped. Any ideas as to what is going on?
Thanks ~Joe~
Here are the steps I did to create everything
CF admin > instance manager > Add New Instance with create Windows service option
create the website in IIS
remove the windows CF service
create a windows service and configure it to use a separate jvm.config file
restart IIS & CF services
use the web server configuration tool to bind the new CF instance to the new IIS website and checked off to configure web server for CF9 applications
possible reasons are
1) web config tool created a new connector but it points to wrong instance.
2) your website is using the wrong connector
3) the website is inheriting the global connector instead
every time you use the web config tool to enable cf on a site it creates a new connector. this doesn't serve much purpose if you have once instance, so for reference you are better off to just add the handlers manually and use existing connector.
for multiple instance, you only need to use the web config tool ONCE to create the new connector, then just add handlers manually to any site you want to use that connector.
this way you only have as many connectors as you have instances, so it doesn't get confusing.
first we need to check which connector your site is using, so go into iis and check the cfm wildcard handler, and see what connector it points to, it should be different than your other site.
so your first site should for example be using the conenctor in
C:\ColdFusion9\runtime\lib\wsconfig\1
and 2nd site using C:\ColdFusion9\runtime\lib\wsconfig\2
the numbers will differ according to how many times you have used web.config though.
in these connector folders open the file jrun_iis6_wildcard.ini
and look at the line
bootstrap=127.0.0.1:51011
the proxy port should be different for multiple instances.
so on the connector for instance2, it should have a different port than the connector for instance1, if not, if you have any other connectors, then check the rest as well.
If they all have the same port, then they are all pointing to the same instance.
In which case, you simply need to change the port for the conenctor that SHOULD be pointing to instance2.
Generally CF just increments the port for each instance, so if it says 51011 then change it to 51012 and it should be working.
You should also make sure instance 2 is running by connecting to it using the built in web server, if you look in your cfadmin in the instance manager, it will have a link to open the cfadmin for each instance on the native port.

OAuth callback URI changes port number in Azure emulator

I've developed a working solution using Azure SDK October 2012. It connects to another service that uses OAuth. When I move my solution to a machine using Azure SDK 2.1, the OAuth callback fails because the port number has changed.
For example, when I debug the solution it opens a browser at 127.0.0.2:82. Then I connect to the other service, and the callback comes to 127.0.0.2:83, which the browser can't find. Prior to being redirected to the other service, I can see that the controller is looking at the Request object and getting the invalid port # (83) from that.
I'm not a MVC or Azure whiz, but this solution works perfectly under the older version of the SDK. Did something change? btw I've tested this with IE10 and Chrome, so it's not a browser issue.
Just to be clear - I have the exact same solution running on 2 machines. One works, and the other doesn't. So it's not a problem with my code, unless there's something that explicitly needs to change for Azure SDK after October 2012.
The Oauth2 app has been configured to redirect on specific site + port, so either you need to reconfigure the Oauth2 configuration in the OAuthProvider
or else see why the emulator locally is binding to a different port. Maybe the other port is being used by some other site running in the emulator. Sometimes just restarting the emulator does the trick.
See this to understand how the local emulator works.
I was missing the [Authorize] attribute on the controller method that was looking at the Request object. When I added that, the port number problem went away.
Still not sure why it worked on one dev machine and not the other (or with one version of Azure SDK and not the other), but now it works on both, so there you have it.

Creating Web-Site and Web Application in IIS

Till date, I was thinking that we always create/host web-site in IIS.
But I was going through powershell tutorial today which says it is different to create web-site and a web application.
This is the tutorial link (check different section on creating web site and application) -
http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools/
Can please guide what is the difference between the two.
Any example will be really helpful.
Thank you!
A web site in IIS is the top level under Sites. The default one that is normally automatically created for you when installing IIS is named "Default Web Site".
This is the "root" that runs on port 80.
Under that, you can create virtual directories, which is basically sub-levels under the root web site, or you can create separate web applications that lives as separate applications under the root level.
A web application must live under a web site.
It is possible to create other web sites that can either be set up to run on other ports (i.e. 81), or to be named with a different host name which enables multiple sites to run on same port number. If named with a different host name, this name must be registered in a DNS server somewere to point to the IP address for your server. A workaround is also to to add it as an entry in the hosts file on the client computer that should access it.
This is example on how it looks in IIS Manager:
I have a script I use when creating a website and AppPool in IIS 7+, .net4, Integrated pipeline and thought you might find it useful.
Use it as so:
CreateSite.ps1 [WebsiteName] [AppPoolName] [Port] [Path]
If you are reinstalling the site, you will need to Stop it first. That is done as so:
StopSite.ps1 [WebsiteName] [AppPoolName]
you can grab the scripts from my gist
Update I have added/extended the scripts and put them in their own Github repository
Here is my CreateWebsite PowerShell script: http://www.zerrouki.com/create-website/

Resources