You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose custom_domain_verification_id and document custom_domains DNS prerequisites (#279)
* Initial plan
* plan: diagnose custom_domains asuid TXT record issue
Agent-Logs-Url: https://github.com/Azure/terraform-azurerm-avm-res-web-site/sessions/475d34b0-5f16-4b9c-941d-fdd115e12c77
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* fix: expose custom_domain_verification_id and document DNS prerequisites
Agent-Logs-Url: https://github.com/Azure/terraform-azurerm-avm-res-web-site/sessions/475d34b0-5f16-4b9c-941d-fdd115e12c77
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* docs: point users to resource_uri output for the CNAME target
Agent-Logs-Url: https://github.com/Azure/terraform-azurerm-avm-res-web-site/sessions/475d34b0-5f16-4b9c-941d-fdd115e12c77
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* Initial plan
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* Initial plan
* feat: expose custom_domain_verification_id and document custom_domains DNS prerequisites
Agent-Logs-Url: https://github.com/Azure/terraform-azurerm-avm-res-web-site/sessions/1a2b4195-34cb-4904-a72b-6ba77d890a40
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* Initial plan
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* Initial plan
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
* feat(custom_domains): add certificates input, certificate_key reference, and certificate submodule
- Add new certificates map input on the root module and a matching certificate submodule for Microsoft.Web/certificates resources sourced from Key Vault or inline PFX.
- Extend custom_domains (and per-slot custom_domains) with certificate_key so callers can reference a managed certificate by key instead of raw humbprint (mutually exclusive).
- Default the hostname_binding retry policy to also retry on transient DNS / hostname-validation errors that surface while custom domain ownership records are still propagating.
- Rewrite the custom_domain example end-to-end: real Key Vault, App Service first-party SP role assignment, certificate via root module input, hostname binding on site and qa slot. Hostname locals inlined above Step 1 in main.tf.
- Mark the example with .e2eignore (default contoso.com hostnames are not owned).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
Co-authored-by: Jared Holgate <jaredholgate@microsoft.com>
Description: A map of custom domains to assign to the App Service.
668
-
669
-
-`slot_as_target` - (Optional) Should the slot be used as the target? Defaults to `false`.
670
-
-`app_service_slot_key` - (Optional) The key of the deployment slot to target.
671
-
-`create_certificate` - (Optional) Should a managed certificate be created? Defaults to `false`.
672
-
-`certificate_name` - (Optional) The name of the certificate.
673
-
-`certificate_location` - (Optional) The location of the certificate.
674
-
-`pfx_blob` - (Optional) The PFX blob for the certificate.
675
-
-`pfx_password` - (Optional) The password for the PFX certificate.
676
-
-`hostname` - (Optional) The custom domain hostname.
677
-
-`app_service_name` - (Optional) The App Service name.
678
-
-`app_service_plan_resource_id` - (Optional) The resource ID of the App Service Plan.
679
-
-`key_vault_secret_id` - (Optional) The Key Vault secret ID for the certificate.
680
-
-`key_vault_id` - (Optional) The Key Vault ID for the certificate.
681
-
-`zone_resource_group_name` - (Optional) The resource group of the DNS zone.
682
-
-`resource_group_name` - (Optional) The resource group name.
704
+
Description: A map of custom domains to bind to the main App Service site.
705
+
706
+
To bind a custom domain to a deployment slot instead, set
707
+
`custom_domains` on the corresponding entry in `var.deployment_slots`.
708
+
709
+
This module only creates the hostname binding. It does **not** create the
710
+
underlying DNS records – those must be provisioned separately (for example
711
+
with `Azure/avm-res-network-dnszone/azurerm`) before the binding is applied.
712
+
Certificates may either be provisioned out of band and referenced by
713
+
`thumbprint`, or declared inline via `var.certificates` and referenced by
714
+
`certificate_key`.
715
+
716
+
### DNS prerequisites
717
+
718
+
Azure validates ownership of the custom hostname when the binding is created.
719
+
At least one of the following DNS records must already exist and be
720
+
resolvable, otherwise the binding will fail with errors such as
721
+
`A TXT record pointing from asuid.{0} to {1} was not found.`:
722
+
723
+
- A `CNAME` record for the custom hostname pointing to
724
+
`<site-name>.azurewebsites.net` (the module exposes this value via the
725
+
`resource_uri` output), **or**
726
+
- A `TXT` record at `asuid.<custom-hostname>` whose value is the App Service's
727
+
custom domain verification ID. This module exposes that value via the
728
+
`custom_domain_verification_id` output.
729
+
730
+
### Field reference
731
+
732
+
-`hostname` - (Required) The custom domain hostname to bind.
683
733
-`ssl_state` - (Optional) The SSL state. Possible values are `IpBasedEnabled` and `SniEnabled`.
684
-
-`inherit_tags` - (Optional) Should tags be inherited from the parent? Defaults to `true`.
685
-
-`tags` - (Optional) Tags to apply to the custom domain resources.
686
-
-`thumbprint` - (Optional) The certificate thumbprint value.
687
-
-`thumbprint_key` - (Optional) The key to look up the certificate thumbprint.
688
-
-`ttl` - (Optional) The TTL for DNS records. Defaults to `300`.
689
-
-`validation_type` - (Optional) The domain validation type. Defaults to `cname-delegation`.
690
-
-`create_cname_records` - (Optional) Should CNAME records be created? Defaults to `false`.
691
-
-`cname_name` - (Optional) The CNAME record name.
692
-
-`cname_zone_name` - (Optional) The DNS zone name for the CNAME record.
693
-
-`cname_record` - (Optional) The CNAME record value.
694
-
-`cname_target_resource_id` - (Optional) The target resource ID for the CNAME record.
695
-
-`create_txt_records` - (Optional) Should TXT records be created? Defaults to `false`.
696
-
-`txt_name` - (Optional) The TXT record name.
697
-
-`txt_zone_name` - (Optional) The DNS zone name for the TXT record.
698
-
-`txt_records` - (Optional) A map of TXT records with `value` attribute.
734
+
-`thumbprint` - (Optional) The thumbprint of a certificate already uploaded to the App Service. Mutually exclusive with `certificate_key`.
735
+
-`certificate_key` - (Optional) The map key of an entry in `var.certificates` whose thumbprint should be used for this binding. Mutually exclusive with `thumbprint`.
txt_records = optional(map(object({ value = string })))
741
+
hostname = string
742
+
ssl_state = optional(string)
743
+
thumbprint = optional(string)
744
+
certificate_key = optional(string)
734
745
}))
735
746
```
736
747
@@ -928,6 +939,10 @@ Description: A map of deployment slots to create for the App Service.
928
939
-`value` - (Optional) The value of the connection string.
929
940
-`zip_deploy_file` - (Optional) The path to the zip file to deploy to the slot.
930
941
-`zip_deploy_wait_duration` - (Optional) The duration to wait after the slot is configured before triggering zip deploy. Defaults to `60s`.
942
+
-`custom_domains` - (Optional) A map of custom domains to bind to this deployment slot. The same DNS prerequisites described on the top-level `custom_domains` variable apply.
943
+
-`hostname` - (Required) The custom domain hostname to bind.
944
+
-`ssl_state` - (Optional) The SSL state. Possible values are `IpBasedEnabled` and `SniEnabled`.
945
+
-`thumbprint` - (Optional) The thumbprint of a certificate already uploaded to the App Service.
0 commit comments