Nested Profiles in Azure Traffic Manager not working properly - azure

I had created two Traffic manager profiles naming as Firstprofile, Secondprofile.Firstly Secondprofile configured with app service end point. Now Secondprofile added as Endpoint to Firstprofile (called nested profile) .While browsing the Firstprofile showing the error as follows "Error 404 - Web app not found"

The HTTP request you make to your Web App includes a 'Host' header containing the domain name used in the request. This must be recognized by the Web App. The standard Web App domain name (foo.azurewebsites.net) always works, any other domain names appear in the Web App's custom domains list.
When you add a Web App to Traffic Manager, the Traffic Manager profile's domain name (child.trafficmanager.net) is automatically added to the Web App's custom domains list. So far, so good.
There is a known issue in the Web App / Traffic Manager integration that when using nested Traffic Manager profiles, the domain name of the parent profile (parent.trafficmanager.net) is not added to the Web App custom domain list. This is why you're seeing 404 errors when trying to access the Web App via the parent profile.
As a workaround, you should configure a DNS record in a vanity domain (e.g. www.contoso.com) as a CNAME to parent.trafficmanager.net, and register the vanity domain name as a custom domain in your Web App. Access to the web app via the vanity domain should now work, and this will use the nested Traffic Manager profile as part of the DNS resolution.
Jonathan (Program Manager, Azure Traffic Manager)

The problem is exactly what Jonathan Tuliani mentioned, but there is an alternative solution.
You need to add the parent Traffic Manager profile's domain name to the Web App.
Just go to Custom Domains and SSL -> Bring external domain -> enter the domain name e.g. tmdemo.trafficmanager.net. It will get allowed and everything works.
I just wrote a blog post about it: Nested Traffic Manager profiles

Related

How to have multiple host names for azure website

I created an web app for a demo website in Azure. The domain name for this website was created when I created the app service "myapp1.azurewebsites.net". I'd like to use additional domain names using the same azurewebsites.net such as myapp2.azurewebsites.net. When I try to add this custom domain it tells me
Failed to add hostname myapp2.azurewebsites.net. Too many (2)
hostnames in the default DNS zone. Limit is 1
Is there no way around this or must I use my own custom DNS name?
For this you need to add custom domain in Azure web app.
For example : when I created the app service "myapp1.azurewebsites.net" and want to have additional domain names , you can go for custom domains like abc.com.
You can not have .azurewebsites.net as the custom domain of already existing web app as it is already owned by Microsoft Azure web app.

Azure Application Gateway, Azure App Service and Form Based Authentication

I'm migrating a complete infrastructure over to Azure; it's been slow going as there's so much to learn and for every two steps forward, there seems to be one step back.
After what seems like an eternity, I think I've got it all sorted with one exception.
The architecture is as follows:
Azure Traffic Manager ==> 2 Azure Application Gateways (geo separated) ==> Azure App Service
A custom domain is used for the traffic manager and the gateways are listening for the same domain and, when the route matches, passing on the requests down to the app service.
The actual app itself is a ASP.NET MVC application and it uses forms authentication; and this is where the challenge happens.
When navigating to the public address: client.domain.com and hitting the website, it determines that the user is not authenticated and sends the browser to the login page... so far so good but, rather than using client.domain.com/login it uses the web-server dns name, so client.azurewebsites.com/login
How do I go about changing the behaviour so that it uses the external DNS name rather than the website name?
I can't setup custom domains on the app service as the only route into the site is via the gateway as this is also the firewall.
Is there some Web Config setting I can make? I'm looking at the outbound rewrite rules but these seem to only work on tags rather than 302 redirects.
Any thoughts would be most welcome.
You need to setup custom dns names on your webapp (you can use TXT record to verify dns name, so i dont see a reason why you can add it to the webapp). or you can alter the code.
In order to solve this problem, I had to make a code change to the web app itself. Not ideal but it worked.
What I had to do was to extend the code that redirects an unauthenticated request to the login page by sniffing for the X-Original-Host HTTP Header that the App Gateway forwards on. This contains the public facing DNS name. If the header is present and it is on a pre-approved white-list (so as to prevent any hijacking), then redirect the user to the login page for this domain, rather than the one the server is listening on directly (so use client.domain.com rather than client.azurewebsites.com)

