This Toolkit is now deprecated and is now

superseded by Windows Azure Mobile Services

The Windows Azure Toolkit for Windows Phone provided developers with the first iteration of support for building backend services for Windows Phone apps using Windows Azure.  The main areas of feedback we received from mobile developers was that they wanted a turn-key set of services for common functionality such as notifications, auth, and data.   Windows Azure Mobile Services directly reflects this feedback by enabling developers to simply provision, configure, and consume scalable backend services. The downloads for this toolkit will be removed on the week of Feb 1st 2013 and all future improvements will be channeled into Windows Azure Mobile Services rather than this toolkit. 

To get started with Mobile Services, sign up for a Windows Azure account and receive 10 free Mobile Services.


WAT Windows Phone

This section provides a walkthrough for the TweetYourBlobs sample application. This application was developed using the Windows Phone Cloud Application project template included in this toolkit.

 

Starting the Application

After installing the toolkit and running the SetupSample.cmd setup script for this sample, perform the following steps to go through the TweetYourBlobs application.

Note: If you face any problems while following these steps, please make sure to review the Troubleshooting section.

  1. Open Visual Studio 2010 as administrator (this is required to run Windows Azure projects).
  2. In the File menu, point to Open and then click Project/Solution.
  3. Browse to the Samples\WP7.1\TweetYourBlobs folder, choose TweetYourBlobs.sln and click Open.
  4. Explore the sample. You should see the following projects:
    • TweetYourBlobs: Windows Azure project with a Web Role configured.
    • TweetYourBlobs.Phone: Silverlight for Windows Phone project containing a sample application that shows how to work with Blobs and Containers.
    • TweetYourBlobs.Web: ASP.NET MVC 3 project configured as a Web Role containing the services consumed by the phone application. This project does not contain a Web administration portal; it only hosts the required WCF services.
      image
  5. Additionally, the solution includes the source code for the following libraries used:
    • Microsoft.Samples.Data.Services.Client: Modified version of the OData client library for Windows Phone (System.Data.Services.Client) to make it work with the Windows Azure Table Service API (http://odata.codeplex.com).
    • WindowsPhoneCloud.StorageClient: Windows Azure Storage Client library for Windows Phone.
  6. Make sure that you do not have any Web site running in ports 443 and 10080 on your local IIS.
    Note: By default, the ASP.NET MVC 3 Web Role is configured to run over two different endpoints: one HTTPS in port 443 and another HTTP in port 10080.
  7. In Solution Explorer, right-click the Windows Azure project, point to Debug and click Start new instance.
  8. Wait for the Web Role to start and click the Continue to this website (not recommended) link to be able to browse the site despite of the certificate warning. You will get a forbidden error because the Web site does not have any pages (it only hosts a WCF Service), and IIS by default does not allow anonymous users to list the site directory.
    image
  9. In Solution Explorer, right-click the Windows Phone project, point to Debug and click Start new instance. This will launch the Windows Phone Emulator and start the application.
  10. The application will redirect you to the main page.
    image
  11. In the main page, click the Install certificate link. This will open Internet Explorer in the Windows Phone Emulator at http://127.0.0.1:10080/127.0.0.1.cer.
    image
    Note:
    In order to consume the REST services over HTTPS in a Windows Phone device or in the Windows Phone Emulator, you need to use a trusted SSL certificate. If you do not have one, you can use a self-signed certificate, but you need to install it in the phone before consuming the services. Since the Computer Emulator always uses the 127.0.0.1 self-signed certificate, we need to install it in the Windows Phone Emulator before continuing with the next steps.
     
  12. Click the shield icon to install the Windows Azure Compute Emulator’s SSL certificate in the Windows Phone Emulator. Finally, click install to confirm that you want to install the certificate.
    image
    Important: If you leave the Windows Phone Emulator open, you do not need to install the certificate every time that you run the application. However, if you close the Windows Phone Emulator, you will have to install it again.
  13. Once the certificate is installed, click ok and navigate back to the running application using the left arrow (image).
    image

 

Taking a Picture and Uploading it to a Blob Container

  1. In the main page, click the camera button to open the device camera. Click the button in the top-right corner of the screen to take a photo and then click accept. This will redirect you to the tweet picture page.
    image
  2. In the tweet picture page, type the name of the container where you want to upload your picture. Notice that the autocomplete list of available containers is filtered while you type. If you type a container name that does not exist in the storage, it will be created. Additionally, if you check the Make container public option, the Container ACL will be changed to full public read access.
    image
  3. Type a name for the blob. Additionally, check the Include location data option if want to include the GPS location value as blob metadata. Finally, click tweet. If everything worked as expected, Internet Explorer will be opened in the Windows Phone Emulator showing the Twitter mobile page.
    image

 

Tweeting your Blob

  1. In the Sign in! page, enter your Twitter credentials and click Sign in.
    image
  2. You will see a message ready to be tweeted with the blob URL shortened by bitly. Click Tweet to publish it. If you then click the link inside the tweet you have just sent, you will navigate to the blob containing your picture.
    image

 

Next step: CRUD Sql Azure

Last edited Jan 21, 2013 at 8:25 PM by nharris, version 10

Comments

No comments yet.