WindowsAzureIf you follow my blog or on Twitter then you know that I’m passionate about using services running in Windows Azure to power mobile applications. To effectively run mobile services for mobile apps you need a platform that is responsive to a global audience and able to scale to the needs of your user base – Windows Azure provides these capabilities.

As part of the refresh of the WindowsAzure.com we have also provided additional information about mobile scenarios – it’s worth taking a look.

We’ve built a lot of resources that you should take a look at, including: the Windows Azure Toolkit for iOS, the Windows Azure Toolkit for Android, the Windows Azure Toolkit for Windows Phone, and a host of NuGet packages for Windows Phone and Windows Azure. All of these resources include native libraries (e.g. Objective-C for iOS and .NET for Windows Phone), sample applications, documentation, and tools. We also have a lot of videos and guides available to make the process of getting started as easy as possible.

How can you help?

One of my primary goals in 2012 is to continue to find and build compelling mobile applications that benefit from Windows Azure. We already have few great stories (see T-Mobile USA, Red Badger, easyJet, and more) but that’s only scratching the surface – we can do a lot more!

So, I have a few questions of you:

  • Are you building mobile applications that use services in Windows Azure?
  • Are you looking for additional PR and opportunities to highlight your applications?
  • Have you tried any of the toolkits or NuGet packages?
  • Do you have feedback for me regarding the use of the toolkits or NuGet packages?
  • What should we do that we aren’t today?
  • Do you have an application released to a marketplace – either Windows Phone, Apple, or Android – that uses Windows Azure?

If you have any feedback to these questions then please contact me at wade.wegner@microsoft.com. I want to hear from you!

Let’s see what we can accomplish together!

I am tremendously pleased to share that today we have released the Windows Azure Toolkit for Android! We announced our intentions to build a toolkit for Android back in May, and it had always been our intention to release this summer (we only missed by a week or so).

In addition to this release of Android, we have also:

These releases complete our coverage of the three device platforms we intended to cover earlier this year when we started our work – Windows Phone, iOS, and Android.

Windows Azure Toolkits for Devices

It’s my belief that cloud computing provides a significant opportunity for mobile device developers, as it gives you the ability to write applications that target the same services and capabilities regardless of the device platform. Furthermore, I believe that Windows Azure is the best place to host these services. Take a look at the post Microsoft Releases the Windows Azure Toolkit for Android for examples of how American Airlines and Linxter are using the toolkits and Windows Azure to build great cross-device applications!

In addition to releasing the the Android toolkit, we have released some important updates to the Windows Phone and iOS (i.e. iPhone & iPad) toolkits for Windows Azure. Since I have so many things to cover in this post, let me break it all down in various sections (click the links to jump to the section of choice):

Android

Today we released version 0.8 of the Windows Azure Toolkit for Android. This version includes native libraries that provide support for storage and authN/Z, a sample application, and unit tests. Everything is built in Eclipse and uses the Android SDK.

Here’s the project structure:

  • library
    Eclipse library project
  • simple (sample application)
    Eclipse sample project
  • tests
    Eclipse test project

The library project includes the full source code to the storage client and authentication implementations.

Once you configure your workspace in Eclipse, you can run the simple sample application within the Android emulator.

Starting the Android Emulator

From here you choose to either connect directly to Windows Azure storage using your account name and key or through your proxy services running in Windows Azure. To set your account name and key, modify the ProxySelector.java file …

ProxySelector

… found here:

FileLocation

As with the Windows Azure Toolkits for Windows Phone and iOS, we recommend you do not put the storage account name and key in your application source code. Instead, use a set of secure proxy services running in Windows Azure. You can use the Cloud Ready Packages for Devices which contain a set of pre-built services ready to deploy to Windows Azure.

As you can see from it’s name, the shipping sample is designed to be simple – do not consider this a best practice from a UI perspective. However, it does should you fully how to implement the storage and authentication libraries. For another alternative at the library implementations, take a look at the unit tests.

Windows Phone

Today we released version 1.3.0 of the Windows Azure Toolkit for Windows Phone. This release includes a number of long awaited features and updates, including:

  • Support for SQL Azure as a membership provider.
  • Support for SQL Azure as a data source through an OData service.
  • Upgraded the web applications to ASP.NET MVC 3.
  • Support for the Windows Azure Tools for Visual Studio 1.4 and Windows Phone Developer Tools 7.1 RC.
  • Lots of little updates and bug fixes.

I’m most excited about the support for SQL Azure.

