-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_cdn_endpoint : OriginHostHeader must match the regex #8870
Comments
Any update on this? I want a blank origin_host_header but "" and null do not work |
ran into the same issue. in the API specs ( https://docs.microsoft.com/en-us/rest/api/cdn/endpoints/create ) The host header value sent to the origin with each request. This property at Endpoint can only be set allowed when endpoint uses single origin. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. So depending on your origin it is required. |
…_header` (#11852) Confirmed with service team, the request payload can't contain an empty string for the origin_host_header, otherwise, the service will raise following error: { "error": { "code": "BadRequest", "message": "OriginHostHeader \"\" is invalid. It must be a valid domain name, IP version 4, or IP version 6." } } Also update the document of this property to remove the line about default, since that is not true. Meanwhile, this should fix some of the acctest failures. Fixes #8870, #11107.
This has been released in version 2.61.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.61.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_cdn_endpoint
Terraform Configuration Files
From documentation :
When using azurerm_cdn_endpoint without a origin_host_header we get this error.
Error: Error waiting for CDN Endpoint "…" (Profile "…" / Resource Group "…") to finish creating: Code="BadRequest" Message="{\"ErrorMessage\":\"Errors found in Model: OriginHostHeader must match the regex '(^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$)|((?:[:0-9A-Fa-f]+))'.\"}"
From https://docs.microsoft.com/en-us/rest/api/cdn/endpoints/create :
With
origin_host_header = ""
, same error.Manual setup via portal works.
References
The text was updated successfully, but these errors were encountered: