I am investigating Azure (ie. beginner). Mobile Services by itself will not work for my mobile app needs (data access is too simplistic). My question is can you mix Mobile Services and Cloud Services such that they both access the same database/schema? In other words, write a mobile app that uses Mobile Services for the basic functionalities it provides (CRUD, authentication, etc), but then perhaps calls my custom REST API running on a Web Role server for more complex database operations. In order to do that, the Cloud Services instance would need to be able to read/write to the same database/schema. Is this possible, and if so, any tips on how to access the auto generated mobile database from the Cloud app? Thanks.
Asked
Active
Viewed 2,309 times
2 Answers
20
Absolutely, Mobile Services is very much designed with this in mind.
You can
- call Mobile Services from other services (in Azure, or anywhere else) thanks to the HTTP REST API: http://msdn.microsoft.com/en-us/library/windowsazure/jj710108.aspx
- call other services from Mobile Services using server scripts and the request module: http://www.thejoyofcode.com/Making_HTTP_requests_from_Scripts_in_Mobile_Services.aspx
- connect DIRECTLY to your Mobile Services SQL database from anywhere. This is just a SQL Azure database so you can use the connection string to connect from another service in Azure (or even beyond)
- add additional functionality to your SQL database (like stored procedures). It's just a SQL database!
- invoke T-SQL from Mobile Services scripts using the mssql global module.
Lots and lots of composition options, so the short answer is YES, definitely!

Josh Twist
- 251
- 1
- 3
-
Perfect. Thanks for the details. So for example I could create a Worker server in Cloud Services that runs some service application that performs scheduled work on the mobile database (I know Mobile Services has javascript scheduled jobs feature but I prefer to write my own Windows service to handle complex tasks). Thanks! – Joel Dec 25 '12 at 04:52
-
2Absolutely, that's fine. It's one big composition party and you're invited. – Josh Twist Dec 25 '12 at 16:35
1
The short answer, I believe is "Yes".
Furthermore, I believe the main issues are price/licensing, rather than technical:
I suspect your "database" would reside in MS Azure/Cloud, and "access" would be any combination of Mobile/direct access and/or custom web services, both to your Azure/Cloud instance.

paulsm4
- 114,292
- 17
- 138
- 190