Setting up the Application in IIS
Assuming you have just installed IIS. Stop the default web application.
Add a new website for our application.
Specify a web site name – and select the path C:\www\intranet-app1 (the path we shared earlier in part 2).
After clicking “OK” you will get a warning about port 80’s binding. This can be ignored as we have stopped the default web site that was using it.
At this point if you try to access the application it will show an authentication error:
We need to do some further setup to allow our chosen Authentication method. Enable kernel mode authentication on the Intranet-App1:
Enable Windows Authentication
Next Browse to the website – and you should be prompted to perform a domain login: (If you log straight in without being prompted, it may be because you are already logged into the domain, in that case start a private browsing session and retry.)
You should now see the website page you created in Visual Studio
Up to this point you have an application running on your Intranet, authenticating using your own Active Directory credentials.
In Part 4 we’ll enable Azure Application Proxy to make this application securely available to external (Internet) users.
To perform these steps, you’re going to need a domain joined Windows Server with IIS installed.
There are a few different ways to deploy a web application, perhaps the simplest is to deploy it using a file share.
Create a root folder for your IIS web site (C:\www) and within this root folder create and share a sub-folder for the intranet-app1 application we have just built:
Map the share to ta network drive on the machine you’ve used for Visual Studio
In the main Visual Studio window – select the Intranet-app1, right click and select Publish …
In the Publish dialog box select the Custom option, enter a new custom profile name, click OK and then click Next
Now select File System as the publish method and set the target location to the file share network drive location we set up previously. Click Publish
If you now resize the Output window in Visual Studio you should see the web application deploying successfully.
In Part 3 we’ll configure the IIS server to support our authentication choice.
Part 1. Creating a simple application in Visual Studio
If you don’t already have Visual Studio you can download and install the community edition for free from here.
Start Visual Studio and create a simple web application:
When Visual Studio has started select File -> New -> Project
Then select a ASP.NET Web Application, ensure Application Insights is not selected, enter a name for your project (“intranet-app1” in my case) and click OK.
On the next screen select Web Forms unselect the Host in the Cloud button if it is selected and then click the Change Authentication button.
In the Change Authentication dialog – select the Windows Authentication option and click OK
Back on the select a template box click OK
Next on the main Visual Studio workspace select Default.aspx from the Solution Explorer window on the right hand side. Right click and select View Designer
In the main window for Default.aspx – click around ASP.NET and change the default text to something you will recognize.
Finally Build (or Rebuild) the solution
Now we’re ready to Publish this application which is covered in Part 2