Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
321 stars 186 forks source link

[BUG]APIOPS can not work with SOAP service which have operation level policy #474

Closed mmmbai closed 8 months ago

mmmbai commented 8 months ago

Release version

5.0.1

Describe the bug

APIOPS can not work with SOAP service which have operation level policy

Expected behavior

Publish tool should successfuly deploy SOAP service to second environment

Actual behavior

Publish tool failed with 2024-02-02T22:47:43.2572466Z System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/31aa985b-4df3-43ab-87d3-92153f79500b/resourceGroups/AS-sy-APIMgmt-RG/providers/Microsoft.ApiManagement/service/as-sy-apimgmt01-apim/apis/b2bproxy-wcatappealservice-aixsproxy/operations/62b35e88397726132ca74e60/policies/policy?api-version=2022-04-01-preview&format=rawxml failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"Entity with specified identifier not found","details":null}}'.

Reproduction Steps

  1. Create one SOAP service in APIM

  2. Click one operation, modify Inbound processing. For example " set-variable name="test" value="123" />".

  3. Run extract. We will see there is one folder under "operations" folder. The folder name is same with operation id.

  4. Run publish and we will get error like

2024-02-02T22:47:43.2572466Z System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/31aa985b-4df3-43ab-87d3-92153f79500b/resourceGroups/AS-sy-APIMgmt-RG/providers/Microsoft.ApiManagement/service/as-sy-apimgmt01-apim/apis/b2bproxy-wcatappealservice-aixsproxy/operations/62b35e88397726132ca74e60/policies/policy?api-version=2022-04-01-preview&format=rawxml failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"Entity with specified identifier not found","details":null}}'.

Possible Root cause: The operation id are randomly generated when we import the wsdl to dev. But after extract, there is no where save the operation id in the extracted files. When publish tool try to publish that to another environment, System generate randomly operation id which is different with dev. But when publish try to publish operation level policy based on dev. It will fail.

waelkdouh commented 8 months ago

Did you check both open and closed issues? I feel I have this question come up before.

mmmbai commented 8 months ago

I didn't found similar report in open and closed issues. The root cause of this is compare to rest API, the extracted specification.yaml have operationId for each operation. Then publisher can create same operation based on operationId in another environment. But for SOAP, extracted specification.wsdl(and other extracted files) didn't have operationId for each method. Can extractor extract the operationId in somewhere and publisher that to another environment using same operationId?

mmmbai commented 8 months ago

image

guythetechie commented 8 months ago

@mmmbai - see the discussion in #399. We unfortunately don't support that scenario. There are some potential workarounds discussed there, but they're all messy.

Closing as duplicate, please comment on the original issue if you have additional feedback.