microsoft / vscode-apimanagement

VS Code extension for Azure API Management.
MIT License
60 stars 40 forks source link

API Management gateway error #240

Open verschaevesiebe opened 2 years ago

verschaevesiebe commented 2 years ago

Hi All,

I'm having some trouble debugging policies through the Visual Studio Code extensions. There are a few problems in my opinion and let me lay them out for you.

1. Testing the operation Whenever clicking on the test operation button the HTTP rest-client extension opens. The extension presets your HTTP call to be executed however, the versioning scheme is automatically defined as a template parameter instead of a query parameter (api-version=v2.4) There is no possibility to amend it in the settings of visual studio code. (extension)

image image

2. Gateway issue Whenever clicking the start policy debugging image

The debugging starts but is unsuccessful to connect. I can clearly see the debugging logs where the client tries to connect however it is failing to do so because of a gateway error. I'm unsure why this is happening, at first I thought we would be missing some configuration since our API manager is privately behind a public front-door setup. However, the same issue arises when doing it on a publicly available solution so no real difference in behavior.

PS: The same behavior is found in our basic and premium tier API Managers. Debug information below with [redacted] information.

If the product team wants to reach out, then feel free to do so.

image

mikaelsand commented 2 years ago

I was able to confirm this behavior, if that helps anyone.

@verschaevesiebe you have really done your homework :-) Great documentation.

My conclusion is simply that the debug feature has the same rules for constructing a uri as the Test Operation feature. Testing from VS Code is still possible, I just had to update the path to use the parameter instead. (Which is annoying).

In your place @verschaevesiebe I would make use of the trace information to view variable values etc. Personally I have never had any use of the Debug feature.

verschaevesiebe commented 2 years ago

Thanks @mikaelsand, I usually use the trace info to get things running or debugged. However, I wanted to try the extension as it seemed useful to breakpoint on context variables for example. Somehow I feel like creating policies is always trail and error + guess work.

It might just be me. 😄 Anyway there is a bug in the functionality both for the "Operation test" as well as the gateway issue I'm facing.

verschaevesiebe commented 2 years ago

Found issue #217 to be related to my second point in my thread.

rinikrish commented 2 years ago

Having the same issue! I see this wasn't closed, but any chance you were able to figure something out here?