Part 1 of 5: Introduction to Consuming Azure Mobile Services from iOS
Introduction
- This series shows you how to use Windows Azure Mobile Services to leverage data in an iOS application.
- This means you can use these techniques for iPhone and iPads. And with minimal adjustments, they could be made to work with MacOS, Android, or any app capable of http.
- We will create a new mobile service, integrate the mobile service with an iOS app, and then use Microsoft SQL Server Management Studio to control the data the iOS application can consume.
- More importantly, Mobile Services enables you to accomplish these tasks within minutes.
- Mobile Services allows you add a cloud backend to your Windows 8 Store app in minutes. It is also very useful for iOS and Android developers to get started right away consuming JSON-formatted data through http.
- Direct Support for iPhone, Windows Phone & Android is coming soon but I will show you how you can use iOS today, or any other type of client.
- I want to show you the under the hood view of web is being abstracted away by the Microsoft tooling. Don't get me wrong, the abstractions are great, but it always helps to look under the hood.
- We will use a proxy sniffing tool (Fiddler) to truly understand what is happening under the hood.
- Windows Azure Mobile Services (WAMS) is a preview offering that offers a set of cloud services designed to jump start mobile application development.
- What I will not cover here today, is the features of Push Notifications and Authentication.
Previous Posts
This is the goal
- Notice that data is visible.
- This data comes from the Windows Azure Mobile Service.
- This is what we are going to build
- There is work to do at the Windows Azure Portal
- There is code to add to the iOS application that we build with Xcode
You will need a trial account for Windows Azure
- Please sign up for it here:
- It is a free 90-day trial
- https://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200114759
Assumption: You've signed up for a free trial account for Windows Azure
- The assumption is that you've signed up for a free trial account.
- Download the free trial
- You will need a trial account for Windows Azure
- Please sign up for it here:
- You will need a trial account for Windows Azure
- Once you've signed up, getting to Windows Azure Mobile Services (WAMS) could be more clear.
- I start by clicking on BILLING.
Accessing Preview Features
- Since Azure Mobile Services is in preview mode currently, click on PREVIEW FEATURES.
Drilling into Mobile Services
- Click on MANAGE.
- This is where we begin creating our Mobile Services project.
Creating a mobile service
- When you click on CREATE A NEW APP and follow through with the ensuing wizard, the following will occur:
- A SQL Database will be created
- A web service will be created with a URL that you define
- A sample Windows 8 application will get generated
- We will ignore the sample application and create an iOS application instead
How to Create a backend service for your iOS Application
- There is a caveat, though.
- Our iOS app will not end up in the Windows Store. That should not come as a surprise.
Specifying the URL that our iOS app will use
- This is the URL that will be used by mobile clients to access the mobile service
- Windows 8, iOS (or any REST-enabled client using http)
- BrunoToDoService will be in the url used by iOS clients.
- We can create a new database or use an existing one.
- We are creating a new SQL Database. You could use an existing one if you like.
- Currently, only the EAST is available for the region.
Specifying the name of the database
- This database is automatically used by the service we just created
- We will specify a new server to place the new database in.
- You could create a new server as well.
Advanced Settings
- You can choose alternate sizes for the database
- You can go up to 150gb
- That is the business edition
All your hard work results in this
- The mobile service has been created
- It takes less than a minute.
- When the service is created, it is automatically bound to your previously created database.
- Next steps will be to start adding data to our database.
Coming next…
How to connect to add records to a database. We will also add a new iOS client.