Book Image

Learning Microsoft Azure

By : Geoff Webber Cross, Geoff Webber-Cross
Book Image

Learning Microsoft Azure

By: Geoff Webber Cross, Geoff Webber-Cross

Overview of this book

Table of Contents (19 chapters)
Learning Microsoft Azure
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Updating the order processor


We can update the order processor worker role to call the Notification/PostOrderUpdate action when an order status changes. We'll do this in the following short procedure:

  1. Install the mobile service NuGet package with the following command in the NuGet Package Manager Console:

    Install-Package WindowsAzure.MobileServices
    
  2. Add a mobileServiceUrl string setting to the role's settings with the URL of our local service for local and the publish service for the cloud.

  3. Add a mobileServiceKey string setting to the role's settings with the master key of our local service for local and the published service for the cloud.

  4. Add a MobileServiceClient variable, which is instantiated in the constructor with cloud configurations settings like this:

    private readonly MobileServiceClient _mobileService;
    
    public OrderProcessor()
    {
        var mobileServiceUrl = CloudConfigurationManager.GetSetting("mobileServiceUrl");
        var mobileServiceKey = CloudConfigurationManager.GetSetting("mobileServiceKey...