/APICenter-Analyzer

Azure API Center Analyzer Sample Code

Primary LanguageTypeScriptMIT LicenseMIT

Analyze your API Specs with Azure API Center (Preview)

Overview

๐Ÿ’ก What is Azure API Center?

Azure API Center is a service that helps you develop and maintain a structured inventory of your organizationโ€™s APIs. With API Center, you can track all of your APIs in a centralized location, regardless of their type, lifecycle stage, or deployment location. API Center enables API discovery, reuse, and governance empowering API Platform Teams.

๐Ÿ’ผ API Governance & Azure API Center

API governance is a critical aspect of managing APIs across an organization. It involves establishing and enforcing policies and procedures that guarantee the quality, consistency, security, and compliance of APIs. Effective API governance not only maximizes the value of an organization's API portfolio but also reduces complexity, eliminates redundancy, and mitigates potential risks.

For API Platform Teams, governance is crucial as it guides them in designing, building, and deploying APIs that align with the organization's objectives, standards, and best practices.

To facilitate robust API governance, we're excited to introduce API Analysis in Azure API Center. API Analysis employs API linting, a technique that validates your API specifications against a predefined set of rules or standards. With API Analysis, you can ensure your APIs adhere to your organization's guidelines and best practices, making them consistently secure and compliant.

API Analysis currently supports OpenAPI v2, v3.x, and AsyncAPI specifications uploaded as JSON or YAML files.

๐Ÿ’ผ API Analysis in Azure API Center (Overview)

Here is a high-level overview of how API analysis works in Azure API Center Overview

๐Ÿš€ How to Run API Analysis

๐Ÿ”ง Configure your environment

Before you get started, make sure you have the following requirements in place:

๐Ÿ”ง Configure & run your function locally

  • Clone the APICenter-Analyzer repository to your local machine <TODO: insert link>
  • Open the Project in Visual Studio Code
  • To start the function locally, press F5 or the Run and Debug icon in the left-hand side Activity bar. The Terminal panel displays the Output from Core Tools. Your app starts in the Terminal panel. You can see the URL endpoint of your HTTP-triggered function running locally. (If you have trouble running on Windows, make sure that the default terminal for Visual Studio Code isn't set to WSL Bash.)

โ˜๏ธ How to deploy

Follow the instructions in Quickstart: Create a function in Azure with TypeScript using Visual Studio Code. Start from the "Sign in to Azure" section and complete all subsequent sections.

๐Ÿ“„ Custom Ruleset

This template provides you with the default OAS (OpenAPI Specification) ruleset from Spectral. To see the exact rules within the ruleset, see OpenAPI Rules.

If you want to customize your Ruleset for analysis, simply swap out the default ruleset file oas.yaml located in {workSpaceFolder}/resources/rulesets with any valid Spectral ruleset file. We accept all valid Spectral formats (YAML, JSON, and JavaScript). Afterward, head over to the {workSpaceFolder}/src/constants.ts file and update the RulesetFileName constant with your chosen ruleset file name.

โœ๏ธ Contributing

See the contribution guidelines for ideas and guidance on how to improve the template. Thank you!

๐Ÿ“– 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 opencode@microsoft.com with any additional questions or comments.

โœŒ๏ธ Trademark Notice

Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoftโ€™s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-partyโ€™s policies.

๐Ÿ”Ž Telemetry

Data Collection. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoftโ€™s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

License

MIT