-
Notifications
You must be signed in to change notification settings - Fork 49
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
sdk
: provisioning state poller allow additional parameters
#1090
sdk
: provisioning state poller allow additional parameters
#1090
Conversation
…tion url instead of origin url
Hi @wuxu92 - Are there other known provisioning cases requiring this modification? I'm just wondering why we're making the change here, rather than creating a custom poller for this as we have done for other unique cases? |
@jackofallops Currently, only this API requires additional parameters during provisioning. I prefer fixing it in the SDK layer rather than using a custom poller in the provider code, as this will allow us to provide a robust SDK and reduce custom logic in the provider. |
@jackofallops According to this comment, the delete API of the APIM API might face the same issue with the LRO polling URI of the asyncId parameter in future API versions. |
@jackofallops Since we can't pass additional parameters to the SDK's |
I created customr poller PR hashicorp/terraform-provider-azurerm#28193 |
Thanks @wuxu92 - I've reviewed the linked PR, and since we have away forward there I'm going to close this one out for now. |
This PR is to fix issues that provisioning state poller may need additional query parameters to request the resource.
Possibly unblocks #962, hashicorp/terraform-provider-azurerm#23322 and hashicorp/terraform-provider-azurerm#24379
Issue description
For the APIM API resource, the response to a create/update operation includes a
location
header with anasyncId
parameter. ThisasyncId
is needed to retrieve the actual error message if the create/update operation fails.Create
If missing the asyncId parameter, the GET operation after a failed creation will return 404 Not Found, obscuring the actual ValidationError.
When this PR is applied, the error message will reflect the root cause as follows:
Update
The GET operation after a failed update will return 200 OK, mistakenly indicating the update was successful. More details can be found at hashicorp/terraform-provider-azurerm#24379.
When this PR is applied, the update operation will report the error if the swagger contains validation error: