Current revision is not identified with its revision ID #12766
Labels
bug
service/api-management
upstream/microsoft
Indicates that there's an upstream issue blocking this issue/PR
v/2.x (legacy)
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_api_management_api
Terraform Configuration Files
Debug Output
Debug output
Expected Behaviour
azurerm_api_management_api
objects shall be tied with an object ID containing the revision ID at all times, to ensure that the correct object is referenced even when the current revision changes.Actual Behaviour
Revision ID is only returned by the Azure API Management REST API when the requested API revision is not current.
When Terraform tracks such an object (for instance the first time it creates an API), it will attempt to improperly overwrite the current revision of the same API everytime it has been changed:
Actual behaviour
Steps to Reproduce
terraform apply
2
through the REST API and make it current (be it manually crafting REST API requests or using Terraform, Azure Portal, Azure CLI, etc.: it doesn't matter)terraform plan
Important Factoids
It is an upstream issue coming from the answers of the REST API.
The Azure Go SDK documents this behaviour.
If you change the current active revision, any request on
example;rev=<current revision>
will return an API object ID not containing said ID, and the previously current API (not being so anymore) will start returning aexample;rev=<revision>
suffix in its ID.However, awaiting for an upstream fix (if ever), Terraform could patch the REST API answer before using it, ensuring a
;rev=<revision>
suffix always exists in the tracked objects state.Another side-effect of this is the deletion of the whole API in case an
azurerm_api_management_api
object tracking a resource ID without such a;rev=<revision>
suffix is deleted.References
The text was updated successfully, but these errors were encountered: