You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue with [ApiManagement] / API Version [2022-08-01] - resourcemanager/pollers: LRO URIs of themselves should not be judged entirely based on Path
#962
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Service Used
ApiManagement
API Versions Used
2022-08-01
Description
The code in func isLROSelfReference(lroPollingUri, originalRequestUri string) bool uses Path to determine whether lroPollingUri is itself, which does not apply to the following situation.
Take creating azurerm_api_management_api with an invalid open api file as an example.
openapi: 3.0.1
info:
title: j7t-reproducer-service
version: "1"
servers:
- url: rest
variables: {}
tags:
- name: tag
description: description of tag
paths:
/document:
get:
description: description of operation2
operationId: operation2
parameters:
- description: status
in: query
name: status
schema:
type: string
default: P
enum:
- PRODUCTIVE
- ARCHIVED
responses:
"200":
description: get doc by status
lroPollingUri = GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01&asyncId=6618a17156773007f83fac9f&asyncCode=201
originalRequestUri = GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01
When lroPollingUri and originalRequestUri are as above, TF thinks it is LRO Self Reference and uses originalRequestUri . In fact, the results of using these two URLs are completely different, as detailed below.
Step1:
PUT /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01 HTTP/1.1
Uses lroPollingUri - GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01&asyncId=6618a17156773007f83fac9f&asyncCode=201 HTTP/1.1
AzureRM Response:
HTTP/2.0 400 Bad Request
...
{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"value[0].request.queryParameters[0].defaultValue","message":"Default value must be present in the list of values"}]}}
Uses originalRequestUri - GET /subscriptions/85b3dbca-5974-4067-9669-67a141095a76/resourceGroups/exampleRG23322-0412/providers/Microsoft.ApiManagement/service/example23322-0412/apis/example23322-0412;rev=1?api-version=2022-08-01 HTTP/1.1
Azure Response:
HTTP/2.0 404 Not Found
...
{"error":{"code":"ResourceNotFound","message":"Api not found.","details":null}}: timestamp="2024-04-12T09:56:58.460+0800"
Therefore, I assume that TF should use lroPollingUri instead of originalRequestUri in this case.
Is there an existing issue for this?
Community Note
Service Used
ApiManagement
API Versions Used
2022-08-01
Description
The code in
func isLROSelfReference(lroPollingUri, originalRequestUri string) bool
usesPath
to determine whether lroPollingUri is itself, which does not apply to the following situation.Take creating
azurerm_api_management_api
with an invalid open api file as an example.TF config:
api_management_api_openapi.yam
lroPollingUri = GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01&asyncId=6618a17156773007f83fac9f&asyncCode=201
originalRequestUri = GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01
When
lroPollingUri
andoriginalRequestUri
are as above, TF thinks it is LRO Self Reference and usesoriginalRequestUri
. In fact, the results of using these two URLs are completely different, as detailed below.Step1:
PUT /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01 HTTP/1.1
Step2:
lroPollingUri
- GET /subscriptions/xxx/resourceGroups/acctestRG-240412104721090643/providers/Microsoft.ApiManagement/service/acctestAM-240412104721090643/apis/acctestapi-240412104721090643;rev=current?api-version=2022-08-01&asyncId=6618a17156773007f83fac9f&asyncCode=201 HTTP/1.1originalRequestUri
- GET /subscriptions/85b3dbca-5974-4067-9669-67a141095a76/resourceGroups/exampleRG23322-0412/providers/Microsoft.ApiManagement/service/example23322-0412/apis/example23322-0412;rev=1?api-version=2022-08-01 HTTP/1.1Therefore, I assume that TF should use
lroPollingUri
instead oforiginalRequestUri
in this case.References
Related GH issues:
GH #24379 .
On of the situations in GH #23322 .
The text was updated successfully, but these errors were encountered: