Admin Website for CRUD operations on Azure Mobile Services - asp.net

I'm attempting to build a simple app and would like to take advantage of Azure Mobile Services for authentication and storage of user info and settings...
however I also have some application data that I need to store, which I figure I should also put into the mobile services tables.
However, there doesn't appear to be any administrative interface for managing the data in Azure Mobile Services, such as CRUD to fill the tables and manage the read-only data that the users would be accessing.
So my options are either to put this data in a separate website/database, create a separate website and use azure mobile services within to manage the data as an admin, or just put everything into my own asp.net website and use web api (or something similar) to serve the data to the apps.
obviously the last option offers the most flexibility, but my ideal option is to be able to simply manage the data as an admin with another website.
the data i need to manage is not something the users will be editing or adding to through the app, but rather data that I need to have already in the app for the users to access...
what do you think is my best option based on these requirements?

You have a few different options for pure data management. First I'd say though that whatever option you choose, I would recommend keeping the data in the same database or make it otherwise accessible to your Mobile Service. If you're comfortable with doing it in SQL, you can connect to the database your Mobile Service is using with SQL Management Studio (this is the windows utility for SQL DB administration) or there is the SQL Portal which is a Silverlight tool which offers a lot of the functionality of SQL Management Studio. Moving on from pre-built tools, you can build your own app / website which interacts with the database directly (or through Mobile Services as an Admin). This would be the most work but offers you the ability to customize anything you might need. Lastly, you can just use a REST Client to handle dealing with any admin data. Since everything is exposed in Mobile Services via a REST API, you can use a REST Client (like Postman) to directly post data to your Mobile Service (using the Master Key to come across as an admin if needed). This is arguably the easiest way to do it without a SQL tool though it's more drudge work since you need to enter the JSON text for any data you want to send up.

Related

Modular Application Design

We currently have an application that is usable by several clients, it is used to download and store data from our application that they have on their environment.
We have a need to pass this application over to a developer but at the same time, we need to protect our code. The way that I see it working is that we would like to some how consider our current app a framework, allowing another app to be created on top of it, but the app may have its own screens, but re-use some of the built-in screens.
Is it possible to protect our app in such a way with out rewriting everything into protected DLL's? Or should we just suck it up and share our code with consulting firms that want to build these types of apps for our clients?
If your proprietary code is entirely focused on downloading and storing data. You could create an online REST api that returns the data over the internet. The other developer could then just request the data from your servers using an HTTP call.
However if your code needs to be client-side, the only real thing you can do is compile a DLL, and even then that can be decompiled.

Populate Azure Mobile Apps backend data

Hi and thanks in advance.
I'm experimenting with a Xamarin.Forms app to handle various events organized by my company (one a month), and I'm taking a cue from the great app made by Xamarin ​​for Evolve16.
But I don't understand how I can populate the database created in Azure backend with code first. I know there is a Seed method to eventually do this the first time but next? Every month I need to add new data (for example new sessions) quickly, and I do not want to provide this functionality within the app because the app should only provide contents to users. All domain obejects inherit from EntityData so I don't know if I can use LINQPad or SSMS to insert data directly because there are fields populated automatically (Version, CreatedAt, UpdatedAt...). Can I use rest api of backend table controllers? But where is the "try out" possibility that there was in Azure Mobile Service??
There are several ways to answer this. Basically, you want to alter the underlying tables in the SQL database
1) aka "the simple version" - download the SQL Server Management Studio and do raw inserts into the table
2) aka "the separate website" - write an ASP.NET web app that uses Entity Framework to do the inserts for you. Make sure you include the Azure Mobile Apps Server SDK and make your models inherit from EntityData.
3) aka "the combined website" - download the Node project that underlies the service and adjust it to add your own website that can do the inserts for you.
The "try out" option is now implemented with swagger. Just go to https://yoursite.azurewebsites.net/swagger

What would be the best approach to store data offline when working with web application in asp.net

