无法从浏览器或邮递员访问Azure API 管理

问题描述 投票:0回答:1

我在 azure APIM 中创建了一个简单的 API,它调用 azure 函数 API 在 Azure API 管理测试和开发人员门户中测试正常,如下

请求网址 https://apigwdevleoper.azure-api.net/fu1/http_trigger HTTP请求 发布 https://apigwdevleoper.azure-api.net/fu1/http_trigger HTTP/1.1 主机:apigwdevleoper.azure-api.net HTTP响应 信息 痕迹 HTTP/1.1 200 好 内容类型:文本/纯文本;字符集=utf-8 日期: 2023 年 12 月 3 日,星期日 15:31:55 GMT 传输编码:分块 不同:起源

此 HTTP 触发函数执行成功。在查询字符串或请求正文中传递名称以获得个性化响应。

但是当我尝试使用浏览器或邮递员访问它时,出现以下错误

{ "statusCode": 404, "message": "资源未找到" }

我已在 apim 策略和 azure 功能上启用了 CORS

我使用邮递员通过以下 URL 调用 API

https://apigwdevleoper.azure-api.net/fu1/http_trigg

回复是

{ “状态代码”:404, "message": "未找到资源" }

azure integration azure-api-management
1个回答
0
投票

我可以在 postman 中访问 APIM 请求 URL。

我正在使用下面显示的请求 URL。

enter image description here

我的功能是匿名身份验证功能,在邮递员中,我在标头中传递

ocp-apim-subscription-key
密钥。

enter image description here

如果您收到资源未找到错误,我相信您需要检查您的函数是否存在。

© www.soinside.com 2019 - 2024. All rights reserved.