SQL Azure Support

The new project wizard now lets you choose where you want to store data in Windows Azure – you can both Windows Azure storage and SQL Azure database!

You can choose to enter your SQL Azure credentials into the wizard (which places them securely in your Windows Azure project, not the device) or use a SQL Server instance locally for development.

Using SQL Azure Locally

Once you’ve finished walking through the wizard, you may not immediately notice anything different – that’s a good thing! However, in the background all the membership information has been stored in a SQL database, and you’ll see in the application a new tab for your SQL Azure data that’s consumed through an OData service.

SQL Azure in the Phone Emulator

Moving forward we plan to only target the Windows Phone Developer Tools 7.1 releases (i.e. no more WP 7.0). However, we have archived all the 7.0 samples, and will continue to ship them as part of the toolkit as long as the Windows Phone Marketplace accepts 7.0 applications. You can find them organized in two different folders: WP7.0 and WP7.1.

Samples

iOS

Over the last few weeks, and with the help of Scott Densmore, we have made a series of important updates to the Windows Azure Toolkit for iOS – namely, bug fixes and project restructuring!

Over the last few weeks, as more and more developers used our iOS libraries, we started getting reports of memory leaks. Scott has spent a considerable amount of time tracking these down, and all these updates have been checked into the repo.  Additionally, we have spent some time refactoring our github repos, and you’ll now find everything related to the Windows Azure Toolkit for iOS in a single repository:

github repo for iOS

This gives us a lot more flexibility for releases, as well as making sure that the resources are easy to use and consume.

What’s Next?

Oh no, we’re not done! There’s still a lot we want to do. We continue to get great feedback from customers and partners using these toolkits.

Over the next few months, here are the things we’ll focus on:

  • Continue to update the Windows Azure Toolkits for iOS and Android so that they are in full parity with the Windows Azure Toolkit for Windows Phone.
  • Samples, samples, and more samples! We want to have a great set of samples that work across all three device platforms. We’ve got a good start with BabelCam, but we need to bring it to iOS and Android, and then build more!
  • Continue to support and fix the toolkits.

Your feedback is invaluable, so please continue to send it our way!

The v1.2 release of the Windows Azure Toolkit for iOS includes support for Windows Azure Access Control Service (ACS).  The enables iOS developers to create applications that can use and rely on federated identity providers such as Windows Live, Google Accounts, and Facebook Connect. 

This walkthrough document covers configuring the ACS service and creating a new iOS project using XCode to authenticate against this service.  This is accomplished using the following three steps in this document:

  1. Manually Configure ACS (Access Control Service).
  2. Create New Project and Import Library
  3. Expanding the solution with the Cloud Ready Package

In order to run through this tutorial, you’ll need an active Windows Azure subscription.  Further information about creating a new account for Windows Azure can be found on http://www.windowsazure.com

Step 1 – Manually Configure ACS (Access Control Service)

This section will describe how to configure ACS manually for a new iOS application.  If you have already deployed the Cloud Ready package and configured the service using the Cloud Ready Configuration Wizard, you can skip to Step 2.

First, access the Windows Azure portal by navigating to http://windows.azure.com and signing in with your credentials.

iOSACS1

Click on the Service Bus, Access Control & Caching menu item and select the Access Control menu item under the AppFabric folder.  Select an active Windows Azure subscription and click on the New button in the toolbar.

iOSACS2

The new service namespace dialog will open.  Ensure that Access Control is selected, and enter a unique namespace and country/region for the service.

iOSACS3

The ACS namespace will now be created.  This might take a few minutes.  Wait until the namespace is showing in an Active state.

iOSACS4

Once this is complete, highlight the newly created service and click on the Access Control Service button in the toolbar.  This will launch the Access Control Service portal. 

Within the portal, click on Identity Providers and add the identity providers you would like to use for your application.

iOSACS5

The default is Windows Live ID, but you can add other preconfigured providers (such as Google and Yahoo!) as well as external identity systems configured to use WS-Federation.

Once you have added the required providers, click on the Relying Parties section of the portal.

iOSACS6

Click on the Add button and enter the following information for the relying party application:

Name – a given name for your application
Realm – a unique ID for your application.  For this walkthrough, we’ll be using uri:wazmobiletoolkit
Return URL – you can leave this blank
Error URL – you can leave this blank
Token Format – select SWT
Token Lifetime – Feel free to change the default from 600 seconds. 

