首页 > 其他分享 >【Azure APIM】解决APIM Self-hosted Gateway在AKS上,最开始访问时候遇见的404问题

【Azure APIM】解决APIM Self-hosted Gateway在AKS上,最开始访问时候遇见的404问题

时间:2023-10-16 20:00:28浏览次数:39  
标签:API HTTP AKS Self 访问 404 hosted APIM

问题描述

根据APIM官方文档,创建Self-hosted 网关在AKS中( 使用 YAML 将自承载网关部署到 Kubernetes :https://docs.azure.cn/zh-cn/api-management/how-to-deploy-self-hosted-gateway-kubernetes),但是访问AKS中Services的Endpoint,得到的确实 404页面。

{
    "statusCode": 404,
    "message": "Resource not found"
}

访问截图:

查看AKS POD的日志,也是显示404 错误

PS C:\> kubectl get pods
NAME                                                    READY   STATUS      RESTARTS   AGE
lbapimselftest01-77f5b8db75-7skq4                       1/1     Running     0          5h24m
node-debugger-aks-agentpool-36712949-vmss000000-dlf6h   1/1     Running     0          4h57m
node-debugger-aks-agentpool-36712949-vmss000000-kv2ln   0/1     Completed   0          5h9m
sputnik-metrics-965c64dbc-zt94k                         2/2     Running     0          5h48m
PS C:\> kubectl logs lbapimselftest01-77f5b8db75-7skq4

... ...

[Info] 2023-10-16T11:26:38.139 [GatewayLogs], isRequestSuccess: False, totalTime: 0, category: GatewayLogs, callerIpAddress: 18.20.91.9, timeGenerated: 2023-10-16T11:26:38.139, region: ChinaNorth3, correlationId: 12909eb4-8dc4-438b-b27d-c667aca4852a, method: GET, url: http://14.6.8.17/echo/resource?param1=sample&param2=test, responseCode: 404, responseSize: 198, cache: none, clientProtocol: HTTP/1.1, lastError: {
"source": "configuration",
"reason": "OperationNotFound",
"message": "Unable to match incoming request to an operation.",
"section": "backend"
}, correlationId: 12909eb4-8dc4-438b-b27d-c667aca4852a
[Info] 2023-10-16T11:26:41.435 [GatewayLogs], isRequestSuccess: False, totalTime: 0, category: GatewayLogs, callerIpAddress: 18.20.91.9, timeGenerated: 2023-10-16T11:26:41.435, region: ChinaNorth3, correlationId: cd4ad591-c3fa-4241-8dca-e10370c8d776, method: GET, url: http://14.6.8.17/, responseCode: 404, responseSize: 198, cache: none, clientProtocol: HTTP/1.1, lastError: {
"source": "configuration",
"reason": "OperationNotFound",
"message": "Unable to match incoming request to an operation.",
"section": "backend"
}, correlationId: cd4ad591-c3fa-4241-8dca-e10370c8d776

 

 

问题解答

首先,需要查看APIM Self-hosted Gateway是否有关联到被访问的API,测试中所使用的是echo API。

再次访问API接口:http://xxx.xxx.xxx.xxx/echo/resource?param1=sample&param2=test, 依旧是404,就需要查看是否是API的设定中是否允许HTTP访问,

所以,判断这是因为APIs的设置中,只允许了HTTPS访问。当修改为HTTP(S)后,HTTP/HTTPS都可以访问成功。解决了最开始访问出现404的问题。

总结,需要检查APIM中APIs的两个设定:

1)是否为此API添加到 self-hosted gateway 

2)访问中配置的是否只能HTTP (HTTPS) 访问 

 

参考资料

使用 YAML 将自承载网关部署到 Kubernetes : https://docs.azure.cn/zh-cn/api-management/how-to-deploy-self-hosted-gateway-kubernetes

Azure API Management Self-hosted Gateway - SOAP API not working : https://learn.microsoft.com/en-us/answers/questions/1152222/azure-api-management-self-hosted-gateway-soap-api?page=1

 

 

 

标签:API,HTTP,AKS,Self,访问,404,hosted,APIM
From: https://www.cnblogs.com/lulight/p/17768225.html

