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
Related
I would like to create and archive a collection of demo ASP.NET web form applications that show projects with certain features in the sense "this feature can be implemented like this" -- to be presented to a potential customer.
Before the presentation, I would like to get the selected set of demo and install them easily to the notebook. Each of the demos will be "frozen". The target notebook is not the customer's one. It is one of our ones that is bring to the customer for the presentation. This way, it can be prepared in the sense that a named MS SQL instance with the fixed name can be ready, etc.
Can you share some experience with such situation? (I do not want to have marked this question as of opinionated; so please, if you have some explicit links to the related documents or explicit suggestions...)
Here are some other facts and initial ideas:
Each of the demo projects uses two databases: xxx_users (the standard ASP.NET authentication...), and xxx_application (and possibly xxx_external) where xxx is a prefix for the specific project.
The demo application is expected to be compiled (binary only, no sources needed for the presentation).
The Web.config files can use the local\SQLINSTANCEFORDEMOS in connection strings.
The SQL instance has a fixed name, fixed administrator account (like sa) and fixed password for the logging to the SQL instance. This way, it can be included in the Web.config files.
The sample data can be fairly big (not extremely tiny).
The application will use its own SQL tables in the xxx_application database.
The application will simulate the outer database that is accessed from the web application can be simulated by xxx_external database.
This way, I should be able to create and archive SQL backups of xxx_users, xxx_application, and xxx_external databases, plus the archive of the web app binary.
Have you ever encountered this situation? Is the approach reasonable? Could you share some better ideas?
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.
I want my application to be in 2 phases. 1 part will simply fetch data in json format from an API and store it to a SQL database(or maybe a NO-SQL) and the other half(the web part) will read the data and implement customize alerts. So, basically i need to create a worker for the fetch process. But I'm confused between worker role and web role in Azure. Kindly help me what's the best possible way to implement this design?
You can just merge both in the same web role - the part of code running in IIS (the ASP.NET project created when you create a web role from a Visual Studio template) will handle web requests and the part running the "role entry point" will run the fetch process. Unless you absolutely need to scale them separately this will give you a simpler and more manageable solution.
Have you looked at this tutorial? It gives possible use cases and tutorials for both web and worker roles.
http://www.windowsazure.com/en-us/documentation/articles/cloud-services-dotnet-multi-tier-app-storage-1-overview/
I have used asp.net so far to create personal web applications, for example, an application where I maintain to-do tasks in an MS SQL Server database or a customer management and support system. I use the basic authentication via web.config where I can create another user who can look and work with such a database, but then all the data is shared between him and me.
But now I want to convert this application into a membership model where a user signs up and will get to use his own personal list of to-do tasks. I can think of the following approach. Please correct me if I'm wrong on some point or if I have missed something.
Steps:
Add a membership user table and use the primary key of this table to access other tables where I will need to add this column, the to-do list in this case.
Next, I will need to write the Login, Signup and User management logic to maintain the user table. Here, I was hoping to find some working samples but all searches give me only ASP.NET MVC membership samples. I don't want to use MVC because I am using third-party asp.net components. As far as I know I can not use MVC with those components. Any links to ready made samples similar to MVC but for asp.net?
I also want the users to be able to login with their google id, dropbox id, etc. Is this possible while having my own login/signup? How does user table change then? Is the Email Address the only data to link up all these things? For example, if someone logs in with google id, I authenticate using Google oauth 2 API but use the email address as the data to add or locate that user to give him his data tables. I'm confused on how this kind of user table looks where all kinds of logins are possible along with a custom one. Any ideas?
http://www.shiningstar.net/ASPNet_Articles/SqlMembershipProvider.aspx
This should help talk you through what you need to do.
I got the exact solution that combines membership with oauth and is built into ASP.NET 4.5. What is more, there is a video that demos it all!
http://www.asp.net/vnext/overview/aspnet/oauth-in-the-default-aspnet-45-templates
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.