microsoft / vscode-apimanagement

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

Policy Debugging is not functioning #275

Open gjjtip0926 opened 1 year ago

gjjtip0926 commented 1 year ago

I am testing the policy debugging feature in the VS code for APIM service. https://learn.microsoft.com/en-us/azure/api-management/api-management-debug-policies

The tested API returns the response always as expected while it doesn't jump into policy debugging though I start it.

What I have tried and checked:

  1. I have tested APIM instance with or without VNET integration, not working.
  2. I have confirmed that I'm setting the global subscription key as Ocp-Apim-Debug.
  3. I have confirmed that I have default policy definition in the API/Operation.
  4. I have tried to access the API url with or without VPN, not working.
  5. I have tested by using Postman and CURL, not working.
  6. I have called the Operation in other local environment, not working still.
  7. Once the debug session is started, we can observe following initialization log.

image

May you kindly share any further troubleshooting suggestion or did I miss anything?

mikaelsand commented 1 year ago

Just to make sure: Are you using an APIm instance with the DEV sku?

From: gjjtip0926 @.> Sent: den 7 november 2022 01:42 To: microsoft/vscode-apimanagement @.> Cc: Subscribed @.***> Subject: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

I am testing the policy debugging feature in the VS code for APIM service. https://learn.microsoft.com/en-us/azure/api-management/api-management-debug-policies

The tested API returns the response always as expected while it doesn't jump into policy debugging though I start it.

What I have tried and checked: 1.I have tested APIM instance with or without VNET integration, not working. 2.I have confirmed that I'm setting the global subscription key as Ocp-Apim-Debug. 3.I have confirmed that I have default policy definition in the API/Operation. 4.I have tried to access the API url with or without VPN, not working. 5.I have tested by using Postman and CURL, not working. 6.I have called the Operation in other local environment, not working still. Once the debug session is started, we can observe following initialization log.

[image]https://user-images.githubusercontent.com/98293404/200204990-80d88b91-a2f1-4d46-a175-7d1cca05040c.png

May you kindly share any further troubleshooting suggestion or did I miss anything?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-apimanagement/issues/275, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE7EMJYSMB2REAP2YAXWOTTWHBF4VANCNFSM6AAAAAARYV6VVI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

gjjtip0926 commented 1 year ago

Hi Mikael,

Thanks for your response.

Yes, I tested with Developer Tier APIM instance.

Is there any other possible reason could block the debugger feature?

Best Regards, Jay

From: Mikael Sand @.> Sent: Monday, November 7, 2022 3:57 PM To: microsoft/vscode-apimanagement @.> Cc: Jay Gong @.>; Author @.> Subject: Re: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

Just to make sure: Are you using an APIm instance with the DEV sku?

From: gjjtip0926 @.<mailto:@.>> Sent: den 7 november 2022 01:42 To: microsoft/vscode-apimanagement @.<mailto:@.>> Cc: Subscribed @.<mailto:@.>> Subject: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

I am testing the policy debugging feature in the VS code for APIM service. https://learn.microsoft.com/en-us/azure/api-management/api-management-debug-policies

The tested API returns the response always as expected while it doesn't jump into policy debugging though I start it.

What I have tried and checked: 1.I have tested APIM instance with or without VNET integration, not working. 2.I have confirmed that I'm setting the global subscription key as Ocp-Apim-Debug. 3.I have confirmed that I have default policy definition in the API/Operation. 4.I have tried to access the API url with or without VPN, not working. 5.I have tested by using Postman and CURL, not working. 6.I have called the Operation in other local environment, not working still. Once the debug session is started, we can observe following initialization log.

[image]https://user-images.githubusercontent.com/98293404/200204990-80d88b91-a2f1-4d46-a175-7d1cca05040c.png

May you kindly share any further troubleshooting suggestion or did I miss anything?

- Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-apimanagement/issues/275, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE7EMJYSMB2REAP2YAXWOTTWHBF4VANCNFSM6AAAAAARYV6VVI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.mailto:***@***.******@***.***>>

- Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-apimanagement%2Fissues%2F275%23issuecomment-1305213100&data=05%7C01%7Cjaygong%40microsoft.com%7Cd867ef93c40745ff6c3a08dac0959cdd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638034046105399783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sLBlgamalV1UnHvK%2F3018PrMsuS%2FSIEE%2BMaiTMe0cb4%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXN5NHF5PZPTJLT5WYICWHTWHCY3XANCNFSM6AAAAAARYV6VVI&data=05%7C01%7Cjaygong%40microsoft.com%7Cd867ef93c40745ff6c3a08dac0959cdd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638034046105399783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VJXvAbTRpSfLjxafViSu5G7%2F0G%2BF%2BSxBqdB1sJ9kmuw%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>

