Code Monkey home page Code Monkey logo

vscode-apimanagement's Introduction

Build Status

Azure API Management Extension for Visual Studio Code

Use the Azure API Management extension to perform common management operations on your Azure API Management service instances without switching away from Visual Studio Code.

Azure API Management is a fully managed service that helps customers to securely expose their APIs to external and internal consumers. API Management serves as a facade and a front door for the API implementations and enables their frictionless consumption by developers. Visit this page for more information and resources related to Azure API Management.

Requirements

All you need is an Azure Subscription to get started. If you don't have one, click here for a free subscription with $200 in Azure credits!

Main Features

  • Create and delete an API Management instance
  • Create an API by importing an OpenAPI specification
  • Edit APIs and operations in Azure Resource Manager or OpenAPI formats
  • Edit policies at any scope
  • Associate an API with a product
  • Create, delete, and edit Named Values
  • Test an API using REST Client
  • Command Palette support for most features
  • Extract API and service configurations into ARM templates
  • Import Azure Functions - Transform HttpTriggers into APIs
  • Import App Service WebApp
  • Manage Self-Hosted Gateways
  • Policy Debugging
  • Scaffold Azure Functions
  • Show diffs against last saved version
  • Switch / Release API Revisions
  • API Filter
  • Policy Debugging on Self-Hosted Gateways
  • Manage User Subscriptions
  • Manage Authorization Providers, Authorizations and Access Policies

Create an API Management instance using defaults

Create-simple

Create an API Management instance using custom options

Create-advanced

Create an API by importing an OpenAPI specification

Please note: only JSON format is supported currently. Import-OAS

Edit an API in Azure Resource Manager format

Edit-JSON

Edit an API in OpenAPI format

Edit-OAS

Edit policies

Edit-Policy

Test an API

Test-API

Create and edit a Named Value

Named-Values

Extract Service or API

Extract

Import Function App

importFuncApp

Import App Service Web App

importWebApp

Deploy Gateway with Docker or Kubernetes

deployGateway

Debug Policy

debugPolicy

Scaffold Azure Functions

generateFunctions

Show diffs against last saved version

diffing

Switch API Revision

SwitchRevision

Release API Revision

ReleaseRevision

API Filter

apiFilter

Self-Hosted Gateway Debugging

selfHostedDebugging

Manage User Subscriptions

manageUserSubscription

Intellisense for Policy Expressions.

Follow instructions here.

Managing Azure Subscriptions

If you are not signed in to Azure, you will see a "Sign in to Azure..." link. Alternatively, you can select "View->Command Palette" in the VS Code menu, and search for "Azure: Sign In".

If you don't have an Azure Account, you can sign up for one today for free and receive $200 in credits by selecting "Create a Free Azure Account..." or selecting "View->Command Palette" and searching for "Azure: Create an Account".

You may sign out of Azure by selecting "View->Command Palette" and searching for "Azure: Sign Out".

To select which subscriptions show up in the extension's explorer, click on the "Select Subscriptions..." button on any subscription node (indicated by a "filter" icon when you hover over it), or select "View->Command Palette" and search for "Azure: Select Subscriptions". Note that this selection affects all VS Code extensions that support the Azure Account and Sign-In extension.

Contributing

