MSDN Blogs
Blog of Microsoft's Eric L. Golpe         .NET Junkie


  • < Confessions of .NET Junkie Eric Golpe />

    Sync Framework Toolkit now Open Source!

    • 5 Comments

    I got a note today from Rob Tiffany, another one of our brilliant Microsoft Architects. (I saw another one, because I like to think I am as brilliant… [Note: I do work for Microsoft too.])

    Here’s Rob’s note:


    Sync Framework is an amazingly effective, provider-based framework for syncing just about anything, and in fact, is the basis for SQL Azure Data Sync.
    This release to Open Source will really benefit the community at large, and gives an opportunity for deep .NET developers to be involved with some great bits.

     

    The profound effects of the Consumerization of IT (CoIT) is blurring the lines between consumers and the enterprise. The fact that virtually every type of mobile device is now a candidate to make employees productive means that cross-platform, enabling technologies are a must. Luckily, Microsoft has brought the power to synchronize data with either SQL Server on-premise or SQL Azure in the cloud to the world of mobility. If you’ve ever synched the music on your iPhone with iTunes, the calendar on your Android device with Gmail, or the Outlook email on your Windows Phone with Exchange, then you understand the importance of sync. In my experience architecting and building enterprise mobile apps for the world’s largest organizations over the last decade, data sync has always been a critical ingredient.

     clip_image003SQL-Azure_rgb

    The new Sync Framework Toolkit found on MSDN builds on the existing Sync Framework 2.1′s ability to create disconnected applications, making it easier to expose data for synchronization to apps running on any client platform. Where Sync Framework 2.1 required clients to be based on Windows, this free toolkit allows other Microsoft platforms to be used for offline clients such as Silverlight, Windows Phone 7, Windows Mobile, Windows Embedded Handheld, and new Windows Slates. Additionally, non-Microsoft platforms such as iPhones, iPads, Android phones and tablets, Blackberries and browsers supporting HTML5 are all first-class sync citizens. The secret is that we no longer require the installation of the Sync Framework runtime on client devices. When coupled with use of an open protocol like OData for data transport, no platform or programming language is prevented from synchronizing data with our on-premise and cloud databases. When the data arrives on your device, you can serialize it as JSON, or insert it into SQL Server Compact or SQLite depending on your platform preferences.

     

    The Sync Framework Toolkit provides all the features enabled by the Sync Framework 4.0 October 2010 CTP. We are releasing the toolkit as source code samples on MSDN with the source code utilizing Sync Framework 2.1. Source code provides the flexibility to customize or extend the capabilities we have provided to suit your specific requirements. The client-side source code in the package is released under the Apache 2.0 license and the server-side source code under the MS-LPL license. The Sync Framework 2.1 is fully supported by Microsoft and the mobile-enabling source code is yours to use, build upon, and support for the apps you create.

    clip_image007clip_image009clip_image010clip_image012clip_image014clip_image016clip_image018clip_image020clip_image022

    Now some of you might be wondering why you would use a sync technology to move data rather than SOAP or REST web services. The reason has to do with performance and bandwidth efficiency. Using SOA, one would retrieve all the data needed to the device in order to see what has changed in SQL Server. The same goes for uploading data. Using the Sync Framework Toolkit, only the changes, or deltas, are transmitted over the air. The boosts performance and reduces bandwidth usage which saves time and money in a world of congested mobile data networks with capped mobile data plans. You also get a feature called batching, which breaks up the data sent over wireless networks into manageable pieces. This not only prevents you from blowing out your limited bandwidth, but it also keeps you from using too much RAM memory both on the server and your memory-constrained mobile device. When combined with conflict resolution and advanced filtering, I’m sold!

    I think you’ll find the Sync Framework Toolkit to be an immensely valuable component of your MEAP solutions for the enterprise as well as the ones you build for consumers.

    Enjoy!

    Eric

  • < Confessions of .NET Junkie Eric Golpe />

    New Azure Powershell Cmdlets now available.

    • 0 Comments

    Microsoft released a new version of the Windows Azure PowerShell Cmdlets out on CodePlex.
    http://wappowershell.codeplex.com/releases (2.0).

    To read up on the new functionality (and breaking changes), Michael Washam has provided a summary blog post:
    http://michaelwasham.com/2011/09/16/announcing-the-release-of-windows-azure-platform-powershell-cmdlets-2-0/

    There is a more detailed readme in the download, under the /docs directory when you install the Cmdlets, either as a Module, or a Snap-In.
    (I opted for the Module, myself.)

    Some of the cool things you can do include interacting with SQL Azure (Setting and removing firewall rules), Windows Azure Diagnostics, Windows Azure Storage (including Analytics) and expanded functionality over getting instance status, creating/deleting affinity groups, and creating new hosted services.  For example, just the ability to enumerate your storage accounts and get their properties are a huge win:

    Import-Module WAPPSCmdlets

    #Get your local certificate for authentication.
    #[Thumprint of Service Management API self-signed certificate in your certificate store.]
    $cert = Get-Item cert:\CurrentUser\My\57B6CEC1052AB24E9116C66DE7CAE24E78FE5BF0

    #SubscriptionID from Windows Azure Developer Portal
    $sub = 'f26e43b8-7496-44c6-8611-75771ef15854'

    #Enumerate Windows Azure Storage Services for this Subscription
    $abc = Get-StorageAccount -SubscriptionId $sub -Certificate $cert

    #Enumerate each storage accounts StorageAccountProperties
    foreach ($objA in $abc){
    Get-StorageAccountProperties -ServiceName $objA.ServiceName -SubscriptionId $sub -Certificate $cert
    }

    Gives you a nice enumeration of info you can utilize quickly:

    Description   : Eric Golpe XStorage Account
    AffinityGroup : Chicago
    Location      : North Central US
    Label         : EricGol XStore
    ExtensionData : System.Runtime.Serialization.ExtensionDataObject

    Description   :
    AffinityGroup :
    Location      : Southeast Asia
    Label         : eswat
    ExtensionData : System.Runtime.Serialization.ExtensionDataObject

    Description   : Silverlining Storage
    AffinityGroup :
    Location      : North Central US
    Label         : silverlining
    ExtensionData : System.Runtime.Serialization.ExtensionDataObject

    So, what are you waiting for? 
    Go-on and get the bits, install it, and fire-up the Windows PowerShell ISE and start power-scripting with Windows Azure!

    Have fun!
    Eric

  • < Confessions of .NET Junkie Eric Golpe />

    Deploying VM Roles with Affinity Groups (and the pain of VMRole development)

    • 0 Comments

    Quick tip: When setting up your Windows Azure Hosted Services, if your planning on using VMRole instances, with a base image tied to an Affinity Group, make sure your Hosted Service belongs to that specific Affinity Group.  
    I found out the hard way, sometimes some obvious deployments aren’t so obvious. Let me explain:

    I have a Affinity Group I named “Chicago”, which is specified to use only the “North Central US” Windows Azure datacenter(s).
    I then uploaded a base image for my VM Role, anchored to that Affinity Group using csupload.exe (You can use the Add-VMImage cmdlet’s –AffinityGroup switch for that.)

    I then created a Hosted Service, specifying “North Central US” as the location, rather than selecting the “Chicago” Affinity Group. 
    I figured, the same data center location, as the affinity groups datacenter location, would logically be the place here.  Makes sense, right?

    So, off to VS to deploy my services, and blam:

    12:28:50 AM - Preparing...
    12:28:50 AM - Connecting...
    12:28:52 AM - Uploading...
    12:29:35 AM - Creating...
    12:29:53 AM - HTTP Status Code: 400/nError Message: One of the specified images cannot be used for creating the deployment. When you want to create a deployment that is based on a machine image, one of the following constraints must be met: (1) the hosted service and the image belong to the same affinity group, or (2) neither the hosted service nor the image belong to an affinity group, but their location constraints are the same, or (3) the hosted service belongs to an affinity group and the image has a location constraint equal to the location constraint of the affinity group. Here are the details about the current deployment:Image ericgolbase.vhd belongs to an affinity group named ff338672-edb1-42ac-b996-c76d9caae20e, which is in location constraint North Central US.Hosted service office365 is not in an affinity group. Its location constraint is North Central US. /nOperation Id: afa4e7ee-af01-43eb-aa0e-202c64c7882b
    12:29:53 AM - Deleting O365
    12:29:54 AM - There was no endpoint listening at
    https://management.core.windows.net/f26e43b8-7496-44c6-8611-45441ef15854/services/hostedservices/office365/deploymentslots/Production that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
    12:29:54 AM - Deployment failed

    Yeah, ok. ::Rolling Eyes::  So, I was a bit frustrated I would have to tear down, and recreate my service.  Especially since I just got done uploading the service certificates I needed, and I didn’t want to have to wait to get any length of time to get my hosted services DNS name back on a re-create.  Lucky for me, the process went smooth and I could continue to chow my salad while I waited a couple minutes, and re-start the deployment.

    BTW, It also took me hours upon hours just to get my base image created this time around. Beware, this can be frustrating.
    In my case, I usually dual boot from my laptop, either to Windows 7 Enterprise, or to Windows Server 2008 R2. 
    I use Windows Server 2008 R2 for Hyper-V, and have my laptop setup to use a VHD for that OS, since I also use Bitlocker Encryption all around.
    (Bitlocker rocks BTW.. turning the laptop into a nice paperweight weighing a few kilos for anyone thinking of stealing a laptop, unless they invest in a hard drive and have the knowledge how to change the thing out.  Major deterrent.)

    My issue first was I couldn’t expand the VHD to boot into my OS, because I had run out of disk space (I have dual 120GB SSD drives too…). 
    After to cleanup with WinDirStat, and a portable USB (also bitlocker’ed.. ::evil chuckle:: ) I was back in business. [20 minutes spent.]

    Then, a bunch of OS updates and reboots. Great, now I could get to image creation.  [15 minutes spent.]
    I used my MSDN account, and dl’ed the latest Windows Server 2008 R2 media, which took about 15 minutes on my Cable Modem. [We’re up to 50 minutes.]

    Now I could get down to business:

    1) Create the VHD – check.

    2) Patch the VHD – check (with multiple reboots).

    3) Install the Integration Components (Guest Agent) for Windows Azure – check.

    4)  Install my apps – check.

    5)  Sysprep the VM – check.

    Finally ready to upload.  [I’m at 90 minutes, yes, 40 minutes longer due to all the patching, even with the latest SP2 image from MSDN.]
    Then, the upload.. 10.6GB, and, I had to –SkipVerify for some weird reason. [Add 3 hours, 46 minutes.] 
    Yes, over 5 hours to create a VMRole Image, and get it where it needs to be.  Sad smile 

    My hope is that over the course of the next year, some of the work our teams are doing will get this down to minutes, if not seconds, for our customers.

Page 1 of 1 (3 items)