https://github.com/tarathep/apimtool
Azure API Management Tool
https://github.com/tarathep/apimtool
apimanagement azure cli-app cloud tool
Last synced: 2 months ago
JSON representation
Azure API Management Tool
- Host: GitHub
- URL: https://github.com/tarathep/apimtool
- Owner: tarathep
- License: apache-2.0
- Created: 2022-12-07T08:05:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-19T00:10:06.000Z (over 2 years ago)
- Last Synced: 2025-01-17T11:33:22.751Z (over 1 year ago)
- Topics: apimanagement, azure, cli-app, cloud, tool
- Language: Go
- Homepage: https://azure.microsoft.com/en-us/products/api-management
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# APIM Tool
Azure API Management Tool To support configuration of Microsoft Azure API Management.



[](https://svgshare.com/i/Zhy.svg)
[](https://svgshare.com/i/ZjP.svg)
[](https://svgshare.com/i/ZhY.svg)
## Using Azure CLI to Sign In
You could easily use az login in command line to sign in to Azure via your default browser. Detail instructions can be found in Sign in with Azure CLI.
```bash
az login
```
## Initialize Environment Variables
Before to use, you must set `Subscription ID` and `Location` to CLI connect to Azure resource.
|Name|Value|
|--|--|
|APIMTOOL_AZURE_SUBSCRIPTION_ID|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx|
|APIMTOOL_AZURE_LOCATION|southeastasia|
## APIM command directly
### List Backends
List of all Backends from API management
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```bash
apimtool apim backend list --resource-group rg-my-resource-group --service-name apim-my-name
```
### List APIs
List all API on Azure API Management.
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```-o/--option``` option to view [default :table/list]
```bash
apimtool apim api list --resource-group rg-my-resource-group --service-name apim-my-name -o list
```
### List APIs Depending on backend
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```--backend-id``` backend-id [table/list]
```--url``` target backend URL
```--protocol``` support 2 types only `{http,soap}`
```bash
apimtool apim backend api depend list --resource-group rg-my-resource-group --service-name apim-my-name --backend-id mybackend --url https://httpbin.org --protocol {http/soap}
```
### Create Backend
Create backend on Azure API Management and check duplication before created.
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```--backend-id``` backend-id [table/list]
```--url``` target backend URL
```--protocol``` support 2 types only `{http,soap}`
```bash
apimtool apim backend create --resource-group rg-my-resource-group --service-name apim-my-name --backend-id mybackend --url https://httpbin.org --protocol {http/soap}
```
## Parser To Support Source to ARM Template
Parser Config file JSON to source templates
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```--api-id``` API ID on Azure API Management
```--file-path``` path to file config
```bash
apimtool parse --env dev --api-id myapiid --resource-group rg-my-resource-group --service-name apim-my-name [--file-path {./apim-apis-dev/myapiname/myapiname.json}]
```
## Template (ARM)
### Add Backend into ARM Templates
Add backend into `backends.template.json` and check validate IP target.
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```--backend-id``` Backend ID on Azure API Management
```bash
apimtool template backend create --resource-group rg-my-resource-group --service-name apim-my-name --backend-id hello --url https://tarathep.com --protocol http
```
### Export Backend ARM Template from APIM
Export configuration and create `backends.template.json` from source APIM.
Arguments
```--resource-group``` my resource group from azure
```--service-name``` my service from azure
```--backend-id``` Backend ID on Azure API Management
```bash
apimtool template backend export --resource-group rg-my-resource-group --service-name apim-my-name
```