-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managed Certificates #607
Comments
Related to #509 |
This addresses the only shortfall ACA has vs. Cloud Run IME, so really looking forward to it! Q: do you anticipate ACA managed certificates to have any limitations re: subdomain depth? Obviously "no" is ideal 😉 |
@SophCarp - is there any update on when this feature will enter public preview? |
We'll have portal support and announce public preview very soon. You can use the CLI if you want to try it now. Requires a publicly available container app. Container Apps supports apex domains and subdomains. Each domain type requires a different DNS record type and validation method.
|
Hit a wall here. It asked for the validation mechanism ( |
Sorry it looks like an |
@anthonychu Thanks for that. I was able to get to the finish line, but I was not able to get the interactive validation method prompt to work; adding Any chance this is available via ARM/bicep yet? |
Thanks @anthonychu . However, I'm not sure where I'm going wrong, but I created a new environment and container app, both simply called az containerapp hostname bind --hostname <hostname> -n containerapp -g containerapp -e containerapp -v CNAME
Argument '--validation-method' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Creating managed certificate 'mc-containerapp-<hostname>-2779' for <hostname>.
It may take up to 20 minutes to create and issue a managed certificate.
(ManagedEnvironmentNotFound) Environment containerapp was not found. UPDATE: It appears this was because I hadn't set the This does beg the question though, why does the location need to explicitly specified here, if it can be inferred from the container app. Indeed, why does the environment also need to specified, if this can be inferred in the same way? |
Further to this, I tried using the REST API to provision a managed certificate (via Pulumi), but I believe one of the property names is incorrect in the specification - specifically, |
Used the CLI to create a managed certificate and bind to a new hostname as per steps above. It worked but the certificate chain seems incomplete. Only the leaf/final certificate is returned to all TLS validation tools (https://decoder.link/, https://www.sslshopper.com/ssl-checker.html, and https://www.geocerts.com/ssl-checker). Is this a bug or by design? [I may have lost touch with how certificates and PKI works] |
@mburumaxwell I think you're hitting #709 |
Does anybody know how can we configure managed certificate via bicep or ARM? I could not find any documentation. |
The CLI didn't work for us, we had to use the UI to complete the Custom Domain/Managed Certificate. This was due to our Container App and Container App Environment not being in the same resource group and the CLI only accepting/looking in a single resource group. I feel the CLI shouldn't require the Container App Environment name and/or resource group as the Container App has the references and a Container App only belongs to 1 Container App Environment. |
@anthonychu seconding what @jurepurgar said above: can we have some documentation for the API to use managed certificates? They don't seem to be reflected in the Azure spec. The latest definition of CustomDomain has only a |
I'm wondering why certificate validation for Container Apps is so much difficult (literally broken) comparing to Static Web Apps, where validation works with one CNAME record pointed to Default Host name of Static App domain.
If this records is exist in Azure Cloud DNS, certificate will be issued right away. In my case, I have custom domain already on Azure Cloud DNS and I expected that Container Apps certificates should be easily created just by pointing custom (sub)domain to the CNAME of Managed Environment. For me, this makes Container Apps totally unusable. |
It's really unfortunate that this remains really very broken, and even worse that there's been zero comment AFAICT from MS staff here for three months after the feature was marked "done" for Preview purposes. Having a feature like this be available via interactive methods (portal, CLI) is cute, but absent options for robust automation (obviously bicep, but ideally others ofc), I don't know how useful a "Preview" phase can be, as people simply won't be able to use it at scale / beyond tinkerings. For those following along, our workaround has been to put all of our container apps behind Cloudflare, let it manage our edge certificates, and bind a single Cloudflare-issued "origin" cert to every container app. This is obviously not an ideal arrangement, but it at least allows us to fully automate deployments without shelling to CLIs, performing repeated deploys, or worrying about other related containerapp cert bugs like #709. |
Hey, @cemerick. I also had an idea about pointing subdomains to Load Balancer with SNI support to keep Container Apps running under TLS. But not going outside of Azure. |
Yeah, I'm not happy about it either. Obviously hurts latency, and just another point of failure. If you (or anyone else) figures an in-Azure workaround that yields good bicep automation and doesn't involve provisioning yet another load balancer or whatever, please do post about it. 😄 |
We are currently chaining CLI AZ commands in our deploy pipeline (Non-Prod), although working, we are consequently wiping and reapplying certs on each Bicep deployment and burning through issued certs at some pace. We really need to be able to bake this into Bicep before we could use this in any greater capacity. |
Agreed that we want to make Managed Certs deployment automatable. We are looking into our options and will provide an update within the next couple of days. Thanks. |
This is solved in other services that use managed certificates by providing multiple resources, rather than putting everything in the single resource. See for instance https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_managed_certificate. The same applies in API/bicep/etc since it's the underlying API that's split out. |
Any news here? |
+1 This is becoming a big blocker on our pipelines. |
@Adamation we managed to work around this by using a small bash script in our deployment pipeline. This however has the consequence of a short downtime on each deployment.
|
Thank you Deen, we are already doing something similar in our pipelines. Not ideal. |
We have fixed an issue that caused the step of creating the managed certificate to take a long time and then fail (although the certificate was indeed successfully created. With this fix, the number of deployment steps is reduced from 3 to 2. We are designing ways to be able to accomplish the whole process in a single deployment template (e.g., removing the need of creating a container app before creating a managed certificate for certain type of domain ownership validation). We don't have an ETA to share at this time. |
Could this be solved by issuing a managed wildcard certificate in the CAE before deploying the apps? |
Sounds very promising, thank you for this update. Azure has Static WebApp, which allows a customer to validate domain ownership using CNAME record pointed to Static WebApp default domain. Why exactly the same logic can't be used with Container Apps?
With such logic in place, it will be (finally) possible to use normal Terraform deployment without any hacks. Example of Static WebApps in Terraform which will deploy Static WebApp on custom domain and issue TLS certificate in one-time deployment: resource "azurerm_resource_group" "myapp" {
name = local.name
location = local.azurerm_resource_group_location
tags = local.tags
}
resource "azurerm_static_site" "myapp" {
name = local.name
resource_group_name = azurerm_resource_group.myapp.name
location = local.app_location
sku_tier = local.app_sku.tier
sku_size = local.app_sku.size
tags = local.tags
}
resource "azurerm_static_site_custom_domain" "myapp" {
static_site_id = azurerm_static_site.myapp.id
domain_name = format("%s.%s", azurerm_dns_cname_record.myapp.name, azurerm_dns_zone.name)
validation_type = "cname-delegation"
}
resource "azurerm_dns_zone" "myapp" {
name = local.dns_zone
resource_group_name = azurerm_resource_group.myapp.name
tags = local.tags
}
resource "azurerm_dns_cname_record" "myapp" {
name = local.custom_domain
zone_name = azurerm_dns_zone.myapp.name
resource_group_name = azurerm_resource_group.myapp.name
ttl = local.default_ttl
record = azurerm_static_site.myapp.default_host_name
} |
In the documentation, there is a phrase "Your container app has HTTP ingress enabled and is publicly accessible." Is this true? And why this is not a requirement for other services in Azure and only for Container apps? |
I was just following the official documentation which seems to specify parameters that aren't available in azure-cli 2.53.1 or in the Azure cloud shell: What's the status of this, is it not implemented yet? Seems odd to have it documented already. |
In case someone's looking for some terraform code that uses a managed certificate, I managed to make it work using only the It seems to be working, the only issue I'm having is that the I agree that it'd be best if we had a way to bind certificates in a similar way as App Services and Static Web Apps do it. |
Since there is no way to easily setup an managedCertificate using Bicep. |
@vinisoto is there any news regarding ETA on this? |
The --validation-method flag mentioned in the still-current documentation here doesn't even exist in the |
Certificate name of custom domains is generated automatically in the format Even according to the Microsoft guidelines, the resource name should look in the format Also, many TF providers have checks for the correctness of the name, for example |
With Pulumi, I've provisioned afd domains and used a managed certificate, it works great. ACA needs that :) |
@linxcat - there is a resolution here which is that the functionality is provided by an extension: #MicrosoftDocs/azure-docs#116721 I think the baffling documentation is still an issue though. |
@kobeyy did you find the solution for this ? |
@hoxton-webmaster I managed to find a work around by using the azure cli to first lookup the id of the managed certificate and fill it in using a shell script. I've added the complete script below as text file.
|
Is it possible to create wild card subdomain certificate using container app? I couldn't get it to be working. I'm using azure portal to create certificates. |
Pinging on this issue because of a related problem: as far as I see, while currently in 08-02 and 10-02 versions of the API the CustomDomainConfiguration object of Managed Environment is defined, it appears non-functional: it's ignored by the server, and it also assumes that a Managed Environment can only have 1 certificate defined, which is untrue. Should I report it in another ticket or is it on-topic here? |
ETA: Public Preview by end of March 2023
The text was updated successfully, but these errors were encountered: