我们有一个应用程序,允许客户使用自己的自定义域在我们的应用程序上访问其帐户。
目前,我们正在使用Azure App Services自定义域选项&当用户与我们共享其自定义域时,我们将其手动将其添加到将其指向其唯一帐户URL的Azure自定义域列表中。 ie projects.customerdomain.com(自定义域)to Customer1.anywhereapp.io(它们在我们的产品“任何地方”中的帐户)。
这种方法运行良好。
现在,我们正在探索是否可以使用Azure前门使我们的应用程序在全球范围内更响应迅速且&我们遇到的问题之一是我们如何将客户的自定义域配置到其特定的任何地方帐户?
我已经完成了官方的Azure FD自定义域文档&我了解它使我们可以将指向一个后端的自定义域添加到一个后端,在我们的情况下,每个自定义域也需要指向特定的子域URL。 ie Customer1.anywhereapp.io
我们如何实现这一目标?
真正感谢朝着正确方向的任何指导。
谢谢
英石
We have an app that allows customers to use their own custom domain to access their accounts on our app.
Currently, we are using the Azure App Services Custom Domain option & when a user shares their custom domain with us, we manually add it to the Azure Custom Domains list pointing it to their unique account URL. i.e. projects.customerdomain.com (custom domain) to customer1.anywhereapp.io (their account in our product 'Anywhere').
This approach has been working well.
We are now exploring if we can use Azure Front Door to make our app more responsive worldwide & one of the problems we are stuck at is how do we configure the custom domains of our customers to their specific Anywhere accounts?
I've gone through the official Azure FD Custom Domain documentation & I understand it allows us to add the custom domain pointing to one backend, in our case each custom domain also needs to point to a specific subdomain URL. i.e. customer1.anywhereapp.io
How do we achieve this?
Any guidance in the right direction is really appreciated.
Thanks
ST
发布评论
评论(3)
Azure前门可以将请求主题向后端转发。因此,您可以使用DNS验证在前门和应用程序服务上配置自定义域。
为此,按照以下步骤:
转到您的应用服务
转到自定义域
复制自定义域验证ID
添加具有复制值的新DNS TXT记录:
txt asuid.projects.customerdomain.com。 <验证ID>
访问您的前门个人资料
配置原点如下:
< - 留下这个空的将请求主机标题转发到后端
当向前门提出请求时,启用了此相同的请求,将其传递给您的后端,包括自定义域(projects.customerdomain.com)。
从您的应用服务的角度来看,无论您是否使用前门,都没有区别。
Azure Front Door can forward the request Host header to the backend. So you can configure the custom domain both on Front Door and the App Service using DNS verification.
To do this, following the following steps:
Go to your App Service
Go to Custom Domains
Copy the Custom Domain Verification ID
Add a new DNS TXT record with the copied value:
TXT asuid.projects.customerdomain.com. <verification id>
Go to your Front Door profile
Setup the Custom Domain as per the instructions on MSDN
Configure the origin as follows:
<-- leaving this empty will forward the request host header to the backend
Now when a request is made to Front Door this same request is passed onto your backend including the custom domain (projects.customerdomain.com).
From the perspective of your app service, there's then no difference whether you use Front Door or not.
我们一直在为同样的问题而苦苦挣扎。尽管杰里米(Jeremy)的解决方案听起来很完美,但我们正在努力弄清楚如何在同一域上运行应用程序的多个应用程序服务时使其正常工作。
例如,我们在2个单独的应用程序服务/应用服务计划中运行一个应用程序。它是相同的应用程序代码。假设域是my.website.com
appserviceeast(假设其Azure非客户域域是AppServiceeast.azurewebsites.net)
AppServiceWest(假设其Azure非客户域域是AppServiceWest.azurewebsites.net),
他们都运行该应用程序。
我们已经在没有问题的情况下设置了前门池/规则/等。但是,我们遇到了2个问题中的1个:
如果我们将原始主机标头保持在适当的位置,任何时候有人去my.website.com,他们的浏览器都会显示它们最终在appserviceeast.azurewebsites.azurewebsites.net或appservicewest.azurewest.azurewebsites上.net
如果我们将其删除,则应该只是将其取出,继续沿着我的.website.com传递 - 但问题在于,我只能使其中一个应用程序服务具有自定义域是my.website.com。如果我试图使它们都在该域上工作,那么我会遇到与同一域中具有不同值不同的2个TXT记录的地步。
感觉这必须是一件很普遍的事情 - 在一个域上的多个区域设置Web应用程序,并且在我们认为合适的情况下在它们之间进行前门拆分流量。但是,我们每次都遇到了障碍。
We've been struggling with this same issue. While Jeremy's solution sounds perfect, we are struggling with figuring out how to make it work when we have multiple app services running an app on the same domain.
For example, we have an app running in 2 separate app services/app service plans. It is the same application code. Let's say the domain is my.website.com
AppServiceEast (say its Azure non-custom domain is appserviceeast.azurewebsites.net)
AppServiceWest (say its Azure non-custom domain is appservicewest.azurewebsites.net)
They both run the app.
We've setup the front door pools/rules/etc without problem. However, we are stuck with 1 of 2 problems:
If we keep the origin host headers in place, anytime someone goes to my.website.com, their browser shows them ending up at appserviceeast.azurewebsites.net or appservicewest.azurewebsites.net
If we take those out, it should just keep passing along my.website.com - but the problem with that is that I can only make ONE of those app services have its custom domain be my.website.com. If I try to make them both work on that domain, I get stuck at the point where I'm trying to create 2 TXT records with different values for the same domain.
It feels like this has to be a common thing to want to do - setup a web app in multiple regions on ONE domain, and have Front Door split traffic between them as we see fit. However, we run into roadblocks at every turn.
你有没有让这个工作?
在同一件事上挣扎。
为了使用Azure前门证书为自定义域,自定义域的CNAME必须指向Azure前门端点主机名。
为了使用Azure App Service证书,自定义域,自定义域的CNAME必须指向Azure App Service HostName。
我发现这样做的唯一方法是为Azure App Services创建CNAME足够长的时间以生成自定义域的证书。然后将CNAME移至Azure前门以生成证书。
但是,如果只有其中一项具有所有必需的DNS记录,则尚不清楚两项服务是否会继续旋转证书。
Azure App Service正在运行使用Azure B2C的Easy Auth集成的.NET应用程序。而且,如果我没有使用自定义域的两种服务,那么Redirect_uri将不正确,它将揭示Azure App Services HostName。
Did you ever get this to work?
Struggling with the same thing.
In order to use Azure Front Door certificates for the custom domain the CNAME for the custom domain must point at the Azure Front Door endpoint hostname.
In order to use Azure App Service certificates for the custom domain the CNAME for the custom domain must point at the Azure App Service hostname.
The only way I have found to do this is to create the CNAME for Azure App Services long enough to generate the certificate for the custom domain. Then move the CNAME to Azure Front Door to generate the certificate.
But it's not clear if both services will continue to rotate the certificates if only one of them has all of the required DNS records.
The Azure App Service is running a .NET app that is integrated using Easy Auth with Azure B2C. And if I didn't have both services using custom domains the redirect_uri would be incorrect, that it would reveal the Azure App Services hostname.