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

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DevOps for Private APIs. With DreamFactory API Generation, you get:

  • Auto-generated live APIs mapped from database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Value this insightful article and join the thriving DEV Community. Developers of every skill level are encouraged to contribute and expand our collective knowledge.

A simple “thank you” can uplift someone’s spirits. Leave your appreciation in the comments!

On DEV, exchanging expertise lightens our path and reinforces our bonds. Enjoyed the read? A quick note of thanks to the author means a lot.

Okay