I have some pre-existing Azure Mobile Services, these were written when they were using request.service.mssql.query() when running a custom sql statement. However since then Azure has updated their mobile services to instead use req.azureMobile.data.execute()
I need to create a new Azure Mobile Service that connects to another database. This new service uses very similar calls to the existing services I already have running.
Is there a way for me to create a new Azure Mobile Service that is using the old method? Because if I must use the new method I will have to re-write the calls which is a lot of work as there are lots of calls.
If I must use the new method, is there a fast way to convert the pre-existing calls to the new method?
Thanks
There is a compatibility NPM to allow your Mobile Service scripts to run in a Mobile App. It also requires a view of your database with different system column names for the createdAt, updatedAt and deleted columns. Or if you don't have an existing Mobile Service using the old column names, you can just rename the columns (remove the __ prefixes).
The Azure documentation has a more complete page on upgrading your Mobile Service using this NPM.
Related
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.
I was following the Microsoft Azure documentation to integrate my Xamarin Forms app with azure mobile services. I defined a data connection, used easy tables to define some custom tables and everything was working as expected with the mobile client.
Today I wanted to extend my backend functionality and also enable file storage. I followed the instructions found here and as soon as I created a new .NET server backend project with a StorageController and published it to azure, the entire easy table api stopped working. All calls from the mobile client fail with the following error:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
This happens for all mobileClient.GetTable<SomeEntity>().SomeOperationAsync() calls.
My guess is that publishing the custom backend overwrote the online generated easy tables api... unfortunately I don't have enough experience with the azure cloud to figure out where I made a mistake. Is there any way of getting the auto generated easy tables api to also work with file storage?
As Mimi noted in the comments, Easy Tables is only available for the supplied Node backend, deployed from the portal. If you are using your own code and publishing that, Easy Tables and Easy API will be disabled.
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.
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.
I am trying to create a simple table in Azure Mobile Services so that my c# Windows Phone App can utilize a high score table. However, though it appears in every example I find online, there is no "Data" tab inside my mobile service I created on Azure where I can create that table. They removed it or something, but there is no documentation whatsoever. Anyone know what's going on?
Thanks.
You probably chose to use a .NET backend (as opposed to JavaScript). When you do so, the DATA and API tabs are not visible in the portal. This is because both your data access and custom API's are part of your Visual Studio solution and have to be deployed from there. If you want to use the Javascript backend where you create your tables, APIs, and edit their scripts in the portal, you'll need to create a new Mobile Service and choose Javascript as the backend.
When you first create a mobile service, you won't have [any data in the] data tab. The easiest way to get started is to choose one of the sample app templates (iOS, Android, Windows Phone, Windows 8, HTML, Xamarin, PhoneGap). You should see an option then, to download the client app. There should also be an option to set up a default bit of data (the todoitem table). Once this is done, you should see the Data tab.
This isn't the only way to create data, but it's the simplest, especially when first starting out.