Select the identity providers that you would like to use, and then under the Token Signing Settings section, click on the Generate button to create a new symmetric key that will be used for this application.

Finally, click on the Save button.  This will create the Relying Party Application.

Next, go into the Rule Groups section of the portal and select the default rule group that was created for the application.

iOSACS7

Click on the Generate link in order to generate a set of default rules for this rule group.

iOSACS8

Select the providers that you wish to use, and click on the Generate button.  Once this is complete, you should see a set of rules.

iOSACS9

After this step is complete, ACS has now been configured correctly to be used with your iOS application.  Make a note of your Service Namespace (found at the top of the portal) and Realm as you’ll need these in the next step of the walkthrough.   

Step 2 – Create New Project and Import Library

The following has been tested with XCode 4.0.2 or higher. 

Before you begin, you should download the latest version of the Windows Azure Toolkit for iOS library from http://github.com/microsoft-dpe/watoolkitios-lib.  Save the zip file in a place that can be found later.

To start, launch XCode 4 and create a new project.

iOSACS10 

From the project template dialog, select a View-based application and click on the Next button.

iOSACS11

Enter a Product Name and Company Identifier and click on the Next button to continue.  Select a directory to use for the project file and return to the IDE.

Next, locate the version of the Windows Azure toolkit for iOS library that you downloaded earlier.  In the download will be a zip file containing two versions of the library (one for the device, one for the simulator) and some header files for the project.

Right click on your project and select the Add Files to… menu option.

iOSACS12

Locate the .a file (for the simulator) and header files and add them to your project.  You may want to create a new group (called lib) to store these in.

iOSACS13 

Now we need to add a reference to a library required for XML parsing.  To do this, click on the top most project file, click on the target in the 2nd column of the IDE, and select Build Phases from the tab menu.

iOSACS14

In the main window, expand the Link Binary with Libraries option.

Ensure that the libwatoolkitios.a file has been automatically added as a reference, click the + button to add a new library, and select the libxml2.dylib library from the drop down list.

iOSACS15

Click on the Add button to add a reference to this library for your project.

Before we start adding any code, we need to add a couple of required linker flags to the project.  To do this, click on the Build Settings tab (next to Build Phases).

In the search box, type “other linker” to filter the settings.

iOSACS16

You should see a setting called Other Linker Flags.  Double click on the right side of this row to add new flags.

Click on the + button to add two flags.  The first is –ObjC and the second is –all_load.  Once complete, your linker flags should look like the following screenshot:

iOSACS17

Click on the Done button to save these settings.  The project is now configured correctly to reference the Windows Azure Toolkit library.

To test that the library works, click on the project’s [ProjectName]AppDelegate.m file.  Add the following #import statement at the top of the class:

#import "WACloudAccessControlClient.h"

Next, search for a method called didFinishLaunchingWithOptions and after the [self.window makeKeyAndVisible] line, enter the following code.

NSLog(@"Intializing the Access Control Client…");
WACloudAccessControlClient *acsClient = [WACloudAccessControlClient accessControlClientForNamespace:@"iostest-walkthrough" realm:@"uri:wazmobiletoolkit"
];
[acsClient showInViewController:self.viewController allowsClose:NO withCompletionHandler:^(BOOL
authenticated)
{
   if
(!authenticated)
   {
      NSLog(@"Error authenticating"
);
   }
   else
   {
      NSLog(@"Creating the authentication token..."
);
      WACloudAccessToken *token = [WACloudAccessControlClient sharedToken
];
      /* Do something with the token here! */
   }
}];

Replace the namespace and realm in the first line with the service namespace and realm for your own service, as created in Step 1. 

As you can see from the above, the code creates a new instance of the access control client, requests that the client shows itself in the current view controller, and then extracts a token. 

Build and run the application in the iOS Simulator. 

Once the application starts, you should be prompted to select an identity provider from the list that you configured in your ACS service.

iOSACS18

Pick one of the providers, and enter a valid set of credentials.

iOSACS19

Click on the Remember me checkbox if you want to skip this step when running this application again, and click on the Sign in button.

The first time the application is run, you’ll be prompted to authorize the application to access your provider data.

iOSACS20

Click on the Allow button to continue.  The login window will now disappear and you’ll be returned to your application.

In the debug window, you should see the following two logs:

2011-07-22 10:12:26.284 iostest-walkthrough[25838:207] Intializing the Access Control Client…
2011-07-22 10:12:36.359 iostest-walkthrough[25838:207] Creating the authentication token…