相关文章

  • Build ASP.NET Core applications deployed as Linux containers into an AKS/Kuberne
    原文:https://learn.microsoft.com/en-us/dotnet/architecture/containerized-lifecycle/design-develop-containerized-apps/build-aspnet-core-applications-linux-containers-aks-kubernetesAzureKubernetesServices(AKS)isAzure'smanagedKubernetesorchestrat......
  • 华为云发布CodeArts APIMock服务,精准Mock,并行开发零等待!
    本文分享自华为云社区《华为云发布CodeArtsAPIMock服务,精准Mock,并行开发零等待!》,作者:华为云头条。2023年10月10日,华为云正式发布CodeArtsAPIMock服务,这是一款模拟API响应的仿真工具,能够生成开发者所需的API响应数据,帮助开发人员和测试人员在软件研发过程中快速开展调试和验证......
  • 解密Prompt系列17. LLM对齐方案再升级 WizardLM & BackTranslation & SELF-ALIGN
    话接上文的指令微调的样本优化方案,上一章是通过多样性筛选和质量过滤,对样本量进行缩减,主打经济实惠。这一章是通过扩写,改写,以及回译等半监督样本挖掘方案对种子样本进行扩充,提高种子指令样本的多样性和复杂度,这里我们分别介绍Microsoft,Meta和IBM提出的三个方案。Microsoft:WizardL......
  • 类里面静态方法(@staticmethod),类方法(@classmethod)和实例方法(self)的使用与区别
    前言python类里面常用的方法有3个:静态方法(@staticmethod),类方法(@classmethod)和实例方法(self)本篇讲解这3种方法在使用上有什么区别。函数先从函数说起,方法跟函数是有区别的,经常有人容易混淆,函数定义是def关键字定义(外面没class)deffun():a="hello"returna#......
  • 为什么 CSS flex 布局中没有 `justify-items` 和 `justify-self`?
    为什么CSSflex布局中没有justify-items和justify-self?为什么在CSSflex布局中存在align-items和align-self,却没有justify-items和justify-self呢?要解答这个问题,首先需要理解主轴(mainaxis)和交叉轴(crossaxis)之间的差异。1.主轴和交叉轴的区别在没有折行的情况......
  • Implicit Autoencoder for Point-Cloud Self-Supervised Representation Learning论文
    ImplicitAutoencoderforPoint-CloudSelf-SupervisedRepresentationLearning2023ICCV*SimingYan,ZhenpeiYang,HaoxiangLi,ChenSong,LiGuan,HaoKang,GangHua,QixingHuang*;ProceedingsoftheIEEE/CVFInternationalConferenceonComputerVision......
  • 论文阅读:Semi-supervised point cloud segmentation using self-training with label
    Semi-supervisedpointcloudsegmentationusingself-trainingwithlabelconfidencepredictionLi等人(2021b)基于伪标签置信度预测的半监督分割方法,额外设计判别网络(discriminatornetwork),该网络目标是区分预测结果和真实标注,并对无标注点云的预测结果输出置信度预测,对判别网络......
  • 面向对象 静态方法和动态方法 ;静态更先进因为新建和被调用时不需要传self
    展示动态方法 需要加self#A.py调用B的制作伞和扇子fromBimportHandmadeclassWeather:def__init__(self,type):self.type=typedefaction(self):f=Handmade.make_fan(self)u=Handmade.make_umbrella(self)pri......
  • self
    自我介绍哪里人准备在长沙吗我在本科时候,每年最具幸福感的城市排名长沙都榜上,之前也不太清楚世界有这么大去年跟家里人有去长沙玩过两天,岳麓山,烟火气息要比我呆过的地方更弄一些。生活压力来说我感觉也不会那么的大,如果能在长沙的话那是很好的选择。本科是南京工......
  • 论文解读:CrossPoint: Self-Supervised Cross-Modal Contrastive Learning for 3D Poin
    CrossPoint:Self-SupervisedCross-ModalContrastiveLearningfor3DPointCloudUnderstanding本文提出一种简单的跨模态3维—2维区域对应模块,分别将点云模态和图像模态提取的特征向量重新投影到一个公共的特征空间中,并基于最大化与模态无关的互信息的思想设计对比学习损失......