Azure VM IIS unreachable from public IP / cloudapp.net domain - azure

I just setup a Windows Server VM on my Azure space, but for some reason the IIS that is configured on it isn't available publicly...
I can open the IIS welcome page trough localhost on the server, but no trough visiting the external IP or the cloudapp.net domain.
Something to note is that I actually CAN reach the server trough MSTSC with the external IP adress...
I tried:
Shutting off the Windows Firewall
Opened endpoints on the non-classic management Azure system
I binded the ip's to the cloudapp host
Checked the online Azure documentation

So I resolved it... Don't know if it's supposed to be that way, but be sure that in Azure your "Source port" is defined to be * and not 80, or other.
That will absolutely not work if you're not defining "*".
Screenshot of Azure here

Related

Deploy website on azure virtual machine and access on internet

I want to deploy a website on azure IIS by using server 2016(Azure VM), and want to access it anywhere on the internet. How can I do this?
Which ip address I've to use for this purpose?
There are several steps to acheive this deployment on IIS.
1.Install IIS on azure VM.
https://devblogs.microsoft.com/premier-developer/set-up-iis-on-windows-virtual-machine/
2.Create a website for publish
Please remember to grant permission for authenticated user like IUSR and application pool identity
https://support.microsoft.com/en-gb/help/323972/how-to-set-up-your-first-iis-web-site
3.Set Azure VM firewall to allow your port like 80
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/nsg-quickstart-portal
4.Publish your website.
You could achieve this via simple copy action in Remote desktop or VS web deployment
Just ensure your website can be accessed via telnet or tcping.exe. I remember ping is blocked by Azure VM.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/publish-web-app-from-visual-studio
5.Try to access from both internal IP address and external firewall IP address.
If you could access from internal IP which means your IIS site has been built correctly.
If the website can be access from external. Then you have finished the publish.
6.If you want to access website from public domain.
Then you have to purchase domain name from public domain provider. Then bind your domain to your public IP address on their portal. As long as the website can be accessed from external. It would work with domain name.

Azure VM Webhosting - IIS public access

I am hosting a website on my Azure classic VM, 2012 Server R2. The application is MVC5 installed in wwwroot directory, runs on local host. The site binding type is Http, Port 80, and IP address is all unassigned.
To setup the public access I did the following:
Added endpoint TCP 80 private and public (Azure Portal)
Added inbound rule (firewall) Http port 80, the World Wide Web Services (HTTPS Traffic-In) was already open.
When I try to access the site http://xxxx.cloudapp.net, I get this error: can't reach this page!
Have I missed any step?
Could it be that the site name is configured wrongly in IIS? Is it the default website?
I had to delete the VM and install a new one; however this time I did setup the endpoints before installing the VM, all works now.

Timeout attempting to reach Azure VM

For a pet project I'm attempting to spin up a VM on Azure that can run as my webserver, providing an Umbraco powered site, as well as some other web applications (such as a forum + planner) that require PHP. Now I've followed the steps of every guide out there, but I cannot get an external connection through to the VM's IIS and I can't find out why.
I'm hoping someone else has been through the pain that I'm currently experiencing and might point me in the direction of whatever setting I'm missing.
Spun up the VM with Server 2012 R2.
Configured it to run IIS.
Installed Umbraco, disabling the default web site and setting the Umbraco site as my default on port 80.
Checked that http://localhost maps to Umbraco - this works.
So after I had it running internally, I started tackling the external connection setup.
Navigated to the Network Security group, and added the inbound Http rule on Port 80.
Disabled Windows Firewall entirely for the sake of testing.
Added a custom dns name to the front of the xxx.[azurecloudappurl].com
Now my requests resolve but then timeout and I can't see why or where? Has anyone else experienced this? Every guide states that it should be as easy as this.
As you can visit localhost on your VM env, so it seems there is no problem with your env on VM.
Have you added the endpoint with 80 port of your VM server on Azure manage portal? As by default, the endpoint with 80 port is not opened.
You can refer to How to set up endpoints on a classic Azure virtual machine for how to add an endpoint on Azure VM.
In addition to #Gary Liu's answer if you are doing it on Azure Portal(and not on classic one).
For any new VM added through Azure exists a Network Security Group (NSG). Ports need to be opened in order to make them accessible from outside the VM. Specifically to allow your VM to serve requests coming to port 80 you need to enable HTTP port in Network Security Group. Here are the steps:
Search for VM Name on Azure portal.
Select the VM by Clicking on VM Name.
Click on Network Interfaces from left menu and select(double click) the listed one. This will show overview of Network Interface.
Now click on Network Security Group.
Click on Inbound Rules.
Add new rule selecting service as HTTP(TCP/80).
Voila done!
And here is the answer to manage an inbound rule

