繁体   English   中英

Azure API 管理 - 如何使用 Azure Cli 添加 API 和操作?

[英]Azure API Management - How to add an API and Operation using Azure Cli?

我在 Azure API 管理上手动添加了以下 API 和操作

在此处输入图片说明

在此处输入图片说明

我曾尝试使用 azure cli 添加相同的 API 和操作,但无法实现。 如何使用 Azure Cli 或 Azure Powershell 在 Azure API 管理上添加 API 和简单操作?

您可以使用 Azure CLI:

请在我的博客文章中找到更多详细信息:
使用 Azure CLI 创建 Azure API 管理 API 操作

    $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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM