Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Windows Azure: Setting the Web Role as Your Startup Project

    Posted on February 8th, 2010 mitch Print Print No comments

    I was faced with an interesting problem and the end of last week that caused me to spend way too much time troubleshooting.

    A Windows Azure solution is a collection of projects with your Cloud Project being the top and most important.  If you’re creating a web site, you’ll have at least one Web Role project that is, for all intents and purposes, an ASP.NET web site.

    This is where things went rather wrong.  We added a Silverlight project to our solution and about the same time, the Startup Project for the solution changed from the Cloud project to our Web Role.

    What does that mean to the average developer?  Well, it turns out that “it depends” is the answer.

    If your Cloud project is not set as the Startup Project then your application may or may not properly launch the Azure Development environment.  I say may because I found that some things worked, or at least didn’t report an error, while other things reported errors that may no sense at all.

    Specifically, I was receiving the following error when I attempted to insert a message into a queue:

    ConfigurationSettingSubscriber needs to be set before FromConfigurationSetting can be used

    For one, this error message is incorrect.  It is actually the ConfigurationSettingPublisher that has the issue. I did not get an error on code concerning the use of the ConfigurationSettingPublisher, I actually received the message when I attempted to connect to a queue.

    I had copied the code exactly from a perfectly functioning demo application that is part of the Windows Azure Platform Training Kit.  But it still didn’t work in my project.

    Finally, after much time and troubleshooting I happened to notice that our Web Role was set as the Startup Project which, it turns out, is a bad thing.

    Bill Lodin has an article where he mentions this and is the one that finally led me down the path to finding and fixing my problem.

    I reset the Startup Project to our Cloud project and we’re back in business.

    I just wish Microsoft had made the errors a little clearer.

    Note: Microsoft just released version 1.1 of the Azure SDK so I’ll install it to see if anything has changed.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    218 views
  • Really Cool Technology: Nike Application Shows Off Windows Azure Features

    Posted on February 4th, 2010 mitch Print Print No comments

    If you have a few minutes and have loaded Microsoft Silverlight, you need to check out the following site by Nike: www.jumpman23mosaic.com

    Use the zoom control on the right side of the page to zoom in.

    Here is some background:

    [ Via Bruce D. Kyle ]

    Check out www.jumpman23mosaic.com. It’s a five gigapixel “social mosaic” of photos of Air Jordan shoes submitted by fans.

    Windows Azure currently supports the following two types of roles:

    • Web role: A web role is a role that is customized for web application programming as supported by IIS 7 and ASP.NET.
    • Worker role: A worker role is a role that is useful for generalized development, and may perform background processing for a web role.

    Fans submit photos of their shoes online. Then every ten minutes Azure worker roles create a profile of new photos. The code inside the worker role looks at the colors in the user-submitted picture to decide where is the “right place” in the mosaic for the photo.

    Azure Web roles work on the front end in collaboration with Silverlight Deep Zoom.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
    Loading ... Loading ...
    252 views
  • Useful Tools for Working with Windows Azure Storage

    Posted on January 21st, 2010 mitch Print Print 1 comment

    I wanted to make quick note of two tools that I’ve found invaluable during my recent development efforts.

    Cloudberry Explorer for Windows Azure Blob Storage

    Allows you to manage your Windows Azure blob storage using a Windows Explorer-like interface:

    It’s very useful should you wish to create blob containers or quickly move large files from your file system to Windows Azure.

     

    Windows Azure Management Tool (MMC)

    This is an Windows MMC snap-in that allows you to manage both Windows Azure Blobs and Queues.

    WindowsAzureMMC3.png

    This tool is indispensible for creating and monitoring Azure Queues.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    387 views
  • Working with Azure Queues: Learning things the hard way.

    Posted on January 20th, 2010 mitch Print Print No comments

    There are times when I do something so stupid that I feel the need to share with everyone, just to reinforce the point that I don’t need to do it again. :) 

    Today would be one of those days.  Here is what I did:

    I was working on my new web site which uses a Windows Azure Queue as a Message Processing System.  Basically I drop a specifically formatted string into a queue and a Azure Worker Role retrieves the message and processes it based on the contents.

    I was adding a new message type today it it wasn’t being processed.  Not because the message wasn’t being decoded properly, because the message was never being seen.

    What the heck, over?  It’s worked for the past two weeks, what would make the messages just disappear from the queue or maybe not be added?

    Well, after wasting about 30 minutes tracing the message through the system, I realized what I was doing wrong ( and where the stupid part comes in ).

    Since my site is still under development I haven’t broken the internal mechanisms into Development and Production versions.  I do, however, have Development and Staging version of my application running on Azure.

    And that was the problem.

    I was running my site locally but pointing to the Cloud instances of my storage.  Every time I placed a message in my queue, either the Production instance or the Staging instance would see the new message and process it.  The last part of processing involves deleting the message from the queue.

    Since two other instances of my site were running, by the time my local instance woke up to look at the queue contents, one of the other instances had already processed it.  This made me think things were not working.

    Anyway, note to self: Make sure the instance of the application you are working on is in sole control of any assets required to properly build and test it

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    236 views
  • Working with Windows Azure Queues

    Posted on January 12th, 2010 mitch Print Print No comments

    Since Windows Azure was only officially released in the past month, you may find a lot of the prior examples do not work because of changes made between the CTP versions and the production version. The StorageClient sample included in the Windows Azure SDK is no exception.

    There are many issues you’ll face getting this working, but the first involves recompiling the StorageClient assembly using the production-level Windows Azure references.

    This article walks you through what’s required to make that happen.

     

    Connecting to Your Production Queues

    One of the biggest problems I faced was actually connecting to the production queues on my Windows Azure Storage instance.  After spending quite a bit of time troubleshooting and browsing the Internet, I realized that StorageClient was looking for the storage endpoints, which you place in your configuration file, in a very specific format. 

    Within your ServiceConfiguration.cscfg file, your role configuration should look something like this:

    <Role name="WorkerRole">
      <Instances count="1" />
      <ConfigurationSettings>
        <Setting name="AccountName" value="myaccountname" />
        <Setting name="AccountSharedKey" value="secretkey" />
        <Setting name="TableStorageEndpoint" value="http://table.core.windows.net/" />
        <Setting name="QueueStorageEndpoint" value="http://queue.core.windows.net/" />
      </ConfigurationSettings>
    </Role>
    

    All you really need to change is the AccountName and AccountSharedKey settings. 

    If you look at your Windows Azure management console, the AccountName is the name of your account as represented in the storage URL ( basically the first word after the http:// ). 

    Note: I’ve not seen documentation on this, but it appears the only accepted format is all lower-case.

    The AccountSharedKey is the Primary Access Key for the storage account.

    The TableStorageEndpoint and QueueStorageEndpoint are the base URLs for your services.  The StorageClient will actually prepend your account name to the base URL to create the proper endpoint.

     

    Connecting to Your Local Development Queues

    It appears that you connect to your local development queue using the following configuration:

    <Role name="WorkerRole">
      <Instances count="1" />
      <ConfigurationSettings>
        <Setting name="AccountName" value="devstoreaccount1" />
        <Setting name="AccountSharedKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />
        <Setting name="TableStorageEndpoint" value="http://127.0.0.1:10002" />
        <Setting name="QueueStorageEndpoint" value="http://127.0.0.1:10001" />
      </ConfigurationSettings>
    </Role>
    

     

    Final Notes

    I also found the Windows Azure Management Tool (MMC) to be of great assistance when needing to work with Queues.  It also has Blob support, but I’ve been using CloudBerry Explorer for Azure Blob Storage for uploading blobs.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    323 views
  • Working with Windows Azure and CRM Online

    Posted on January 9th, 2010 mitch Print Print No comments

    One of my new ventures will be run on Windows Azure and store data in CRM Online. This will require that I use the Microsoft.crm.sdk.dll assemblies to communicate with CRM.

    Technically, there are four sets of these assemblies in the SDK:

    • One set for CRM On-premise
    • One set for CRM Online. 
    • 32-bit versions
    • 64-bit versions

    It turns out that Windows Azure is a 64-bit operating system.  Here is how I had to configure Visual Studio to properly generate my new web site:

    Platform Target

    This needs to be set to Any CPU, which will create code that can be run on either 32-bit or 64-bit operating systems.

     

    Microsoft.crm.sdk.dll Assemblies

    You need to reference the 64-bit assemblies.  Otherwise, you’ll end up with the yellow screen of death and a message about unable to load assembly because of an invalid format.

     

    I hope that helps.  Good luck with your own Azure development

    Azure, CRM Online, Development, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    401 views