The Song Translator app uses cloud storage for all of its files. Implementing cloud storage is straightforward process. It basically works as follows:
Users will need the Windows Azure Mobile Services Nuget Package.
In the storage account, create containers to house all of the objects being stored. For this example, our interns created several: SongItem (lyrics and music files), SongRecordings, SongTranslation, and SongKaraoke. In addition, they created classes for each of these objects in the program, giving them attributes such as title, artist, language, genre, and of course, SAS query strings as well as tables for each of these objects in the mobile service.
Once objects are stored, create some new tables. Name them the same name as the objects being stored. For each table, create insert (and update) scripts. These will create Shared Access Signature (SAS) query strings that will give the credentials to upload files. The SAS lasts for 5 minutes and is returned to the app by the mobile service. The app can then use the SAS to upload the files to the containers specified. In addition, the insert script creates an entry in the tables with the file’s associated information.
What the script does is provide access to blob storage for 5 minutes, allowing us to write to the storage containers. The script creates a SAS query string for each file, and the SAS provides access to storage. Essentially, the script fulfills the mobile service’s function of connecting the app to the storage account.