The final message indicates that the access token was retrieved and can be used for further use.  The WACloudAccessToken (derived from [WACloudAccessControlClient sharedToken]) contains an NSDictionary of claims and other properties that can be stored within your application.  Using these properties on future calls can be used to identify returning users to your application.

Congratulations!  You’ve successfully built an application that can use the Windows Azure ACS service for federated identity!

Step 3 – Expanding the solution with the Cloud Ready Package

If you have deployed the Cloud Ready package and configured your ACS service with the Cloud Ready Configuration Utility, you can also extend your sample by using the returned WACloudAccessToken to securely access blob, table, and queue storage in Windows Azure.

To do this, create a new WAAuthenticationCredential object using the token, use this to initialize the WACloudStorageClient and then make calls to the storage type.

The following code example shows how this can be done.

WAAuthenticationCredential *credential = [WAAuthenticationCredential authenticateCredentialWithProxyURL:[NSURL URLWithString:@"[URL OF YOUR CLOUD READY PACKAGE]"] accessToken:[WACloudAccessControlClient sharedToken]];
NSLog(@"Creating the storage client…");

WACloudStorageClient *storageClient = [WACloudStorageClient storageClientWithCredential:credential];
[WACloudStorageClient ignoreSSLErrorFor:@"[FIRST PART OF THE URL FOR YOUR CLOUD READY PACKAGE]"];
NSLog(@"Accessing table storage…");

[storageClient fetchTablesWithCompletionHandler:^(NSArray *tables, NSError *error)
{
   if (!error)
   {
      NSLog(@"%i Tables were found!", [tables count]);
     
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Table Storage" message:[NSString stringWithFormat:@"%i tables were found!",[tables count]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil
];
      [alert show];
      [alert release];
   }
   else
   {
   NSLog(@"%@", [error localizedDescription]);
   }
}];

Replace the URL strings in the above code with the correct URLs for your deployed Cloud Ready package.  If everything works, after you sign in to the application you should see an alert box showing the number of tables in your storage account.

The Windows Azure Toolkit for iOS provides an easy and convenient way of accessing Windows Azure storage from iOS-based applications.

The toolkit works in two ways – the toolkit can be used to access Windows Azure storage directly, or alternatively, can go through a proxy service known as the Cloud Ready package.  The Cloud Ready code is the same code as used in the WP7 toolkit for Windows Azure (found here) and negates the need for the developer to store the Azure storage credentials locally on the device.  If you are planning to test using the proxy server, you’ll need to download and deploy the server controls hosted on the Codeplex site.

Unpacking the v1.2 library zip file

