Azure Application Gateway w/ AKS Custom Domain Not Loading - azure

My Registar is Google. I updated the nameservers to point to Azure in a DNS zone and have confirmed the Records are being sourced from Azure.
I am attempting to setup my custom domain to the application gateway Pubic IP address, so I have added the following configs below. When I hit the GW IP Directly the WebAPP loads but when hitting the custom domain that is pointing to the IP the web app does not load.
A Record Pointing to AppGW IP
I have also attemtped to point www.domain.com to the IP Address and that has not worked as well.
I am running an AKS cluster.
Listener Configuration
Thanks

The custom domain that is pointing to the IP the web app does not load. These issues may occur if you have not added your own app gateway public Ip address value in DNS record please check the below following workaround for reference: -
After creating a DNS, try to add IP address by adding a record set as shown below.
For getting Ip address Go to your application gateway -> overview -> double click on frontend public Ip address
Try using this IP address on that record set.
In your public DNS record set, once Ip address value is added, custom domain will point to that IP. your DNS server will be visited first, where the IP address is visible, it returns back and come to your server. Once it arrives, an ‘A’ host record for the IP address section will redirect the request to your IP address, and then it redirects the backend pool part to HTTP port 80.
The application gateway will handle load balancing if you try to create two backend pools, it will redirect the section to port 80 and connect to your backend target using that port.
Additionally, please check this similar thread by kartik as it contains some useful information.

Related

Azure URL app service not working in vnet with private endpoint

Hi currently I have setup a VNET.
Inside this vnet I made a VM and I added an App-Service in the subnet with an private-endpoint.
The private-endpoint of the App-Service is also automatically added to a privatelink DNS zone. (Azure created this automatically for me) It also points correctly to the right internal ip address.
Now from within my VM I try to access my AppService using curl and using the created .privatelink.azurewebsites.net link to the AppService. But it keeps returning 404.
How is this possible. My knowledge of DNS is limited.
If I do a NSLOOKUP inside the VM, it nicely resolves the privatelink DNS Name and finds the private-endpoint ip address
What am I missing?
Update
When I keep using the original azurewebsites.net xxxxxxx.azurewebsites.net (not the privatelink) URL I can access the appservice from within the VNET.
If I am on the VM, and I do a lookup of the original URL I get this.
Non-authoritative answer:
xxxxxxxxx.azurewebsites.net canonical name = xxxxxxxxx.privatelink.azurewebsites.net.
Name: xxxxxxxx.privatelink.azurewebsites.net
Address: 10.1.1.4
So there is some magic behind the scenes?
When you create a public Azure App Service "xxxxxxxxx", beside provisioning the app service environment also a DNS entry for this new service will be created in one of Microsoft's authoritative DNS servers (they are usually named like ns1-xxx.azure-dns.com) ultimately pointing to the public IP address of the server where your your app service is hosted.
If you add a private endpoint for your app service, the DNS entry in these servers won't be removed. Instead what's happening is that internet access to your web app is cut off using firewall rules.
This means if you type in "xxxxxxxxxx.azurewebsites.net" in your browser outside the VNet, a DNS query is sent and the public IP address of the server is returned. Your browser sends a HTTP query to that IP address but will get a HTTP status code 403 indicating that public traffic is blocked.
Inside your VNet the situation is different. As you described you got a private DNS zone "privatelink.azurewebsites.net" which is linked to the VNet (you can see that in the "Virtual network links" section)
If you now type "xxxxxxxxxx.azurewebsites.net" in a browser in your VM which is placed in the same VNet as xxxxxxxxxx.azurewebsites.net, the DNS server associated with the network adapters (by default accessible in your VM through 168.63.129.16) will use the entries placed in the private DNS zones. If a zone named "privatelink.azurewebsites.net" exists, all queries for the domain "azurewebsites.net" will be resolved using this private DNS zone. For example, if there is an A record entry for "xxxxxxxxxx" for 172.16.0.5...
...this is exactly the IP you'll get when you resolve xxxxxxxxxx.azurewebsites.net in your Azure VM:
C:\Users\vm>nslookup xxxxxxxxxx.azurewebsites.net
Server: UnKnown
Address: 168.63.129.16
Non-authoritative answer:
Name: xxxxxxxxxx.privatelink.azurewebsites.net
Address: 172.16.0.5
Aliases: xxxxxxxxxx.azurewebsites.net
If you delete your private DNS zone, the DNS server will resolve back to ns1-xxx.azure-dns.com which in turn will give you the public IP of the service:
C:\Users\vm>nslookup xxxxxxxxxx.azurewebsites.net
Server: UnKnown
Address: 168.63.129.16
Non-authoritative answer:
Name: waws-prod-am2-459-d21a.westeurope.cloudapp.azure.com
Address: 20.50.2.66
But since the app service still has firewall rules applied that block all traffic coming from outside the VNet, you will get a HTTP status code of 403 if you try to access the service over a browser.
See also: https://learn.microsoft.com/en-us/azure/app-service/networking/private-endpoint#conceptual-overview

