Web Application with Storage using Azure - c#

I am working on using Azure to maintain a web application that will allow me to store information into a storage system through a web interface. I would then like to query the information from that storage system using a client application. I noticed that there are a variety of technologies that can be used to accomplish this, such as node.js, C#, php and python. I am confused about how to proceed. I tried to create a website on Azure using Microsoft WebMatrix which uses Nodejs, and I was able to create a simple express site. But, I could not see any options for a storage element to interface with node.js. I am not looking to spend too much time on making a custom Web UI, but would rather like to use some sort of template for the UI. Which technologies would be best to proceed based on my requirements?
Thanks!

There is a node version of the Storage Client library available in the Azure SDK which you can find here. This library will enable you to interact with Storage resources such as Blobs, Tables and Queues which might be useful for your application. There are also some node getting started tutorials available here which sound like they might also be useful.
You should also track the Windows Azure Storage Blog as updates are coming for the node client library as well.
Jason

Related

Azure HTTP Function -- Encountering issues when creating trigger with OneDrive file input-binding

So I have a requirement to process a file when it is uploaded to a particular folder in OneDrive. An Azure Function would be nice to use for this purpose.
Here's what I see when trying to set this up in the Azure portal:
Is it even possible to do this in the portal either v3 or v2 of the Azure Functions runtime? I tried to follow the steps documented here but I find them a little less-explicit and difficult to interpret/follow.
If anyone has any better examples to follow, please be so kind to share. I'm confused as to what approach to take (e.g. portal, VS Code, VS)
Currently it is recommended that we use the classic function UI in azure portal as there are some issues in the new UI.
And I found that Microsoft Graph bindings are currently in preview for Azure Functions version 2.x and higher. For preview version, we don't recommend that you use them in your production apps.
The workaround is that you use Azure Logic Apps instead.
Reference:
Access and manage files in OneDrive connector by using Azure Logic Apps

Where do I store media in an Azure Web App with C# ASP.NET

