Posts

Showing posts from 2011

Unit Test Initialization and Cleanup for Windows Azure Storage Emulator

My unit tests add and delete entities from local Windows Azure dev storage,  at their most basic. If the Azure Storage emulator isn’t started, the tests don’t fail quickly – they just sit there acting like the test framework is hung. In order to ensure that the tests proceed, I needed to make sure the emulator was started before the tests ran.   I started with code found in this thread on StackOverflow . I needed to make sure the Storage Emulator is started before the test classes are called and that the emulator is shut down when the tests are done. I wrote this class and added it as a separate file to my test assembly.   More information about CSRun.exe and the Process class are available in MSDN .   // ----------------------------------------------------------------------- // <copyright file="AssemblySpecific.cs" company="BerryIntl"> // Berry International 2011 // </copyright> // -----------------------------------------------------

Simple Azure Web and Worker Roles–Running the code

Image
This is a continuation of the simple series. Links for other posts in the series are at the bottom of this post. Download Visual Studio Solution here .   This series explains the Windows Phone 7 requesting data from a Windows Azure web service. The phone tile and toast are supported by a background agent on the phone while the web service is supported by a continuous worker role on Windows Azure. The phone calls the WebRole REST API from both the phone app and the phone app’s background agent. Each request is different though. The App’s request is fetching a list of items to show in the app while the background agent is fetching the count of items since the last fetch and the very last item. This information will be displayed in the popup toast and the app’s start screen pinned tile.   Azure Only This post will cover the Azure web  and worker roles only. The Windows Phone 7 app-to-Azure communication will be covered in a separate post. Grab the Visual Studio solution ava

Simple WP7 Mango App for Background Tasks, Toast, and Tiles: Code Explanation

Image
This is a continuation of this post , explaining how the sample app works. Caution : This sample isn’t meant as an example of best patterns and practices. If you see something in the code you would never do, then don’t. Solution File Organization The app has three Visual Studio Projects: the app, the agent, and the shared code library between them. One of the great things about Mango is that now the built-in Visual Studio Unit test functionality is available. By separating out the meat of the work into the SampleShared project, I can also focus my unit testing there. SampleApp1 The app has a MainPage, a ViewModel, and the WMAppManifest.xml file modified to note my ExtendedTask of BackgroundServiceAgent. The Agent is extremely simple with a call to the shared library, an update to the Tile, and a call to pop up Toast. The meat of the work is in the SampleShared library. The AgentMgr manages the background agent : add, remove, find, run now. It is only called f

A Simple WP7 Mango App for Background Tasks, Toast, and Tiles

Image
Download Binary and Code The .XAP binary and code solution are both available for download . The app uses a background process that does some work then updates the tile and pops up toast. The app and the agent talk to each other via an isolated storage file protected by a named mutex. The diagram below shows the pieces and how they work together. This is the app associated with this post . App/Agent Architecture The app and agent don’t actually talk to a web service as this is a sample but in a real world solution they both would. The app would do the heavy lifting. The agent would have a quick, light conversation with just enough information to update the tile and pop up toast with meaningful information. In this sample, you can configure the agent to run repetitively every minute, second, etc. This is usually done for debug/testing. In the usual release situation, the agent runs on the 30 minute cycle. Start the App Pin the App to the Start Screen Make sure to the pin th

Windows Azure Cache Tip: Use language change to refresh cache

Image
Several times using the Windows Azure Portal , the page has appeared to recycle correctly its 30 second refresh yet the process change I know reported success doesn’t show up. After a forum thread with a MS Support person, I learned to change the language setting at the top instead of log out and log in.   30 Second Refresh at the bottom left of the Browser Window     Change Language setting to refresh Portal Cache at the top right of the Browser Window

Reinstalling Purchased Windows Phone 7 Apps after Mango Update

I purchased Flux a while back (metro version) and it is my favorite RSS reader. When my phone updated to mango, Flux updated the day after. Flux has been rock solid but the mango version wouldn’t even get past the splash screen. While I could have tried rebooting the phone (turn off, take battery out, put battery back, and turn back on), I knew a fresh install would definitely fix the issue.   I uninstalled Flux then, no the phone, went to the Marketplace  and found it again and reinstalled. The interface didn’t say reinstall though, it said “buy.” This is completely misleading. Microsoft knows I purchased the app so I clicked on buy, knowing it really wasn’t a buy but instead a reinstall.   Find app in Marketplace . “Buy” app which is really just a reinstall. You aren’t charged again.

Windows Phone 7 and Windows Azure

Introduction This post will explain how Windows Phone 7 and Windows Azure relate to each other. This is in response to an email question I received over on my apps site. The person, apparently, had been assigned the task of “putting his rewards app on Azure.”   This post is a 100 level (introductory) explanation.   Client/Server Twenty years ago the client/server conversation was obvious with a physical client machine (perhaps a Windows version) connecting through a wire to a physical server. Usually these were in the same location or in some sort of private wide area network.  But they were just a client and a server.   Ten years ago the client/server conversation was a physical client machine connecting through a wire to a physical server that was not in the same building, probably not in the same state or country. But they were just a client and a server.   Since then, until Windows Phone and Azure, nothing really changed except the connection, which became wire

Windows Azure Phone Apps for Windows Phone 7

I’ve made two apps targeting Windows Azure developers, testers, and managers. If your company uses any Windows Azure products, you should take a look at the apps, WAZUp and WAZDash. WAZUp allows you to manage the Deployment status and WAZDash reports on recent service issues. If you would like to keep up with my Windows Azure apps, subscribe by RSS .

Ah, the joys of poor messages, brief documentation and faded memories!

Image
Today, I was at Hack Dev days in Vancouver, B.C. and enjoyed the group and the presentations. Two recent Uni-grads and I teamed up and proceeded to define a project and work away for most of the day.  We were using the TinEye.com API, specifically a collection of 10 million images from Flickr that they have in one of their libraries. We decided to create a Chrome Extension on the API (one of the other dev’s had done one of these recently).   It’s been 16 months since I have done any serious JavaScript/Ajax stuff, and that was (in hind-sight) unfortunately against the website where the pages were hosted…   The code that consumed most of the day… The code below should have been up and working in 15 minutes… < script type ="text/javascript"> var ApiUrl = 'http://piximilar-rw.hackdays.tineye.com/rest/' function myData() { var fd = new FormData(); fd.append( "method" , "color_search" );

Windows Azure Service Dashboard OPML Feed File

In case you don’t want to add all the RSS feeds on the Windows Azure Service Dashboard , I’ve created an OPML file you can import into your ( Google ) reader. The file is up on Windows Live Skydrive but in case you can’t get to that, the file contents are below. If you found I’m missing a link or the link has changed, please let me know.   <? xml-stylesheet type ="text/xsl" href ="http://www.microsoft.com/feeds/msdn_opmlpretty.xsl" version ="1.0" ? > < opml version ="1.1" > < head > < title > Azure Service Dashboard Feeds </ title > </ head > < body > < outline text ="AppFabric Access Control [East Asia]" title ="AppFabric Access Control [East Asia]" type ="rss" xmlUrl ="http://www.microsoft.com/windowsazure/support/status/RSSFeed.aspx?RSSFeedCode=NSACSEA" htmlUrl ="http://www.microsoft.com/windowsazure/support/status/servic