Microsoft Azure 托管数据库和防火墙

microsoft azure hosted database and firewalls

我正在 Xcode 上进行移动开发并使用 Microsoft Azure 的托管数据库。

我注意到 Microsoft Azure 上有防火墙设置,以便添加客户端。

部署移动应用程序后,这将如何工作?是否应该在数据库上打开所有端口?还是我需要使用网络服务?

How will this work when the mobile app is deployed? Should all ports be opened on the database? Or do I need to use Web Services?

绝对不要打开所有端口,强烈建议不要从移动应用程序直接连接到数据库。

推荐的方法是使用位于您的移动应用程序和数据库之间的某种服务层。来自应用程序的所有请求都应该转到将执行数据库操作的服务层。该服务层可以部署为 Azure Mobile App Service, Azure API App Service or a Web API hosted in Azure Web Apps Service.