mikaelsand commented 1 year ago

Sorry, I do not usually use this feature. I just saw that DEV sku was missing from the list of things you have made sure. Personally, I usually use the trace feature only. It usually covers all the issues I run into. A tip when using Trace is to use variables and assign them values to get execution time info in your trace. It is very useful to get evaluation of if-statements.

From: gjjtip0926 @.> Sent: den 7 november 2022 09:38 To: microsoft/vscode-apimanagement @.> Cc: Mikael Sand @.>; Comment @.> Subject: Re: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

Hi Mikael,

Thanks for your response.

Yes, I tested with Developer Tier APIM instance.

Is there any other possible reason could block the debugger feature?

Best Regards, Jay

From: Mikael Sand @.<mailto:@.>> Sent: Monday, November 7, 2022 3:57 PM To: microsoft/vscode-apimanagement @.<mailto:@.>> Cc: Jay Gong @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

Just to make sure: Are you using an APIm instance with the DEV sku?

From: gjjtip0926 @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Sent: den 7 november 2022 01:42 To: microsoft/vscode-apimanagement @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Cc: Subscribed @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Subject: [microsoft/vscode-apimanagement] Policy Debugging is not functioning (Issue #275)

I am testing the policy debugging feature in the VS code for APIM service. https://learn.microsoft.com/en-us/azure/api-management/api-management-debug-policies

The tested API returns the response always as expected while it doesn't jump into policy debugging though I start it.

What I have tried and checked: 1.I have tested APIM instance with or without VNET integration, not working. 2.I have confirmed that I'm setting the global subscription key as Ocp-Apim-Debug. 3.I have confirmed that I have default policy definition in the API/Operation. 4.I have tried to access the API url with or without VPN, not working. 5.I have tested by using Postman and CURL, not working. 6.I have called the Operation in other local environment, not working still. Once the debug session is started, we can observe following initialization log.

[image]https://user-images.githubusercontent.com/98293404/200204990-80d88b91-a2f1-4d46-a175-7d1cca05040c.png

May you kindly share any further troubleshooting suggestion or did I miss anything?

- Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-apimanagement/issues/275, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE7EMJYSMB2REAP2YAXWOTTWHBF4VANCNFSM6AAAAAARYV6VVI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.mailto:***@***.******@***.***<mailto:***@***.******@***.***%3cmailto:***@***.******@***.***>>>

- Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-apimanagement%2Fissues%2F275%23issuecomment-1305213100&data=05%7C01%7Cjaygong%40microsoft.com%7Cd867ef93c40745ff6c3a08dac0959cdd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638034046105399783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sLBlgamalV1UnHvK%2F3018PrMsuS%2FSIEE%2BMaiTMe0cb4%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXN5NHF5PZPTJLT5WYICWHTWHCY3XANCNFSM6AAAAAARYV6VVI&data=05%7C01%7Cjaygong%40microsoft.com%7Cd867ef93c40745ff6c3a08dac0959cdd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638034046105399783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VJXvAbTRpSfLjxafViSu5G7%2F0G%2BF%2BSxBqdB1sJ9kmuw%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-apimanagement/issues/275#issuecomment-1305262247, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE7EMJ63SMYBIR7SBGRE43LWHC5WLANCNFSM6AAAAAARYV6VVI. You are receiving this because you commented.Message ID: @.**@.>>

jtourlamain commented 1 year ago

Same issue here. Tested on APIM developer sku and standard sku.

MekelCon commented 1 year ago

Hello,

i had the same issue. For me it the issue is here : inside src/debugger/apimDebug.ts line 390

We call const resourceUrl = `${managementAddress}/subscriptions/master?api-version=2019-01-01\`;

But today according this documentation we should call const resourceUrl = `${managementAddress}/subscriptions/master/listSecrets?api-version=2021-08-01`; with POST method

And edit last line of the method : return subscription.properties.primaryKey; replace by return subscription.primaryKey;

fpdutra commented 1 year ago

You can solve this by running this on AZ CLI: az apim update --name API Management Name -g Resource Group --set apiVersionConstraint.minApiVersion=2019-01-01

slahirucd7 commented 1 year ago
image

Debugger is not starting and nothing happens after this view.