Web app not validating custom domain name

Steps I followed:
Created an web app (registration-ceus.azurewebsites.net)
Created a traffic manager profile, added web app as an endpoint (registrationtmp.trafficmanager.net) Traffic manager opens the web
app. Issue I face while adding custom domain. I have own a domain
(e.g myworkdomain.net)
I am trying to add subdomain to traffic manager profile (testregistration.myworkdomain.net).
testregistration.myworkdomain.net CNAME
registrationtmp.trafficmanager.net
Added CNAME for my web app:
awverify.testregistration.myworkdomain.net CNAME
awverify.testregistration.registration-ceus.azurewebsites.net
When trying to add the Custom domain awverify.testregistration.myworkdomain.net to my web app, web app
does not validate the domain name. It always gives option to Add
Hostname.
When I try to access testregistration.myworkdomain.net, gets 404 error.
The app service is in Standard tier. What step am I missing or doing wrong?

Azure Traffic Manager routing to Azure Website configured as External Endpoint

Here's what I did,
Created an Azure Website (http://myapp1.azurewebsites.net) in Standard tier
Configured Azure Traffic Manager and added endpoint as an Azure endpoint. Trafficmanager routes to the website. Nice!
Removed the endpoint and and added endpoint as an External endpoint. Trafficmanager routes to a 404 page. I provided the FQDN (Fully Qualified domain name) as myapp1.azurewebsites.net.
What is wrong with it? Doesn't Azure allow to have .azurewebsites.net sites to define as endpoint urls?
Endpoint details,
Status - Enabled
Monitor Status - Degraded
Type - External Endpoint
Complete error page details,
Error 404 - Web app not found.
The web app you have attempted to reach is not available in this Microsoft Azure App Service region. This could be due to one of several reasons:
1. The web app owner has registered a custom domain to point to the Microsoft Azure App Service, but has not yet configured Azure to recognize it. Click here to read more.
2. The web app owner has moved the web app to a different region, but the DNS cache is still directing to the old IP Address that was used in the previous region. Click here to read more.
When using a web site, the web site needs to know what domain name to expect in the 'host' header of the DNS request. This is the domain name the user types into their browser.
When you add a web site as an endpoint in Traffic Manager, the Traffic Manager domain name (e.g. mysite.trafficmanager.net) is automatically added as a custom domain name in your web site. And when you remove the web site endpoint, it is removed once again.
However, if you use the external endpoint type, this does not happen. Because the web site does not recognize the domain name in the host header, a 404 error is returned.
To make this work, you will need to put a vanity domain name in front of Traffic Manager using a CNAME, register the vanity domain name in your web site, and use the vanity domain name from your browser. (You cannot manually add the Traffic Manager domain name to the web site since you cannot complete the proof-of-ownership validation which web sites demand.)
External endpoint needs to be outside Azure website.

Multiple domains on 1 cloud service

I have a app which is a website builder. Lets say the app is on a azure webrole and its domain is called www.myapp.com.
I want to offer a service where users can use their custom domain with my app. So User 1 has a domain called ww.user1.com, user2 has www.user2.com etc. Whenever someone types www.user1.com, I want them to be able to see come to my my app ie www.myapp.com, with the browser still showing www.user1.com. You can assume I have complete access to the DNS and nameservers of these custom domains. I just need to understand how to configure this in azure.
Not really, as it was on SSL binding of multiple custom domains on a single cloud. I was trying to figure out how to have one app on a cloud service where content changes as per custom domain end user has used to navigate to the website. Turns out its easy, all that is required is cname config and listening to host_header on server side aspx page_init –

Resources