Azure Front Door Backend Pool pointing to Azure Load Balancer Public IP not resolving

I have an Azure Load Balancer which is configured with an internet facing public IP. I can confirm I can access this public IP from my browser.
My end goal is to configure Azure Front Door CDN so that it uses the IP from the Load Balancer and at the end of the day I would want to access my load balancer through the Front Door DNS.
I have created the Front Door, I configured a Backend Pool with selecting the option Public IP Address as the type, I locate the Load Balancer Public IP name from the drop-down, leave everything else to default. I then configure the HTTP and HTTPS routing rules.
I check everything is enabled and then I hit the Azure Front Door DNS entry.
According to the FAQ it should work . I keep getting the following error:
Our services aren't available right now
We're working to restore all services as soon as possible. Please check back soon.
However, if I use a separate DNS entry that points to the same IP and with SSL enabled - and then put that DNS entry in Azure Front Door(instead of the IP) - then accessing the web app through FrontDoor works.
Any insight appreciated - thanks.
Turns out FD wasn't working because of SSL validation error - trying in Postman and turning SSL validation setting off resolves the IP directly.

Google cloud DNS record set doesn't work

I have a back-end service on Google cloud, which I access through a Google cloud load-balancer with a static IP for front-end and port 80 (do not get any ideas, I am a developer with very basic knowledge of networking).
For accessing this service through a domain name (as a sub-domain of apps.googleusercontent.com, not custom domain), I created a zone (in cloud DNS) and then an A-Type record set with the IP of the load balancer. I get a 404 (google 404 page) on this new Domain.
I did a nslookup on new domain name and the IP returned was different than the loadbalancer IP. NSLookup returned another IP when I tried again after 30 minutes.
Is this the right way to setup the domain?
P.S. The back-end is a Kubernetes service.
For creating zone, I used this DNS suffix : apps.googleusercontent.com
The "apps.googleusercontent.com" domain is a generic domain owned by Google. You aren't supposed to be able to modify the IP of it.
When you running a "Nslookup" on the domain name it is returning an IP of Google. That's why when you try to access through the load balancer IP directly it works.
You should add an CNAME record that point to your custom domain to the domain .

Azure Virtual Machines(ARM) | Application Gateway | Private ip | DNS

I have an Internal application gateway configured in Azure. There is one virtual machine in the back end pool of application gateway which hosts the application. That is accessible via Intranet only.
I want the IP address of my internal application gateway to be associated to a domain name for my website?? How can i achieve this?
If you want to use a domain name, that means the application gateway needs to have a public IP address. In the gateway settings in the Azure portal, you can add a public IP address to the frontend configuration.
Looks like you already managed to put the backend of the gateway on the virtual network, that's good.
Next, you want to create a listener on the ports you need, for example 80 or 443. This is also done on the gateway configuration in the portal.
Finally, to use a domain name, you need to take the public IP address and put it in an A-record for the domain name. This would probably be in a config page with your service provider.

Access azure app service with ip address not the hostname

I've got a app plan (BASIC SMALL) with a private (hopefully) ip adress that can be found under Settings > Custom Domains.
When I try to access the content of the app using just the ip, it doesn't work. The site says "Error 404 - Web app not found." The hostname works just fine. When I ping the hostname it gives me the same ip adress. What do I have to do in order to be able to access it just using the ip?
That's not how Web Apps work, since you don't get a unique IP address assigned. You'll need to access it via yourname.azurewebsites.net or yourcustomdomainname.com - and then your requests are routed appropriately based on the name you provide.
If you absolutely needed a dedicated IP address, you'd need to deploy to a virtual machine.
When you host your web site on Azure web app it is bound to a virtual IP address that is shared with other web sites in the same app service plan. If you want to get a dedicated IP with your web site, please try to use Azure virtual machine with reserved IP. You could also choose App Service Environment
If you buy your custom domain, you can freely set DNS A records for that IP (it remains static). It sets binding of your domain to your web app. You can't access it directly by IP. Because on a given IP address and standard HTTP port 80, only one web can be running.
Imagine your web app could be open by entering that IP. You would "block" port 80 for zillions of other stuff running there.
If you check Properties blade there you will see a number of outbound IP addresses. If you consume some requests from web app / job / ... and have IP restriction set on the other side - you need to allow all these IPs.
As David suggested. If you really need a static IP - you need to run VM and set IP address as static or set VNet for web app.

Resources