简体   繁体   English

使用 Azure Devops Pipeline 创建 HTTP API

[英]Create an HTTP API by using Azure Devops Pipeline

I am trying to Create An Http Api Using Azure Pipelines我正在尝试使用 Azure Pipelines 创建一个 Http Api

I have a Flask Api that is deployed to a Aks Pod exposed through a privat LB with api management in the same vnet我有一个 Flask Api,它部署到通过 privat LB 暴露的 Aks Pod,并在同一个 vnet 中进行 api 管理

Here Is What I'm Trying to Achieve :这是我想要实现的目标:

使用 APIM

oing it it manually Works Fine with the pod private ip adresse :使用 pod private ip address 手动运行它可以正常工作:

Note : Im using http api not openAPI注意:我使用的是 http api 而不是 openAPI

在此处输入图像描述

在此处输入图像描述

  • when i configure the api from Azure Devops Pipeline当我从 Azure Devops Pipeline 配置 api 时

在此处输入图像描述

  • API Management - Create/Update Product : succeed API 管理 - 创建/更新产品:成功
  • API Management - Create/Update API : Failed API 管理 - 创建/更新 API:失败

在此处输入图像描述

在此处输入图像描述

i understand that it's an openapi configuration in the pipelines but i couldn't find any pipeline to cnofigure http api in devops我知道这是管道中的 openapi 配置,但我找不到任何管道来在 devops 中配置 http api

We Solved this problem by using Terraform files我们通过使用 Terraform 文件解决了这个问题

Following this Procedure遵循此程序

We Adapted The Terraform Files To our Pipelines :我们将 Terraform 文件改编为我们的管道:

We First Created The API then The Operations as you can see in the pipeline :我们首先创建了 API,然后创建了操作,正如您在管道中看到的那样:

在此处输入图像描述

And Then added the init,plan and apply tasks on the stage :然后在舞台上添加初始化、计划和应用任务:

在此处输入图像描述

And Just like That We created and configured the Api就像我们创建并配置了 Api 在此处输入图像描述

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

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