-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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_api_management
- Restore request does not need to handle the response which does not have
#21221
Conversation
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.
Hey @xuzhang3, this looks like an api bug if the future isn't working correctly. I believe we'll have to merge this the way it is since it is broken but can you open an api ticket and link that into a comment on this PR so we can track when it'll be fixed?
APIM issue: Azure/azure-rest-api-specs#23456 |
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 @xuzhang3 in future please make sure to leave a comment in the code linking to the raised issue. LGTM 👍
@@ -729,13 +729,11 @@ func resourceApiManagementServiceCreateUpdate(d *pluginsdk.ResourceData, meta in | |||
}, | |||
} | |||
|
|||
future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, params) | |||
// We only handle the error here because no request body is returned https://github.com/Azure/azure-rest-api-specs/issues/23456 | |||
_, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ServiceName, params) |
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.
To give a little context here: this is returning an LRO, so there won't be a HTTP Response by design - this API behaviour is intentional and not an API bug. If you wish to query the state of a resource that's being provisioned as an LRO, you'll need to either poll on the LRO (using WaitForCompletion
in the Track1 SDK) - or by polling on the resource and checking the provisioningState
(as below) - although the LRO shouldn't be returning until this is completed, therefore polling on the LRO should be sufficient here
This functionality has been released in v3.51.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Fixes: #17206
This recover request is different from the create/update. The response does not have any response body or HTTP headers like create/update. A successful recover request will have an HTTP status code of 201. Handle the response error is enough.