I am writing a web application that will mostly be used on a mobile devices in asp.net C#. I was wondering what would be the best way to store data offline. This theory is what I have on mind:
When the user first access the website I want my code to export the entire schema and the data from the MSSQL database dynamically to JSON file (if it's possible) then the next step is to take that generated JSON file and create a local SQLite database with all the data from JSON. So later my application can read from it while the user is not online
please let me know what do you think or if this is not going to work because of something I am missing.
Thank you,
You have a few options, but it all depends on what your mobile app is like, what kind of data you are transferring (structured or unstructured), whether or not the ASP.NET site needs to serve web clients, etc.
Consider writing a mobile app using Cordova/PhoneGap. There are native plugins for various device platforms where you can store the data locally.
BreezeJS (http://www.breezejs.com/) is a native JavaScript framework for data access, including sync.
If you are creating a native iOS app, consider RestKit.
If you decide you want to create a native cross-platform app, you could use a technology such as Xamarin and use Azure Mobile Services to do data sync. You would have to convert your app to be a WebAPI however, which might not be feasible. (Disclosure: I work on this project)
Amazon has a sync service called Cognito.

Can Microsoft's Sync Framework work with .Net Membership/Roles, even through a web API?

We've got a .Net MVC/EF web application that is already in place with a client. The app was developed using .Net Membership and Roles for security/login. The app runs on tablet devices placed in the client's locations.
Now the client wants a different company to build a new UI for a portion of the site (not the whole thing), that has to integrate with our DB. This other company has been doing this type of work for a long time, so they've established how they operate, which is using a disconnected, distributed methodology to avoid Internet problems messing up an always-connected setup. Basically, they want each device to pull down only the segment of the DB that is relevant to the device's location and then sync it every two minutes through an API. The device will need to allow user logins.
So basically, we are being asked to adapt our web app/DB structure to accommodate this. And it boils down to 2 questions:
1) Since we are using .Net Membership and Roles, can we use the MS Sync Framework for syncing the DB of users (or at least, the ones relevant to the device's location)? I'm guessing the answer is yes because as long as the other party's UI is coded to utilize .Net Membership as well, the DB should be in the right format to read the data. I just want to confirm this is the case.
2) Can all the synchronization requests (up and down) be run through a web API that we write and expose to the devices? Since the UI is not going to be part of the code base, it needs to connect that way.
Thanks in advance!
1.Yes. from Sync Fx perspective, they're just tables.
2.Sync Fx out of the box doesnt work over http. You will in the documentation how to n-tier setup using WCF though. If you want Web API, you will have to code it as well.

How do I use custom member properties for people on my .NET website

I am trying to make an asp.net website using Visual web dev and C# that accesses data in an SQL database. For my site, I need to be able to save and access additional user properties such as age and gender. I have been playing around with the built in .NET Login tools but I don't understand how to keep track of the additional properties (age, gender...) I could store all the users information in my own database but how do I correlate the users data in my DB to the usernames in the member database that is automatically created?
Probably profiles are perfect and quite easy to use for your purpose. ASP.NET manages the relation between users and their associated profile data (which you can customize for your needs) quite comfortable. Here is short introduction video:
http://www.asp.net/learn/videos/video-44.aspx
Are you using an ASP.NET website project or web application project? The video (and most information in MSDN) is related to website projects. For web applications there are some complications to take into account when you use profiles.
(Some hints if you are using a web application project:
How to assign Profile values?
If you are using an website project you can ignore this)
As Slauma said ASP.Net Profiles is a great way to do this using the Membership API.
But I don't like the way profiles use delimited list serialized in the database, and I've heard reports of speed issues under heavy load.
I Use Membership API on just about all applications, except for the profile bit.
To store user profiles, you can create a separate table. Maybe called 'UserProfile'. Add a column with a unique index for 'username' and/or 'email'. Which ever you treat as the user's username. Now you can use that column to pull profile information at runtime.
As a bonus, if you use an ORM like Entity framework, you can now write simple LINQ queries to pull your user information.

Resources