Website Setup On Azure VM

I've been running the free trial and am trying to point of my name cheap domain to the vm web site I have created.
I covered the server Ip.
Here are my namecheap settings for the domain.
The covered Ip is the same as above..
Here are my IIS settings
Change the Hostname to my actual domain.
I've also disabled Windows firewall and added port 80 and 443 in the security app hooked to the Azure VM. I can't seem to connect to the website at all. Am I missing something? I've been troubleshooting for hours and cant find anything except basic tutorials and how to do it on the Classic Azure portal.
thank you.
If you are using V1 (old portal/classic) Azure VM resources, then you need to open up the endpoint on the cloud services. All VMs exist as part of a Cloud Service.
From the new portal,
Select the VM (Classic)
Settings
Endpoints
Add the required port (make sure public port is the one you want to use, say 80, and the internal port is the one IIS is listening for)
If you are using V2 resources, you need to add a public IP to your VM before it can be reached from the outside world.
From the new portal
Click on the VM
Open settings
Select Network Interfaces
Select IP Address
Enable public IP (and add a PIP)
Keep in mind that in Azure, all IPs are dynamic. You will want to configure DNS settings against the DNS names provided, and not the IP address (as this will change if you power off the machine). For V1, use the cloud service name. For V2, you are given the option when creating the PIP to have azure assign a DNS name.
For testing, try to telnet on port 80 to the correct DNS name.

Can't get Azure Virtual Machine to serve websites

I've just set up a windows azure VM and installed IIS on it.
When I remote desktop onto the box I can see the default IIS website fine but I can't get this to serve on the web from the IP address of the box.
I've opened up port 80 on windows firewall and also added an endpoint for port 80.
I've tried to access it with the firewall completely turned off also but to no avail...
I cant work out if there is anything else I need to do to get this working?
Add endpoints for port 80 (http) and port 443 (https) to the VM in the Azure portal (tip: this can be automated with powershell or the Azure cli).
Remote desktop to the machine. Open the Windows firewall control panel and allow traffic to port 80 (http) and port 443 (https) or just turn it off ... the firewall is ON by default (tip: can also be scripted through the VM agent / powershell).
Go to the Azure portal and find the cloudapp.net subdomain for your VM (actually the cloud service) your VM is running under. Try accessing the site with that domain. If that doesn't work, try browsing to http://localhost on the server (remote desktop) to make sure IIS works and troubleshoot from there.
Modify the DNS records of your custom domain to use a CNAME to the .cloudapp.net domain. If you need A records make sure to use the public IP of the cloud service (just ping the .cloudapp.net domain to find it or look in the Azure portal).
You might want to look into Azure Websites or Azure Cloud Services (web roles). Those are a lot easier to manage and a lot cheaper. They still offer most of the functionality.
What fixed the issue for me was to go into the Azure Portal, browse to 'Network Security Groups', select the VM and then create an inbound rule to allow traffic to port 80.
Note: Also ensure that the inbound rule to port 80 is added and enabled on the actual VM.
Well, I deleted the existing VM and Cloud service and started again - all worked fine out of the box this time.
How annoying! The only thing I did notice was that before my cloud service had the same name as my VM - this time they had different names so that might have been what was causing the issue.
Cheers
For the newer VMs and pre-configured setups (2015+), it's possible your setup is using an azure asset called "Public IP". If so, you can set a custom DNS name label in it, inside "Configuration". Note that this name will consider any type of region used when creating the VM (e.g. my-site.brazilsouth.cloudapp.azure.com).
It's good to remember that for testing purposes, it still suffices to use the value of the public IP that is randomly designated to you.
The VMs are actually accessed via a Cloud Service (well they are for me). Azure created a Cloud Service automatically to be the scaling engine/load balancer on the front of the VM. I have to connect to the web site via that cloud service, not the VM directly.
Its possible you were using the internal IP rather than the external IP.
The sites have to use the internal IP address in the bindings section of IIS. However, in your dns you will need to use the external IP. This is presumably since the 'internal IP' is just a virtual one that Azure uses to map traffic from the external network to the VM's inside azure.
You should find both the internal and external IP's are visible on the VM's desktop.
Switch off TLS 1.3 in the Registry Editor.
This is what worked for me as of writing this in Mar 2021.

Resources