In the zip file, you’ll find several folders:

    • /4.3-device – the library binary for iOS 4.3 (device)
    • /4.3-simulator – the library binary for iOS 4.3 (simulator)
    • /include – the headers for the library

    Creating your first project using the toolkit

    If you are not familiar with XCode, this is a short tutorial for getting your first project up and running.  Launch XCode 4 and create a new project:

    iOS1

    Select a View-based application and click Next.

    Give the project a name and company.  For the purposes of this walkthrough, we’ll call it “FirstAzureProject”.  Do not include Unit Tests.

    iOS2

    Pick a folder to save the project to, and uncheck the source code repository checkbox. 

    When the project opens, right click on the Frameworks folder and select “Add Files to…”

    iOS3

    Locate the libwatoolkitios.a library file from the download package folder (from either the simulator or device folder), and add it to the Frameworks folder.

    iOS4

    Now, click on the top most project (FirstAzureProject) in the left hand column.  Click on the target in the second column.  Click on the “Build Settings” header in the third column.  Ensure that the “All” button is selected to show all settings.

    In the search box, type in “header search” and look for an entry called “Header Search Paths”

    iOS5

    Double click on this line (towards the right of the line), and click on the “+” button in the lower left.

    iOS6

    Add the path to where the folder containing the header files are located (this is the include folder from the download).  For example, "~/Desktop/v1.0.1/include" if you have extracted the folder on your desktop.  Be sure to encapsulate in quotes if you have spaces in the path.

    iOS7

    Remaining in the “Build Settings” tab, now type in “other linker flags” in to the search bar.  In the “Other Linker Flags” section, add two Flags.  –ObjC and –all_load

    iOS8

    Finally, click on the “Build Phases” tab and expand the “Link Binary with Libraries” section:

    iOS9

    Click on the “+” button in the lower left, and scroll down until you find a library called “libxml2.2.dylib”.  Add this library to your project.

    Testing Everything Works

    Now that you’ve added all of the required references, let’s test that the library can be called.  To do this, double click on the [ProjectName]AppDelegate.m file (e.g. FirstAzureProjectAppDelegate.m), and add the following imports to the class:

    #import "WAAuthenticationCredential.h"
    #import "WACloudStorageClient.h"

    Perform a build.  If the build succeeds, the library is correctly added to the project.  If it fails, it is recommended to go back and check the header search paths.

    Assuming it builds, in the .m file, add the following declarations after the @synthesize lines:

    WAAuthenticationCredential *credential;
    WACloudStorageClient *client;

    Now, add the following lines after the [self.window makeKeyAndVisible] line in the didFinishLaunchingWithOptions method:

    credential = [WAAuthenticationCredential credentialWithAzureServiceAccount:@"ACCOUNT_NAME" accessKey:@"ACCOUNT_KEY"];
    client = [WACloudStorageClient storageClientWithCredential:credential];
    [client fetchBlobContainersWithCompletionHandler:^(NSArray* containers, NSError* error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"%i containers were found…",[containers count]);
       }
    }];

    Be sure to replace ACCOUNT_NAME and ACCOUNT_KEY with your Windows Azure storage account name and key, available on the Windows Azure portal (http://windows.azure.com).

    Build and run the project.  You should something similar to the following output in the debug window:

    2011-05-06 18:18:46.001 FirstAzureProject[27456:207] 2 containers were found…

    The last line shows that this account has 2 containers.  This will of course vary, depending on how many blob containers you have setup in your own Windows Azure account.

    Doing more with the toolkit

    Feel free to explore the class documentation to explore more of the toolkit API.  To help, here are some additional examples:

    In [ProjectName]AppDelegate.m class, add the following headers:

    #import "WAAuthenticationCredential.h"
    #import "WACloudStorageClient.h"
    #import "WABlobContainer.h"
    #import "WABlob.h"
    #import "WATableEntity.h"
    #import "WATableFetchRequest.h"
    #import "WAQueue.h"
    #import "WAQueueMessage.h"

    In the didFinishLaunchingWithOptions method, after the [self.window makeKeyAndVisible] line, try testing a few of the following commands.  Again, running the project will return results into the debugger window.

    To authenticate using account name and key:

    credential = [WAAuthenticationCredential credentialWithAzureServiceAccount:@"ACCOUNT_NAME" accessKey:@"ACCOUNT_KEY"];

    To authenticate instead using the proxy service from the Windows Phone 7 toolkit, you can use the following:

    credential = [WAAuthenticationCredential authenticateCredentialWithProxyURL:[NSURL URLWithString:@"PROXY_URL"] user:@"USERNAME" password:@"PASSWORD" withCompletionHandler:^(NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"Successfully logged in");
       }
    }];

    Replace the PROXY_URL, USERNAME, and PASSWORD with the information required to access your proxy service.

    To create a new client using the credentials:

    client = [WACloudStorageClient storageClientWithCredential:credential];

    To list all blob containers (this method is not supported via the proxy server):

    // get all blob containers
    [client fetchBlobContainersWithCompletionHandler:^(NSArray *containers, NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"%i containers were found…",[containers count]);
       }
    }];

    To get all tables from storage (this works with both direct access and proxy):

    // get all tables
    [client fetchTablesWithCompletionHandler:^(NSArray* tables, NSError* error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"%i tables found",[tables count]); 
       }
    }];

    To create a table (works with both direct access and proxy):

    [client createTableNamed:@"testtable" withCompletionHandler:^(NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"Table created");
       }
    }];

    To delete a table (works with both direct access and proxy):

    //delete a table
    [client deleteTableNamed:@"wadestable" withCompletionHandler:^(NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"Table was deleted");
       }
    }];

    To get entities for a table (works with both account key and proxy):

    // get entities for table developers
    WATableFetchRequest* fetchRequest = [WATableFetchRequest fetchRequestForTable:@"Developers"];
    [client fetchEntities:fetchRequest withCompletionHandler:^(NSArray *entities, NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"%i entities found in the developer table",[entities count]);
       }
    }];

    To get entities for a table using predicate (works with both account key and proxy):

    // get entities for table developers with predicate request
    NSError* error = nil;
    NSPredicate* predicate = [NSPredicate predicateWithFormat:@"Name = 'Wade' || Name = 'Nathan' || Name = 'Nick'"];
    WATableFetchRequest* anotherFetchRequest = [WATableFetchRequest fetchRequestForTable:@"Developers" predicate:predicate error:&error];

    [client fetchEntities:anotherFetchRequest withCompletionHandler:^(NSArray *entities, NSError *error)
    {
       if (error)
       {
          NSLog(@"%@",[error localizedDescription]);
       }
       else
       {
          NSLog(@"%i entities returned by this request",[entities count]);
       }
    }];

    Doing even more with the toolkit

    If you are looking to explore the toolkit further, we would recommend looking at the sample application that can be found in the watoolkitios-samples project.  This project demonstrates all of the functionality of the toolkit, including creating, uploading, and retrieving entities from both table and blob storage. 

    In addition, you might also want to check out the documentation outlining the ACS (Access Control Service) functionality of the toolkit.

    Today we released an update to our Windows Azure Toolkit for iOS that provides some significant enhancements – in particular, we now provide support for using the Windows Azure Access Control Server (ACS) from an iOS application.  You can get all the bits here:

    We first released this toolkit on May 6th, and since then we’ve released two minor updates and even accepted a merge request from the community.  This toolkit has been a real pleasure to work on.  Not only has it been to break out of the traditional Microsoft stack and learn about new languages and environments, but it’s also been great to introduce a lot of Objective-C and iOS developers to the power of Windows Azure.

    ACS & iOS/iPhone

    There are three key aspects to version 1.2 of the iOS toolkit:

    1. Cloud Ready Packages for Devices
    2. Configuration Tool
    3. Support for ACS

    These three pieces are incredibly important when trying to develop iOS applications that use Windows Azure; consequently, let me try and explain each of these components and how they help to make development easier.

    Cloud Ready Packages for Devices

    One of the biggest challenges when using Windows Azure for an iOS developer today is the inability to create a package that can be deployed to Windows Azure.  To make this easier, we have pre-built four Cloud Ready Packages for Devices so that you – the iOS developer – don’t have to setup Windows 7 and run CSPACK.  Instead, you simply have to download the most appropriate cloud ready package, update the .CSCFG file, then deploy through the Windows Azure Portal.

    We have four “flavors” of the Cloud Ready Packages:

    • ACS + APNS – this version allows you to use the Access Control Service and register your certificate for the Apple Push Notification Service
    • ACS – this version allows you to use the Access Control Service
    • Membership + APNS – this version allows you to use a simple membership store in Windows Azure table storage for users and register your certificate for the Apple Push Notification Service
    • Membership – this version allows you to use a simple membership store in Windows Azure table storage for users

    For more information on how to use and deploy these packages, take a look at this video on deploying the Cloud Ready Packages for Devices.

    Configuration Tool

    Along with the CSPKG you need a CSCFG to deploy your application to Windows Azure.  The CSCFG file is an xml document that helps to describe elements of your application to Windows Azure so that it is able to correctly run your application.

    In Visual Studio we have tools that make it easy to update the CSCFG file without having to open up the XML, but of course you cannot do this on a Mac.  To make this easier, we created a tool that you can use on the Mac to walkthrough and generate the CSCFG file with all the appropriate details.  Once created, you can use this CSCFG file along with the downloaded CSPKG file to deploy your application.

    iosconig

    In addition to creating the CSCFG file, the configuration tool will also updated ACS with all the appropriate settings so that you can build & run your application quickly.  For all the details, please take a look at Vittorio Bertocci’s post on Using the Windows Azure Access Control Service in iOS Applications.

    Support for ACS

    Everything I’ve described above is designed to make it easier for an iOS developer to quickly and easily use the Access Control Service.  To use the library for authenticating to ACS, it’s really quite simple:

    NSLog(@"Intializing the Access Control Client...");
    WACloudAccessControlClient *acsClient = [WACloudAccessControlClient accessControlClientForNamespace:@"iostest-walkthrough" realm:@"uri:wazmobiletoolkit"];
    
    [acsClient showInViewController:self.viewController allowsClose:NO withCompletionHandler:^(BOOL authenticated) {
        if (!authenticated)
        {
             NSLog(@"Error authenticating");
        }
        else
        {
             NSLog(@"Creating the authentication token...");
             WACloudAccessToken *token = [WACloudAccessControlClient sharedToken];
             /* Do something with the token here! */
        }
    }];

    I’ll post more walkthroughs and documentation shortly.

    As always, please let me know what you think of the release!  Your feedback is important to us, especially as it pertains to prioritizing future features and capabilities.