Android connect to the database of azure with mobile service - azure

you can see the tables in a database Azure from a mobile Service azure? , the idea is accessed from android to tables in the database azure

Azure mobile services works (in the .NET version) with a TableController. This is a standard MVC controller, but it uses a base class to remove the need to do boilerplate code when you're only interested in doing simple CRUD on a client, and the server doesn't have large amounts of logic to do.
Basically you'll define your table through Entity Framework, either code or DB first, and then the controller can take it from there.

Related

How to migrate data after upgrading from Azure mobile service to app service?

Scenario: I have a migrated Azure mobile service, with data tables, that I would like to upgrade to an Azure app service. I have followed this upgrade documentation. I have copied the connection string and the application name as described in the documentation.
Expectations: What I would like to see are the same data tables from my mobile service in my new app service's Easy Tables. I would also like these to map to the same tables in the same database.
Problem: The problem is however that I don't see the data tables from my mobile service in my new app service (in Easy Tables).
More info: I have also tried to recreate the tables in the new app service. But if I create a new table in easy tables it creates a new table in the database, probably because the created table name does not match the schema from my mobile service? My mobile service uses the following schema: [database name].[mobileservice name].[table name]. The app service uses this schema: [database name].[table name].
So my question is: does anybody know how to migrate the data tables from a migrated mobile service to an app service?
Expectations: What I would like to see are the same data tables from my mobile service in my new app service's Easy Tables. I would also like these to map to the same tables in the same database.
AFAIK, when using Easy Tables, you could add your new table or existing table with the same name, then it would help you to build the node.js backend for your added tables automatically.
Note:
Table names can contain only letters, numbers, and underscores. The name must begin with a letter or a underscore character.
You could leverage "DEVELOPMENT TOOLS > App Service Editor (Preview)" of your mobile app service for checking your backend as follows:
So my question is: does anybody know how to migrate the data tables from a migrated mobile service to an app service?
According to the upgrade documentation you provided, I assumed that you are developing the C# backend, you just need to refer to Updating the server project, then deploy your modified project to your new app service.
Moreover, I would recommend that you could navigate to "DEPLOYMENT > Quickstart" of your app service, then download the C# backend project to be familiar with the new server project before you updating your mobile services backend project. Additionally, I would prefer creating a new mobile app project, then create the table controllers and migrate the logical code from your mobile service project. For more details about creating table controllers, you could refer to adrian hall's book Implementing Table Controllers.

Database in a Xamarin mobile client which uses the Azure Mobile App service

I'm building a Xamarin mobile app, which offline-syncs using Azure Mobile App service.
A. Xamarin (mobile client):
Xamarin's docs show how to build an app and a local database (using the sqlite-net ORM). Models are annotated with various attributes.
B. Azure Mobile App service (server):
Azure's docs show how to define models in the mobile app (without sqlite-net), and define similar models on the server app (using a customised Entity Framework). The client models use different attributes, and the server models don't use any attributes and derive from EntityData.
But then the client has two databases - the "real" one (A), and the one from the Azure APIs (B).
Am I supposed to only implement (B)?
Which means, (A) is only if I want a local database, and I don't need the sqlite-net ORM at all?
If you're using Offline Data Sync in Azure Mobile Apps, then you shouldn't do A, since the local database is already created for you as part of the offline sync feature. You do B as part of the C# ASP.NET server programming model, or you can use Easy Tables with a Node.js backend.
If you don't want a cloud connected app at all and the data to be stored only locally (i.e., no offline sync with a service), then do A only.
Alternatively, if you want the ORM provided by sqlite-net (rather than just basic querying and CRUD in the Azure Mobile client SDK), you can define a custom local store based on sqlite-net. To do this, create an implementation of IMobileServiceLocalStore. The Mobile Apps client SDK is open source, so you can use MobileServiceSQLiteStore as a starting point.

How to configure Azure Mobile Service to populate custom dashboard

I have been doing quite a bit of research into Azure's various offerings and what they can do, however, it is quite hard to figure out how they might fit together. I have set up a Mobile Service to act as my mobile app's back-end, managing push notifications and data storage etc. This populates a SQL database I have provisioned, all good so far. However, I would now like to display this data in a dashboard type web app. Do I create a private API and host it on another Azure App Service and call it from a separate web app which populates a dashboard, or populate the dashboard directly by querying the SQL database? Not sure of the security implications of either set up, or implementation issues?
Azure App Service can combine both mobile and web components. You didn't mention the preferred language, but ASP.NET (MVC5) and Node.js are supported for the mobile component.
If you have not started using the Mobile Service in production, add the Mobile Apps SDK to your website, update the client SDK to point to the Mobile Apps SDK and just have one site.
Refs for the Server SDKs:
* node
* ASP.NET
Your best bet here is probably to create an empty Web App Service (Website) and have the Mobile Service populate the data on this website, in order to visualize it.
So keep the Mobile Service you have now, and connect it to a new website.

