Azure / azure-api-management-policy-toolkit

Azure API Management policy toolkit is a set of libraries and tools to help managing and testing policies.
MIT License
15 stars 4 forks source link

VS Code Extension #22

Open christopherhouse opened 1 week ago

christopherhouse commented 1 week ago

Proposal

I really like the direction that the policy toolkit is taking the policy authoring experience. As a C# developer, this will absolutely make me more productive in authoring policies. I think a great way to make the authoring experience even more efficient would be a VS Code extension that can automate the compilation process and even post the transpiled XML back to an API Management service instance.

This could possibly be done using the existing API Management VS Code extension. I see the user experience as something like this:

  1. Via extension in VS Code, create a new policy project. This would create the necessary local directory structure and install the necessary nuget packages.
  2. Once the project is created, navigate to the APIM VS Code extension and select a policy authoring scope. This would create a new class for authoring policy and place it in the appropriate location in the local project directory.
  3. After authoring and saving the policy file, the extension could compile the code, and optionally, post the transpiled XML back to an APIM service instance for smoke testing on a live APIM service.

Component

Compiler

Contact Details

chhouse@microsoft.com

Mielek commented 2 days ago

Hey @christopherhouse ! Thank you for your suggestion. I see your point that the toolkit lacks. Creating an easy way to connect policy documents in Azure API Management with C# policy document class would help in further increasing productiveness and experience in policy document authoring.

I personally, would include that functionality with the current Azure API Management VS Code extension. At least, it looks like the place for it because all fetching, editing and deploy is already available there. We would need only to extend it to support the Policy Toolkit which would include project creation, policy document for scope creation and auto compile with optional auto deploy. @vladvino Would it be reasonable to do that?

But you mention a creation of a project. I think this is a good point that currently it is not ideal. I think, it would be reasonable to create special dotnet project template to do exactly that. This should allow seamless project kick to start and enough flexibility that it could be used manually or by VS code extension. It should be pretty easy to add that.

vladvino commented 47 minutes ago

@mikebudzynski @juliajuju93 fyi