DEV Community

Markus Meyer
Markus Meyer

Posted on • Originally published at markusmeyer.hashnode.dev

1

Create Azure API Management API Operation with Azure CLI

To create an Azure API Management API or Operation you have to use the current version of Azure CLI:

Install Azure CLI

Check installed version:

az --version
Enter fullscreen mode Exit fullscreen mode

Install or update Azure CLI

Login

Before creating the API you have to be logged in. Maybe you have to select the correct tenant.

az login
Enter fullscreen mode Exit fullscreen mode

Script

Please find the Microsoft documentation here:

az apim api create

az apim api operation create

The script requires an existing API Management:

$resourceGroupName = "eval.datatransformation"
$serviceName = "mm-sample"
$apiId="lorem-ipsum"
$apiDisplayName="Lorem Ipsum"
$apiId="Lorem"
$apiPath="/lorem-ipsum"
$operationPath="/"
$operationDisplayName="Get"
$operationDescription="Gets the data"

az login

# create the API
az apim api create --service-name $serviceName  -g $resourceGroupName --api-id $apiId --path $apiPath --display-name $apiDisplayName

# create the Operation
az apim api operation create --service-name $serviceName  -g $resourceGroupName --api-id $apiId --url-template $operationPath --method "GET" --display-name $operationDisplayName --description $operationDescription

Enter fullscreen mode Exit fullscreen mode

Result

The API and operation is created:

image.png

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DreamFactory generates live REST APIs from database schemas with standardized endpoints for tables, views, and procedures in OpenAPI format. We support on-prem deployment with firewall security and include RBAC for secure, granular security controls.

See more!

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️