Saving images in Azure storage - file

I am building a web application , where users can upload images & videos and store them in their account. I want to store these files somewhere and save only the URL in the DB.
What is the right way to do it using Azure services? Is there a dedicated server for this, or some VM?

Yes, there is a dedicated service for this purpose. It is the Azure Blob Storage. And you are highly advised to save all and any user uploaded content to that service instead to the local file system.
The provided link has samples for almost any language that has client SDK provided by microsoft.
If, at the end you use some platform or language that is not directly supported by an SDK, you can always refer to the Blob Storage REST API documentation.
You will need to go through the blob service concepts to get deeper understanding of the service and how to use it.

Related

Where to put SQLite database file in Azure App Service?

Q1: Where do you think is the right place to put a SQLite database file (database.sqlite) in Azure Web App file system? For example:
D:\home\data\database.sqlite
D:\home\site\database.sqlite
D:\home\site\wwwroot\database.sqlite
other?
Q2: What else should be taken into consideration in order to make sure that the database file won't be accessible to public users as well as not being accidentally overwritten during deployments or when the app is scaled up/down? (The Web App is configured for deployments from a Local Git Repository)
Q3: Where to learn more about the file system used in Azure App Service, the official source URL? E.g. how it's shared between multiple VMs within a single Web App, how does it work when the App is scaled up/down, what's the difference between D:\home (persistent) vs D:\local (non-persistent)...
Note that SQLite does not work in Azure Blob Storage, so that one is not an option. Please, don't suggest alternative storage solutions, this question is specifically about SQLite.
References
Appropriate Uses For SQLite
In a Web App, your app is deployed to d:\home\site\wwwroot. This is the area where you may write files. As an example, the ghost deployment writes its SQLite database to d:\home\site\wwwroot\content\data\ghost.db. (easy to see this, if you open up the kudu console via yourapp.scm.azurewebsites.net):
This file area is shared amongst your web app instances. Similar to an SMB file share, but specific to web apps (and different than Azure's File Service).
The content under wwwroot is durable, unless you delete your app service. Scaling up/down impacts the amount of space available. (I have no idea what happens if you scale down and the smaller size has less disk space than what you're consuming already).
I would say the best location would be app_data folder in the site/wwwroot folder. Create the folder if it doesn't exist.
Web Apps can connect to storage accounts so you can in fact use blob storage and connect that to your web app. So in terms of learning more about it then you need to be looking at the appropriate page of documentation.
In your Web App settings you can then select which storage account to use. You can find this under Settings > Data Connections where you can select Storage from the drop down box.

AngularJS and Ruby on Rails - Uploading multiple files directly to Amazon S3

I'm writing an app where users can write Notes, and each note can have many files attached to it.
I would like users to be able to click 'Browse', select multiple files, which will be uploaded when the user clicks 'Save Note'.
I want these files to be uploaded directly into Amazon S3 (or some other cloud storage solution?) without going through my server, so I don't have to worry about uploads blocking my server.
What is the best way to accomplish this?
I have seen many examples to upload directly into Amazon S3, but none of them support multiple files. Will I somehow have to do this all in Javascript by looping through a collection of files selected with the Browse button?
Thanks!
Technically, your javascript residing in the browser could make HTTP RESTful calls to AWS and store data in S3, but then you would be exposing the security credentials to connect to AWS in the script.. not good.
I guess the only way is to process it thru a web-server which can securely access AWS and store the notes.. or, you could just write those notes to a local disk (where the webserver sits), and schedule tools like s3cmd to automatically synch them with S3 buckets.

A hosted JSON database that i can Set and Get objects

Hey I'm making a small project and I would like to use a JSON style database service where I can set and get parts of the JS object. I would like this to be completely on the front end and not require any server technologies. It dosent need to be secure as its just a hobby project. Security is a bonus.
I'm currently using HTML5 local storage.
I'm happy to pay for this as a service.
Update 2020: A lot has changed on the internet since this question was asked. I would recommend:
Google Cloud Firebase (https://firebase.google.com/)
It has an authentication mechanism built in
It has user management
https://www.firebase.com/ does not have free plan.
Direction to go seems to select NoSQL db like MongoDB or CouchDB, and then search/compare for db as service providers.
Quick search gives 10 Online Storage APIs
That is file oriented APIs
Adobe Share: Recently released online document sharing service from Adobe with a REST-based API that integrates with Flash, AIR and non-Adobe applications.
Amazon S3, Simple Storage Service: Probably the best known storage API and a key element of Amazon’s pay-as-you-go infrastructure services.
Box.net: The “Box Enabled” platform offers a choice of SOAP, REST or XML-POST APIs. Below is Fireloader, a Firefox extension which allows you to upload, and download photos, files and videos using a familiar FTP like interface. In this version Flickr, Picasa, Box.net and Youtube are supported.
Cellblock: This multimedia sharing service offers a REST-based API.
MoveDigital: File delivery and management services geared towards large files.
Nirvanix: A newer entrant into this space, focused scalable, secure storage through their Storage Delivery Service (SDS). See their feature comparison vs. S3.
Omnidrive: A well regarded REST-based API which has been used for a variety of interesting commercial integrations including direct access from Zoho.
Open XDrive: AOL offers this storage serviced using a JSON-RPC protocol.
Openomy: Experimental online storage service started in 2005 (although a quick check of this service over this past week indicated leaves some question about its current operating status).
ref https://webapps.stackexchange.com/questions/8247/seeking-online-hosted-database-web-service-with-rest-api
amidb provides hosted json service backed by elasticsearch and cassandra.
Try it out. It is free to host files and json. you only pay when you go into production.
disclaimer: I'm involved as an engineer with http://amidb.com
Here are a few options:
myjson
jsonbin
They all currently have a free option.
You may also want to check out www.ttmsolutions.com/restjee. Its a lightweight server-side JSON ORM that doesn't require you to develop any server-side code and works with any DB.
You could try https://jsonware.com You'll get a fixed URL with your JSON.
It can even generate random data. No installation is needed.

iPhone App Built on Amazon Web Services

I am building an iPhone app that stores user logon credentials in an AWS DynamoDB. In another DynamoDB I am storing locations of files (stored in S3) for that user. What I don't understand is how to make this secure. If I use a Token Vending Machine that gives that application an ID with access to the user DynamoDB, isn't it possible that any user could access the entire DB and just add or delete any information that they desire? They would also be able to access the entire S3 bucket using this setup. Any recommendations on how I could set this up securely and properly?
I am new to user DB management, and any links to helpful resources would be much appreciated.
Regarding S3 and permissions, you may find the answer on the following question useful:
Temporary Credentials Using AWS IAM
IAM permissions are more finegrained than you think. You can allow/disallow specific API calls, so for example you might only allow read operations. You can also allow access to a specific resource only. On S3 this means that you can limit access to a specific file or folder , but dynamodb policies can only be set at the table level.
Personally I wouldn't allow users direct access to dynamodb - I'd have a webservice mediating access to that, although users being able to upload directly to s3 or download straight from s3 is a good thing (Your web service can in general give out pre signed urls for that though)

microsoft azure and silverlight

I am interested in developing a site similar to youtube. I want to have a site that users upload videos.
I imagine technically the website would upload the video to the azure cloud. Where the file will automatically be encoded to silverlight and hosted.
Can azure host my site, take care of encoding and host the videos all programmatically?
And can azure host the rest of the website pages that are not part of the app like a (homepage or about us page) and have a domain name or do i need a web host?
thanks
Azure can do the lot.
You'll probably want to use Azure Blob Storage for the initial upload, then use queues and the worker role functionality to do the encoding and other processing. Then you can store the resulting file back in Blob storage, and have an index either in Azure Tables or SQL Azure, depending on the architecture of the rest of the application.
And yes, an Azure Web role can quite happily host static content, standard dynamic ASPX pages, and a whole lot more (and can do it all on your own domain).
I suggest you grab the Windows Azure SDK (from http://www.microsoft.com/windowsazure/) and take a look through the documentation. Your example scenario is pretty simple actually, and working through the samples should give you all the information you need.
Good luck!
Azure can host your site indeed. However don't forget that the costs will probably be a minimum ~ $80-90 per month even without any load. If your website gets traffic this amount will increase
However you will have to implement video encoding yourself (or better yet find libraries to do it), Azure is purely a host.

Resources