Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Storage

Erika Ehrli edited this page Aug 1, 2016 · 2 revisions

Store your app data in the cloud with Azure Storage

Overview

Azure Storage is massively scalable, and accessible from anywhere and from any device – whether your users are online or off. Whether its images, photos, documents, or customer records – in the cloud or on premises – Azure makes it simple to create or integrate the right kind of storage for the task.

Azure Storage offers a set of storage services for all your business needs. Choose from Blob storage (object storage) for unstructured data, File storage for SMB-based cloud file shares, Table storage for NoSQL data, Queue storage to reliably store messages, and Premium Storage for high-performance, low-latency block storage for I/O-intensive workloads running in Azure Virtual Machines.

The Shopping Demo App relies in SQL Server for storing items (title, description, price, etc.), and uses Blob storage to store item photos. Blob storage is then connected to Azure’s Mobile App, which enables the offline file sync scenario: items can be added offline and are automatically synced when the connection is back.

This tutorial will show you how to set up Azure Storage and support offline file sync in the Shopping Demo App.

Prerequisites

Sign up for Microsoft Azure

You need an Azure account to complete this tutorial. You can:

If you want to get started with Azure App Service before you sign up for an Azure account, go to Try App Service. There, you can immediately create a short-lived starter mobile app in App Service—no credit card required, and no commitments.

Set up the development environment

To start, set up your development environment by installing the latest version of the Azure SDK and Xamarin

If you do not have Visual Studio installed, use the link for Visual Studio 2015, and Visual Studio will be installed along with the SDK.

Create a storage account

Create a storage account by following the tutorial Create an Azure Storage Account.

In the Azure Portal, navigate to your newly created storage account and click the Keys icon. Copy the Primary Connection String.

Navigate to your mobile app backend. Under All Settings -> Application Settings -> Connection Strings, create a new key named MS_AzureStorageAccountConnectionString and use the value copied from your storage account. Use Custom as the key type.

You can use Azure Storage in your app backend now.

Add a storage controller to the server

Finally, you need to allow your backend to respond to client requests by adding a storage controller to your server.

The code related to the storage controller in Shopping Demo App can be found in SaleItemStorageController class.

Please take a look at the tutorial Add a storage controller to the server for more details.

Learn more

About Azure storage accounts

Connect to Azure Storage in your app

Azure Storage documentation

Download Storage Explorer

For more information, please visit http://azure.com/xamarin