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

In order to deploy the toolkit services generated by either the Windows Phone Cloud Application or the Windows Phone Empty Cloud Application project templates to a Windows Azure Hosted Service, please follow these steps:

 

Create a Certificate

  1. Open the Visual Studio Command Prompt window as an administrator.
  2. Change the directory to the location where you want to save the certificate file.
  3. Type the following command, making sure to replace <CertificateName> with your hosted service URL:

    makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My "<CertificateName>.cer"
    For example:

    image
    Note: The makecert tool will both create the .cer file and register the certificate in your Personal Certificates store. For more information, check the following article: http://msdn.microsoft.com/en-us/library/gg432987.aspx.

 

Export the PFX File

  1. Open the Certificate Manager snap-in for the management console by typing certmgr.msc in the Start menu textbox. 
    4
  2. The new certificate was automatically added to the personal certificate store. Export the certificate by right-clicking it, pointing to All Tasks, and then clicking Export.
  3. On the Export Private Key page, make sure to select Yes, export the private key.
    image
  4. Choose a name and export the file to a .pfx file.
    image
  5. Finish the wizard.

    Note: You now have a copy of the certificate (.pfx) with the private key. For more information, check the following article: http://msdn.microsoft.com/en-us/library/gg432987.aspx.

 

Upload the PFX File to Windows Azure

  1. Open a browser, navigate to the Windows Azure Platform Management Portal at https://windows.azure.com and log in with your credentials.
  2. Select Hosted Services, Storage Accounts & CDN and then Hosted Services.
  3. Expand your hosted service project, and select the Certificates folder.
    image
  4. Click Add Certificate.
  5. Click Browse and select the PFX file you saved. Enter the password, and click Create.
    image
  6. Once the certificate has been uploaded and created, copy the Thumbprint for later use.
    image

 

Supporting Apple Push Notifications

During the project creation through the project template, you are given the option to support Apple Push Notifications through the Azure Web role.

image

If you chose to support Apple Push Notifications, please follow these additional steps:

  1. In order to use the toolkit to send Apple push notifications, you should have obtained the appropriate SSL certificate for your iOS application. You can find more information on how to obtain an Apple development certificate in the Provisioning and Development article in the Local and Push Notification Programming Guide.
  2. Upload the same Apple development certificate selected during the project template wizard to your hosted service. To do this, you can follow the same steps required to upload the SSL certificate described in the previous section.

 

Update and Deploy to Windows Azure

  1. In the Windows Azure Project, double-click the role (e.g. WPCloudApp1.Web) to open the role properties.
  2. Select the Settings tab and update the DataConnectionString and Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString to point to your production storage account.
  3. Select the Certificates tab, and set the SslCertificate property value to the Thumbprint you saved from the Windows Azure portal. This will replace the thumbprint for the localhost certificate with the thumbprint related to the certificate you uploaded into your hosted service.
  4. Add the .cer file to your web application project. This way, you can point your phone users to download the certificate and install into the emulator. Right-click on the Web application project, choose Add Existing Item, select the .cer file you previously created, and add it to the project.
  5. Open the .cer file properties and make sure that the Build Action is set to Content.
    image
  6. Now you can publish your Windows Azure project to your hosted service. You can do this from the Windows Azure Platform Management Portal or directly from Visual Studio 2010.

 

Update Your Windows Phone Project to Consume Your Windows Azure Hosted Service

  1. In your Windows Phone project, open the App.xaml file.
  2. Update the following resources:

    Key

    Value

    SSLCertificateUrl

    http://<YourDNSPrefix>.cloudapp.net:10080/<CertificateName>.cer

    SharedAccessSignatureServiceEndpoint

    https://<YourDNSPrefix>.cloudapp.net/SharedAccessSignatureService

    AzureStorageTableProxyEndpoint

    https://<YourDNSPrefix>.cloudapp.net/AzureTablesProxy.axd

    AzureStorageQueueProxyEndpoint

    https://<YourDNSPrefix>.cloudapp.net/AzureQueuesProxy.axd

    AuthenticationServiceEndpoint

    https://<YourDNSPrefix>.cloudapp.net/AuthenticationService

    RegistrationServiceEndpoint

    https://<YourDNSPrefix>.cloudapp.net/RegistrationService

    PushNotificationServiceEndpoint

    https://<YourDNSPrefix>.cloudapp.net/PushNotificationService

    SqlOdataEndpoint

    https://<YourDNSPrefix>.cloudapp.net/SqlAzureSampleOdataService

  3. To test against the deployed services, right-click the Windows Phone project, navigate to the Debug context menu, and click on Start new instance.

Last edited Jan 21, 2013 at 9:26 PM by nharris, version 13

Comments

asWorks Mar 14, 2012 at 4:49 PM 
What I would like to know - we´re always talking of emulators and selfcertificates. How does this stuff get into the real world. Will I be able to install this to my developer phone and test it?

markti Oct 5, 2011 at 5:55 PM 
Had to move the following lines of code OUT of the Global.asax and into the OnStart of the WebRole:


var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
CreateSilverlightClientAccessPolicy(account.CreateCloudBlobClient());
CreateCloudTables(account.CreateCloudTableClient());

Then I was able to deploy to Windows Azure.

Wicked cool stuff. Thanks you guys!

carthi Jul 8, 2011 at 5:53 AM 
Hi All,

I able to solve the problem by following instructions posted in the article below.

Please correct the sections related to generating and deploying certificates in this article as it will not work with self signed certificate as described here.

http://blogs.msdn.com/b/davidhardin/archive/2011/01/19/wp7certinstaller-1-0-0-0-explained.aspx

carthi Jul 2, 2011 at 9:09 PM 
Hi, I followed the instructions in this article. However, I could not login the user from Windows Phone emulator even after installing the certificate. I am getting a message "Not Found" and try install the certificate. Any Idea how can I trouble shoot this issue? Note: I able to login into app via Internet Browser. Not by phone application.