简体   繁体   English

Azure上的Asp.Net Core Web API

[英]Asp.Net Core Web API on Azure

I am writing a WebAPI using Asp.Net Core 2 and trying to publish it to Azure but I cannot access the API through API Management Service. 我正在使用Asp.Net Core 2编写WebAPI,并尝试将其发布到Azure,但是我无法通过API管理服务访问API。 I am able to publish an older Asp.Net WebAPI with the same connection string and access it just fine, but the Asp.Net Core Web API I am not. 我可以使用相同的连接字符串发布较旧的Asp.Net WebAPI并可以正常访问它,但是我却不能。 I also notice that the Asp.Net Core API is listed as a Web App but the WebAPI is listed as a Api App. 我还注意到,Asp.Net Core API被列为Web应用程序,但WebAPI被列为Api应用程序。 What am I doing wrong? 我究竟做错了什么?

Azure Portal Azure门户

I also notice that the Asp.Net Core API is listed as a Web App but the WebAPI is listed as a Api App. 我还注意到,Asp.Net Core API被列为Web应用程序,但WebAPI被列为Api应用程序。

As I have tested, when you create WebAPI in vs you choose Azure API App template, so after deploying, it is listed as a API App. 正如我已经测试过的,当您在vs中创建WebAPI时,您选择了Azure API App模板,因此在部署之后,它被列为API App。
在此处输入图片说明

When you add a new API with API App in APMS, it only get the WebAPI and could not access to Asp.net core WebAPI. 当您在APMS中使用API App添加新的API时,它仅获取WebAPI,而无法访问Asp.net核心WebAPI。 在此处输入图片说明

For more details about access the API through API Management Service, you could refer to this article . 有关通过API管理服务访问API的更多详细信息,可以参考本文

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

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