-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_container_app_custom_domain
- fix parsing the certificate ID error
#25972
Conversation
ab7ffd2
to
2f58385
Compare
// The `v.CertificateId` returned from API has two possible values. when using an Azure created Managed Certificate, | ||
// its format is "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.App/managedEnvironments/%s/managedCertificates/%s", | ||
// another format is "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.App/managedEnvironments/%s/certificates/%s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are two different Resource Types within the API - Microsoft.App/managedEnvironments/certificates
and Microsoft.App/managedEnvironments/managedCertificates
- so should be exposed as two different properties on our side.
Presumably that'd mean introducing a new property container_app_environment_managed_certificate_id
to go alongside the existing container_app_environment_certificate_id
- what's the reasoning for shoe-horning these into a single field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback. The code has been updated. Could you please take another look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's also possible to create/delete/read Managed Certificates I suspect we'll need an associated data source/resource to manage those, so that this is usable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this parsing issue is introduced by support the ability to use Azure Managed Certificates PR. Per the PR's description "This is required to support the automatic creation of Azure Managed Certificates. This PR is in Draft as we are considering design options and may significantly change how this is implemented before inclusion in the provider", I assume that there may be a special reason for not using Managed Certificates API , although I don't know what the reason is. Now that TF already supports Managed Certificates through azurerm_container_app_custom_domain
, is it possible to fix the parsing error to unlock the user first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @sinbai that this parsing error should be fixed first to support the user. We are using azurerm_container_app_custom_domain
to suppress change on the certificate-related fields, so we can manually click through Azure portal to add the managed certificate; until managed certificate is supported in TF.
…on destroy. Waiting for PR that solves the issue (hashicorp/terraform-provider-azurerm#25972)
Any news on the approval? I used a workaround for this issue but it's not ideal. |
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
Can we please move forward with this fix? I have a Container App with custom domain, defined via TF, but I have to remove and readd the TLS certificate binding manually every time TF complains with this parsing error via Azure Portal. |
Is there any update on this? Still it's not possible to use |
Please, let's move forward with this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ☔
@sinbai in the months since this pr was last reviewed have you done any research or looked into creating the resources tom mentioned?
@sinbai If I'm reading correctly, this fix should be included in 4.3.0, right? I've updated to this version and I'm still getting the same error. Is there anything else I need to do to? |
Same here |
I see, this is the issue I'm getting:
Is this different from this PR? I can open a separate issue if you think so. |
My output is basically identical to the one shown by @jrdzha. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
The Certificate Id returned from API has two possible values. When using an Azure created Managed Certificate, its format is "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.App/managedEnvironments/%s/managedCertificates/%s", another format is "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.App/managedEnvironments/%s/certificates/%s",
we should handle both cases to avoid parsing error to fix
azurerm_container_app_custom_domain
fails parsing the certificate ID for managed certificates #25788 .Fix following 'run bash ./scripts/fun-gradually-deprecated.sh' error.
PR Checklist
Changes to existing Resource / Data Source
This is a (please select all that apply):
Related Issue(s)
Fixes #25788