Windows Azure and MVC5 - How to use same database schema for desktop and mobile versions?

I have developed an MVC5 web application which uses Code First Migrations to build out the database. Now I am attempting to develop a mobile app (using PhoneGap if that matters) that exists as a native option to access the data of the application. However, I am having trouble finding a way for the databases to work nicely together.
Ideally, I'd like to use the same database schema entirely, and just have the application and the mobile app point to it. The database is hosted on Windows Azure. The issue I'm having is that with Azure, the standard way of handling databases with mobile apps is to use an Azure Mobile Service. However, when that service creates a database, it creates its own schema named after the service, whereas the web application uses the dbo schema. So the Users table might exist in dbo.Users for the web app, but in myAppName.Users for the Mobile Service.
I've already explored this solution, which seems to mirror my problem. However, there is an additional issue. The .NET MVC5 Authentication services use dbo as the default schema and there seems to be no way to change that.
Bottom line, if I use the default schema, the mobile app cannot access the database, but if I move the tables to the Mobile Services schema, the Login/Authentication fails because the tables don't exist in the default schema anymore.
Am I missing something here? It seems like it should be a fairly common task to have a web app and mobile app accessing the same database, but I've been investigating this for days without finding a solution.
Thanks for any help you can provide.
The standard way of using a database for mobile apps in Azure is not Azure Mobile Services. I mean, I would not call it standard but just one of the options.
When Azure Mobile Services creates a database it does not create the database with its own schema. Azure Mobile Services does not have a predefined schema. You can define your own schema. The only predefined logic is the addition of the azure mobile services tenant name as a prefix to all table names. This is done to help you host multiple azure mobile service accounts in a single database. You can override this logic if you write the app in .NET. I'm not sure if that's possible if you roll a JavaScript based Azure Mobile Services account.
My suggestion to you would be to roll your own ASP.NET Web API project and host it in Azure. You can host in Azure Web Sites or Cloud Services according to your requirements. Once you have your own APIs running in Azure you should have no problem accessing the APIs from a web site or mobile app.
Hope this helps.

How does Windows Azure Mobile Services differ from Azure Cloud Services?

I need to connect to a middle tier (think Azure) between both my Windows store app and WP8 app. Windows Azure Mobile Services has been proffered as a/the solution.
But am I reading too much into the name "...MOBILES Services" (as one of the pieces is not a mobile app, but runs on desktops, laptops AND tablets)?
In my case, am I better off with Azure Cloud Services as opposed to Windows Azure Mobile Services?
Windows Azure Mobile Services is a fast, easy way to get a back-end in the cloud for your mobile apps and Windows 8 apps (it's fine if your Windows 8 apps aren't necessarily targeting mobile devices). It includes the things most commonly needed in a back-end, such as authentication, database storage, and push notifications. There's no server-side development needed here, you just request the back-end and moments later it's ready to use; however, if you do want server-side logic you can add it in the form of JavaScript scripts.
Alternatively, you could build your own back end in the cloud using a combination of Windows Azure Cloud Services such as the Compute, Storage, and SQL Database services. You have access to more features at this level, but you also are doing your own development. You can write server-side logic in C#, VB.NET, PHP, Java, Python, etc. as you prefer.
Which should you use?
If Windows Azure Mobile Services meets your needs, and you'd rather focus on your mobile app than learning anything cloud-specific, that's likely the best path for you.
If you're conversant with the Windows Azure platform, and need features different from what WAMS provides, that suggests creating your own back end with Cloud Services.
If you're not sure which way to go, I suggest experimenting first with WAMS since it is quick and painless to get started.
Azure mobile services is designed to get you up and going with storing data, push notifications and authentication whichever of those components you might need.
It abstracts the need of creating a data access layer and a web/wcf service to access it from your applications; it's simply there to boilerplate as much functionality off the bat.
This however does not mean that it is only for mobile applications, behind it all is a normal SQL Azure database and an API that you can use from any .NET based application.
I would reason that if you need more than basic CRUD operations and won't be using authentication and push notifications, I would roll my own set of APIs and DAL and use cloud services instead.
If you need a flexible schema, boilerplate data access and want to use some of the other mobile services, it would suit you quite well.
Here is a link to getting going with mobile services from a non Windows8 or WP - ASP application : link

Resources