已到达 Azure 端点,但调用 API 返回 404 错误 [英] Azure endpoint reached, but calls to API returning 404 error

查看:30
本文介绍了已到达 Azure 端点,但调用 API 返回 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已在 Azure 门户中设置了一个应用服务项目,然后使用 Visual Studio DevOps 完成了该项目的部署.当我访问 http://MyAzureSite.azurewebsites.net(此处提供 URL)时,我可以确认该服务已启动并正在运行.

We have set up an app service project in the Azure Portal and then went through deployment of the project using Visual Studio DevOps. When I go to http://MyAzureSite.azurewebsites.net (Made up URL here), I can confirm that the service is up and running.

但是当我添加api/ControllerName/getStatus"时,我收到了 404 错误.

But when I add "api/ControllerName/getStatus", I get a 404 error.

从我的本地机器呼叫工作正常.

Call from my local machine is working perfectly fine.

http://localhost:52686/api/status/getStatus

但不是:

http://MyAzureSite.azurewebsites.net/api/status/getstatus

GetStatus 的签名看起来不错:

Signature for the GetStatus looks good:

[HttpGet]
public List<Status> GetStatus()

推荐答案

我们不得不再次正确地重建项目,其创建项目的方式不正确.

We had to rebuild the project properly again, its the way project was created that was incorreect.

这篇关于已到达 Azure 端点,但调用 API 返回 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