【问题标题】:Azure API Management - How to add an API and Operation using Azure Cli?Azure API 管理 - 如何使用 Azure Cli 添加 API 和操作?
【发布时间】:2020-10-14 13:12:06
【问题描述】:

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

我已尝试使用 azure cli 添加相同的 API 和操作,但无法成功。如何使用 Azure Cli 或 Azure Powershell 在 Azure API Management 上添加 API 和简单操作?

【问题讨论】:

  • 你有异常吗?为什么它不起作用?

标签: azure azure-api-management


【解决方案1】:

您可以使用 Azure CLI:

请在我的博文中找到更多详细信息:
Create Azure API Management API Operation with Azure CLI

    $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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-11
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    • 1970-01-01
    • 1970-01-01
    • 2017-04-21
    • 1970-01-01
    相关资源
    最近更新 更多