I am creating a C# ASP.NET app (using Visual Studio), which I'm hosting on Microsoft Azure. Currently, I have a folder in the solution named "Content", in which I store some media. For example, there a logo that is placed on the website.
The purpose of the web app is to generate a document that a user can download after entering some data. To generate this document, I also need to use some media (mainly images). There can be quite a lot of such images!
Where should I store these images? I currently have them in this "Content" folder as well (in seperate sub folders for each user), but I noticed on Azure there is also a tab called "Storage". I have tried to use this service for a bit, but I don't really understand its purpose. Would it be advisable to use this for storing the media, and then retrieving them with the web app when necessary, or should I leave them on the web app server? What is considered Good Practice?
Thanks in advance for any help
As a starting point, using Blob storage (see Azure Storage Documentation) would be significantly better than file storage on a single webserver - its cheaper and more scalable (pricing tiers for Application server storage will be expensive, you'd have have to duplicate files or have a multi-server directory in a load-balanced environment). The basic design is the application will use an SDK to retrieve the bits and then stream it back to the web browser or other client.
If you anticipate many users downloading the same file, and network performance matters, consider using a Content Delivery Network
You should store it in an Azure Storage Account and reference it using the SDK, after generating the document, you can use Shared Access Signature to give the user access and you can limit the access to read or write for a specific time.
If you will generate videos then you can serve it through Azure Media Services

Should I use Azure Mobile Services or stick with Web Api

I am developing a prototype app/website as a 'spike' for a project feasibility study. We need both a website and an app.
I have come from a web forms/c# background with fair amount of sql experience.. and have been up a steep learning curve to get to grips with MVC, Entity framework etc.
I have developed an MVC app first which has OAuth and uses Asp.Identity (and roles - just couldn't stay away im afraid:).
This uses an Azure Website and Webjobs to handle other tasks.. I really like the idea of not having to manage the whole server.
Following what seems the logical step for a mobile app, I have also added Web Api to it.. and have done some successful checks that it is there and working using fiddler etc.
I now need to 'Spike' the mobile element of this and quite favour the Cordova approach since there are no real performance requirements and it looks like AngularJS etc can yield good gains. So I have added the Cordova tools to my dev environment and done a couple of the tutorials and successfully have an app on my android phone.. so far so good.
So looking at Azure Mobile services, this seems to offer some nice facilities for our app.. however, and I realise it is still new, but it does seem geared to wards a Node-JS 'server side' application if using Cordova.. is this fixed or am I OK using C#?
But also I feel I may have circumvented the need for the Mobile services part by adding WebApi..
On the surface it looks like the mobile services is a great 'cloud as service' model for simple app only requirements. Or am I wrong .. and should I be using it IN ADDITION to my website..
The APP and Website are going to use the same database, authentication etc. Which brings me on to the database.. This is not really an 'existing database' (which is where all the tutorials for Mobile Services seem to head).. I can start again if needed.. but of course it is built with code first EF models.
Should I divert energies to using mobile services or, as I am suspecting, carry on developing my own RESTful apis added on to my website.?
I guess I am looking for some best practice guidance here.
the .NET backend for Mobile Services is actually WebAPI based and is actually geared towards dev's who want to take advantage of their existing .NET/WebAPI skills in writing the backend services as compared to the Portal-based JS backend (you can also write more complex code the JS backend).
A key thing to note about Mobile Services is that it's a collection services, not just a backend to your data store.
You have authentication, push notifications, offline support, hybrid connect, etc... on the backend and corresponding client libraries for most mobile platforms (note, since it's REST based, there's not stopping you from consuming the same services from non-mobile platforms such as WPF, ASP.NET MVC, etc..)
So the question is, how much of the other features do you actually need and how much effort is it for you to write them yourself vs simply consuming/configuring them in Mobile Services.
I will answer your overly complex question with a overly simple answer: Mobile Services were designed for mobile devs with no or little experience developing a backend to use a backend with services for their mobile apps. If you're an experienced backend developer, you can do the same from scratch.

Create a virtual machine in windows azure programmatically with C# code or .net

As we know that a new feature called virtual machine has been added in windows azure portal. but i want to create a virtual machine in windows azure programmatically with C# or . net. so can any one please help in this... which API shoud i use or yet the API for .net need to be published by azure people? please any one guide me to do this task.
You'll likely want to use Azure's REST Service Management APIs. For example, APIs for creating and managing VMs are here: Create Virtual Machine Deployment.
The overall API is documented here.
Since you're in .NET it seems like there would be service management APIs in the managed SDK, but I didn't see any service management API references there.
I just want to add something after the above answers, certainly you can create the Virtual Machines using Power Shell or C# and here is an example I found it might be interesting using the .Net API
http://code.msdn.microsoft.com/windowsazure/How-to-program-control-838bd90b
Currently there is only a REST API for creating Virtual Machines
This post shows an example of how to call the REST API in C# for creating a VM.
Remember that a Virtual Machine and a VMRole are different.
Apologies for not having seen this question earlier. The Microsoft Azure Management Libraries (MAML, for short) can provide this sort of .NET-based access to the Microsoft Azure management APIs. MAML is available as a series of NuGet packages, which were released officially just this week.
To accompany the release I've put out a blog post linking to a VS Extension I wrote for the //build/ conference. This extension provides a walk-thru via VS Project & Item templates, along with some code snippets, that do exactly what you're after - create a VM in Microsoft Azure from a Console Application.
I've written a few other posts on MAML that offer other pieces of guidance and information. Hope this helps!

Are there any Unforseen Difficulties with Offloading Image Storage to Amazon CloudFront using C#?

I'm contemplating the use of Amazon's CloudFront service to offload my web applications image/file storage from my web host.
Users of my app can upload images, the image is named and the path is stored in a database. I'm thinking of just having the app upload the image to CloudFront and then change the path to use the CloudFront service. Shouldn't be too hard...
I've read of other developers using CloudFront for static images and haven't seen too much about using it for the primary storage of images that can be uploaded/deleted at any time.
My app is ASP.NET MVC based, using C#. Has anyone used C# to setup an upload to CloudFront, from the user's uploaded file?
Anyone recommend against this? The pricing looks affordable and the speed looks fantastic. The only thing that comes to mind would be in developing it, are there any technical difficulties in developing this that I'm unaware of?
Should just be a simple file upload as long as my web app has write permissions, am I correct?
Thanks in advance!
As with all newer technologies, do expect a tat of technical difficulty somewhere along the road but from what I read, it seems relatively safe. For sake of disclosure, and balance, I should mention a 7 month study by the University of New South Wales in Australia found some notable inconsistencies in the bandwidth/responsiveness within individual cloud hosting providers.
Another concern is the possible hikes in pricing of "cloud" services. Providers are, at the moment, all in the process of getting market share; will they eventually try more realistic prices...
Another remark, however, is that it seems that your are keeping a traditionally hosted application and merely putting the file server in the cloud. This strikes me a bit as odd, since file serving is a cheap, easily scalable resource in the single-server type configuration (except of course if you plan on a home run and have your application see traffic like that of Google ;-) ). Could it be that the traditional hosting provider has hiked his per-Megabyte rate ?

Categories