Throughout this reference sample, we'd like to give developer experiences how to use API Center (APIC) and seamless integration with API Management (APIM), as well as inner-loop development velocity increase.
- API Inventory
- To Showcase API Management integration to quickly build API inventory from many API Management instances
- To register APIs manually or through GitHub Actions workflow
- API Governance
- To perform shift-left API governance functionality in VS Code
- To run APIC Analyzer for server-side linting
- To manage custom metadata
- API Discovery and Consumption
- To integrate the client SDK in .NET & JavaScript
- To prepare the server app scaffolding in .NET and JavaScript
- To manage API Center OSS portal
- Azure Subscription
- Visual Studio Code with API Center extension
- Azure Developer CLI
- Azure CLI with API Center extension
- GitHub CLI
- .NET SDK 8.0 or later
- node.js 18.x or later
Provisioning and deploying all the resources are as easy as running a few commands. Follow the steps below to get started.
-
Fork this repository.
-
Log in with the following command. Then, you will be able to use the
azd
cli to quickly provision and deploy the application.# Authenticate with Azure Developer CLI azd auth login # Authenticate with Azure CLI az login
-
Run
azd provision
to provision all the resources to Azure and deploy the code to those resources.azd provision
-
After the deployment is completed, navigate to Azure Portal and find the API Center instance. Then, you'll see all the APIs registered.
-
Navigate to the API Analysis blade and see the analysis results.
-
Find the Azure Static Web App instance name ending with
-portal
and open the app to see the API Center portal. -
Login to the portal and you'll see all the APIs registered to the API Center.
-
If you want to see how APIs registered in API Center are integrated with the existing applications, run the following command to deploy both .NET apps and node.js apps to Azure.
azd deploy
-
If you want to run both
azd provision
andazd deploy
in one go, run the following command:azd up
If you want to integrate the CI/CD pipeline with GitHub Actions, you can use the following command to create a GitHub repository and push the code to the repository.
-
First of all, log in to GitHub.
# Authenticate with GitHub CLI gh auth login
-
Run the following commands to update your GitHub repository variables.
# bash/zsh AZURE_CLIENT_ID=$(./infra/scripts/get-azdvariable.sh --key AZURE_CLIENT_ID) azd pipeline config --principal-id $AZURE_CLIENT_ID
# PowerShell $AZURE_CLIENT_ID = $(./infra/scripts/Get-AzdVariable.ps1 -Key AZURE_CLIENT_ID) azd pipeline config --principal-id $AZURE_CLIENT_ID
-
Now, you're good to go! Push the code to the GitHub repository or manually run the GitHub Actions workflow to get your portal deployed.
Once you complete playing around with the resources, you can clean up all the resources provisioned by running the following command to avoid unnecessary cost shock.
azd down --purge --force
There are several ways to integrate API Center with your solutions. You can choose the one that fits your needs.
- API Center Analyzer Integration - .NET
- API Center Analyzer Integration - JavaScript
- API Registration