How to set-up custom domain name in Azure Container Instance
Asked Answered
M

3

18

I own a domain name with cloudflare nameservers. I've set up an Azure Container Instance with a running container hosted in Docker-Hub container registry. When i created the container instance i specified dns-name-label in azure's namespace, but i want to point my custom domain to this running container instead of the azure's one.

I've searching in Azure Docs for a way to point my custom domain name to this running container in ACI, but i didn't found any information about this configuration in Azure Container Instances. I did found some information regarding custom domains for blob storages, or cloud services, but none of those applied to ACI, as the custom domain setting doesn't appear in my ACI dashboard, neither in Azure CLI help commands.

Any information will be appreciated. I hope there is a solution to this that doesn't involve switching my NS to Azure's as cloudlflare is working just fine.

Merchantman answered 4/6, 2019 at 0:1 Comment(0)
B
14

As for as I know, ACI exposes the DNS name using a dns-name-label in azure's namespace. The FQDN like customlabel.azureregion.azurecontainer.io. is provided by Azure DNS service. Unfortunately, there is no way to directly set the custom domain for ACI, but you could create a CNAME record in your DNS provider to redirect your subdomain like www.example.com to this FQDN. If so, you can access your ACI via subdomain www.example.com.

Bodycheck answered 4/6, 2019 at 1:19 Comment(5)
Thank you for your answer, sadly this cname approach didn't work out. I think there is something wrong with the Cloudlflare's SSL certificate and the CNAME redirection because i get timeout_error. I'm still trying to figure this out but my domain name isn't pointing to the FQDN. Also when i deactivate the SSL in Cloudlfare settings, i get too_many_redirects error in the domain. Also i'm a bit confused as what's the difference between an intern custom domain set-up and a single CNAME record set-up in my NS, why would azure make a configuration to this if a CNAME record would be enough.Merchantman
Well today i re-enabled SSL in CloudFlare and the CNAME record now it's working properly. Everything is good now. Thank you for your answer. I still wonder what's the difference between the CNAME record setup and the intern Azure's custom domain setting in Azure's panel.Merchantman
CNAME record setup allows you to redirect traffic to Azure provided DNS name. Since CNAME record is hosting in your DNS provider that you can fully control it. Whereas the azure provided FQDN is provided by Azure DNS provider, you only could control customlabel not the DNS suffix .azureregion.azurecontainer.ioBodycheck
@LucaPerico it's better to raise a new question for your specific issue instead of sending comments and downvote this reply. My reply is to provide an answer to this question.Bodycheck
@LucaPerico, My reply could solve the op's question. In your specific issue, it looks like an SSL cert issue on your side. When you use a custom domain, do you bind custom SSL cert for that custom domain? Otherwise, you will get an HTTPS access error. You should access HTTP with a custom domain. See more details about adding SSL in ACI APP hereBodycheck
H
-1

You may consider creating a web app for the container. Then you can create a custom domain for the web app.

Hellespont answered 21/8, 2020 at 15:1 Comment(0)
T
-1

cname won`t work since docker sees that the ssl cert is from *.azurecr.io and not example.expemple.com and then proceeds to do nothing. it also doenst work with cloudflare ssl edit: i just did more research and i found something very very promising https://github.com/Azure/acr/tree/main/docs/custom-domain

cheers, Zakaria

Timm answered 13/12, 2020 at 0:11 Comment(4)
Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. Answers that are little more than a link may be deletedSimpleton
Note for other reviewers, I haven't flagged this one.Simpleton
The link you posted is for ACR, not ACI.Foxy
This is not true. I managed to achieve what I asked for with the accepted solution.Merchantman

© 2022 - 2024 — McMap. All rights reserved.