与Azure移动服务一起添加asp.net MVC页面 [英] Adding an asp.net MVC page along with Azure Mobile services

查看:71
本文介绍了与Azure移动服务一起添加asp.net MVC页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有基于Azure移动服务的后端(例如, https://api.myapp.com ) (AMS),现在我需要 1.添加不需要在AMS上的一两个API,例如一个心跳控制器来检查服务是否在线,不需要Zumo Auth 2.一个ASP.net MVC页面(例如 https://www.myapp.com ),该页面解释了有关应用

I have backend(e.g. https://api.myapp.com) based on the Azure Mobile services(AMS), now I need 1. add one or two apis that doesn't require to be on AMS e.g. an heartbeat controller to check that service is online or not, that doesn't require Zumo Auth 2. an ASP.net MVC page(e.g. https://www.myapp.com) that explains about the application

我可以使用现有的AMS来执行此操作吗,我尝试添加纯asp.net Web API,但是出现了端点不存在的错误

Can I use the existing AMS to do this, I tried to add plain asp.net web api, but getting error that end point doesn't exist

推荐答案

您是否真的在使用Azure移动服务,而不是Azure移动应用?通常,您不能在Azure移动服务上具有自定义域.由于您提到的是ZUMO Auth 2,所以我假设您的意思是App Service Auth,因此是Azure移动应用.

Are you truly using Azure Mobile Services and not Azure Mobile Apps? You generally cannot have a custom domain on Azure Mobile Services. Since you mention ZUMO Auth 2, I'm assuming you mean App Service Auth and thus Azure Mobile Apps.

我建议您查看不需要ZUMO的所有API的Azure函数.但是,您可以仅将自定义API添加到服务中.我在我的书中介绍了所有选项- http://aka.ms/zumobook -第4章.

I'd recommend taking a look at Azure Functions for any APIs that do not require ZUMO. However, you can just add a custom API to your service. I cover all the options for you in my book - http://aka.ms/zumobook - chapter 4.

关于检查心跳的服务控制器.如果要确保服务处于活动状态,则只需创建未经身份验证的自定义API即可测试数据库连接性(也许执行SQL命令来获取主表中的行数)并返回成功或失败.然后,您可以使用Azure Functions,Azure Scheduler或OMS对该自定义API进行查询.

As to a service controller for checking heartbeat. If the intent is to ensure that the service is alive, then just create an unauthenticated custom API that tests the database connectivity (maybe does an SQL command to get the count of rows in your main table) and returns success or failure. You can then use Azure Functions, Azure Scheduler or OMS to do a query of that custom API.

这篇关于与Azure移动服务一起添加asp.net MVC页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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