Azure API Management Tool To support configuration of Microsoft Azure API Management.
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.
az login
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 |
List of all Backends from API management
Arguments
--resource-group
my resource group from azure
--service-name
my service from azure
apimtool apim backend list --resource-group rg-my-resource-group --service-name apim-my-name
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]
apimtool apim api list --resource-group rg-my-resource-group --service-name apim-my-name -o list
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}
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 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}
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 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
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}]
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
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 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
apimtool template backend export --resource-group rg-my-resource-group --service-name apim-my-name