There are several ways you can contribute to this repo:

  • Ideas, feature requests and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, share your ideas, or contribute to ongoing discussions.
  • Documentation: Found a typo or an awkwardly worded sentence? Submit a PR!
  • Code: Contribute bug fixes, features, or design changes:
    • Clone the repository locally and open in Visual Studio Code.
    • Install TSLint for Visual Studio Code.
    • Open the terminal (press CTRL+`) and run npm install.
    • To build, press F1 and type in Tasks: Run Build Task.
    • Debug: press F5 to start debugging the extension.

Legal

Before we can accept your pull request you will need to sign a Contribution License Agreement. All you need to do is to submit a pull request, then the PR will get appropriately labelled (e.g. cla-required, cla-norequired, cla-signed, cla-already-signed). If you already signed the agreement we will continue with reviewing the PR, otherwise system will tell you how you can sign the CLA. Once you sign the CLA all future PR's will be labeled as cla-signed.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

License

MIT

vscode-apimanagement's People

Contributors

annaji-msft avatar deaglegross avatar dependabot[bot] avatar ejizba avatar galiniliev avatar horihiro avatar joechung-msft avatar kaiwalter avatar malincrist avatar miaojiang avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar nideshp avatar philipf avatar pramodvalavala-msft avatar quanterion avatar rupengliu avatar solankisamir avatar tomkerkhove avatar vladvino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-apimanagement's Issues

Change the revision to edit

It's not a real issue but more a question:
It seems that VS Code only allows me to edit the current revision, how can I change it?

Wiki Documentation

Update wiki with usage details before the release.
The documentation must include all the scenarios that the extension covers.
Include documentation to achieve completions using razor tooling

Extract API - Support for PolicyXML SAS token

The extract feature adds a LinkedTemplatesUrlQueryString parameter which can be used to pass a SAS token for the blob storage container, however there is no querystring parameter exposed for PolicyXML. Please add a PolicyXMLUrlQueryString parameter.

Azure APIM - Converting SOAP to REST through VS Code

We are trying to import the WSDL in VScode editor which has Azure APIM extension, but looks like we don’t have an option to import the WSDL and convert them to REST through VScode. Could you please confirm?

Error uploading updated openapi document for Function App API

I'm sure the source of this issue is that the ARM information on the function API does not include the serviceUrl property unlike the others. Not really sure where that metadata is stored since even logic apps use the property.

Repro steps:

  1. Create/Use a function app and corresponding function (in my scenario a javascript v2)
  2. Import function into APIM instance using Function App shortcut in API section (azure portal)
  3. In vscode-apimanagement, navigate to the new API instance and edit the openapi document via right-click context menu
  4. Click the button to upload the document after saving

Action: azureApiManagement.apiEditor.onDidSaveTextDocument
Error type: Error
Error Message: Internal error: Expected value to be neither null nor undefined: serviceUrl

Version: 0.1.1
OS: win32
Product: Visual Studio Code
Product Version: 1.36.0
Language: en

Call Stack
OpenApiEditor.<anonymous> extension.bundle.js:262:2686788
o extension.bundle.js:262:2684695

Initial alpha version

Initial version of the extension experience would include,

API Management View

  • Services
    • Global Policy
    • APIs
      • Version Set
      • API
        • API Policy
        • Operations
          • Operation Policy

Enable to

  • Create Service.
    • default mode (Consumption, WestUS)
    • advanced mode
  • Create API/Operations via OpenAPI 2.0(swagger) and 3.0 json format.
    • by file
    • by link
  • Navigate to Service in Azure Portal.
  • Edit API ARM payload.
    • Json Validation
  • Edit API via OpenAPI.
  • Edit Operation ARM payload.
    • Json Validation
  • Edit Policies
    • Syntax Highligting (rely on razor tooling)
    • Snippets
  • Test a Operation leveraging https://github.com/Huachao/vscode-restclient
  • Copy Subscription Key for testing
  • Delete Service, API or Operation.
  • Achieve all the above functionality (commands) through command palette.

Check for dotnet core framework installed before running extract command

Running command: "dotnet apimtemplate.dll extract --extractorConfig "c:\Users\anganti\Desktop\extract\anganti-webapp.json""...
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

  • The following frameworks were found:
    1.0.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    1.1.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    3.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

Enable tracking active item

Most of my API Management Files just contain a GUID as filename.

servicename-57f61a470a47690a009a5668-58f87234f79cdf07c428af42.policy.cshtml

If there several policies openend in VS Code, it's not possible to identify which file belongs to the correct policy.

At least tracking the active item by selecting the current policy in the side bar would help

Support Function Import from different subscriptions

If you choose to import function app to APIM, you see only function apps from the subscription the APIM reside in. It would be great to be able to select from different subscriptions, cause you often have one APIM as central management for external access, but develop functions in different subscriptions.

Use zip package manager instead of checkin in devops resource kit;

Running command: "dotnet apimtemplate.dll extract --extractorConfig "/Users/xxxx/Documents/untitled folder/vscode-apim-demo.json""...
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
  - Check application dependencies and target a framework version installed at:
      /
  - Alternatively, install the framework version '2.1.0'.

Make the extract functionality independent of framework version.

error on extension load

I'm running on macOS using VS Code's Insider builds. When the extension loads I'm seeing this error pop up:

image

If I install the C# extension, the error goes away.

Missing one or more userOptions when creating new Api

Repro steps:

  1. first-time installed vscode-apimanagement extension
  2. signed in to Azure / Subscription in API Management explorer
  3. command: Azure API Management: Add API to Gateway
  4. selected: Subscription / Service / APIs / + Create new API
  5. pop up with error message below is displayed

Action: azureApiManagement.addApiToGateway
Error type: Error
Error Message: Missing one or more userOptions when creating new Api

Version: 0.1.3
OS: linux
Product: Visual Studio Code
Product Version: 1.44.2
Language: en

Call Stack
ApisTreeItem.<anonymous> extension.bundle.js:262:858488
extension.bundle.js:262:857101
n extension.bundle.js:262:856878
ApisTreeItem.createChildImpl extension.bundle.js:262:858279
ApisTreeItem.<anonymous> extension.bundle.js:1:334735
extension.bundle.js:1:333931
n extension.bundle.js:1:333708
ApisTreeItem.createChild extension.bundle.js:1:334591
ApisTreeItem.<anonymous> extension.bundle.js:1:337250
extension.bundle.js:1:333931
n extension.bundle.js:1:333708
data extension.bundle.js:1:337199
ApisTreeItem.<anonymous> extension.bundle.js:1:335593
o extension.bundle.js:1:333764
processTicksAndRejections task_queues.js:89:5

Checking Framework Version fails

When trying to execute "export service" on a new Windows 10 machine, I am stopped because of the .Net Framework version check looking for Version 2.1. That version of .Net Framework is no longer available and cannot be installed. Please update the version check to allow for version + using semantic versioning.

Enable Nightly Builds

Enable nightly builds. These would be used for the release of the package as well as long running tests only run here

Cannot build on macOS

MacOS
VS Code Insiders

Clone this repo...

git clone https://github.com/microsoft/vscode-apimanagement
cd vscode-apimanagement
npm install

and then try to build...

~/src/vscode-apimanagement$ yarn build
yarn run v1.12.3
$ tsc -p ./
error An unexpected error occurred: "spawn E2BIG".
info If you think this is a bug, please open a bug report with the information provided in "/Users/chris/src/vscode-apimanagement/yarn-error.log".
info Visit https://yarnpkg.com/en/

It looks like this issue: yarnpkg/yarn#5420

If I rename NOTICE.html to something else, build works fine.

Cannot read property 'replace' of undefined

While trying to open some APIs in Open Editor, we get this error.

Action: azureApiManagement.showApi
Error type: Error
Error Message: Cannot read property 'replace' of undefined

Version: 0.1.3
OS: win32
Product: Visual Studio Code
Product Version: 1.45.1
Language: en

Call Stack
OpenApiEditor.<anonymous> extension.bundle.js:262:5370469
a extension.bundle.js:262:5369472

Snippets are not reliable on Mac

Currently snippets do not work reliabiliy on mac. As a work around use (F1 -> Insert Snippets) if completions do not work in editor. Needs further investigation.

Fail to Close and Save an API inside API Manager

Repro steps:

Action: azureApiManagement.OperationResourceEditor.onDidSaveTextDocument
Error type: Error
Error Message: Unexpected token < in JSON at position 0

Version: 0.1.1
OS: win32
Product: Visual Studio Code
Product Version: 1.38.1
Language: en

Call Stack
OperationResourceEditor.<anonymous> extension.bundle.js:1:462100
module.exports.n extension.bundle.js:1:461360
module.exports.n extension.bundle.js:1:461137
OperationResourceEditor.updateData extension.bundle.js:1:461807
OperationResourceEditor.<anonymous> extension.bundle.js:1:465316
o extension.bundle.js:1:462755

Manage Named Values

Named Values

  1. Show collection of Named Values
  2. Right click options on the collection: New Named Value
  3. Right click options on an individual Named Value: Delete, Edit

Manage Products

Products

  1. Show collection of products
  2. Under each product, show APIs of this product
  3. Right click options on product: Add API
  4. Right click options on an API: remove the API from the product
  5. Allow editing product level policies

I can't 'see' my consumption tier API Management instance

I have a consumption tier API Management Instance deployed in my subscription. However when I connect to the subscription in VSCode, the API Management extension doesn't display this instance.
I'm haven't got any outstanding updates, so assume I'm running the latest version of VSCode and the extension.

Please let me know if you need any more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.