Reading Notes #63

Seattle

This week a little bit less of notes since I went to the Windows Azure Global Summit at Seattle, where I met many interesting persons. A lot of amazing things are coming for Windows Azure... but this is for another post!  



Cloud

[…] Read this getting started tutorial to walkthrough how you can build (in less than 5 minutes) a simple Windows 8 “To-do List” app that is cloud enabled using Windows Azure Mobile Services. Or watch this video of me showing how to do it step by step.[…]

Programming


Miscellaneous




    Reading Notes #62

    Cloud
    Programming
    […]Read this getting started tutorial to walkthrough how you can build (in less than 5 minutes) a simple Windows 8 “To-do List” app that is cloud enabled using Windows Azure Mobile Services. Or watch this video of me showing how to do it step by step.[…]
    Miscellaneous


    Reading Notes #61

    ninja_solo
     
    [This week, the image is provided by Marc Gagné @marc_gagne, a Windows Azure Ninja.]
    Cloud

    Programming

    Miscellaneous





    Reading Notes #60

    5091313_700bCloud
    […]Read this getting started tutorial to walkthrough how you can build (in less than 5 minutes) a simple Windows 8 “Todo List” app that is cloud enabled using Windows Azure Mobile Services. Or watch this video of me showing how to do it step by step. […]

    Programming
    […] 9% of all men are color blind. Use vischeck.com to check how your site or web app looks to those people. […]

    Miscellaneous



    Reading Notes #59

    www.SonicAgile.com

    Cloud

    Programming

    Miscellaneous
    • Three cool things to try with your old netbook - Good idea that I also try with my Asus EeePC 701. The Ubuntu Netbook is also a really good option, you will be able to watch all the movies you want, have access to your Wi-Fi network and browse Internet.
    • Your words are wasted (Scott Hanselman) - Nice post that nails the idea where all developer should have a blog, blog more and doing it on their own controlled domain.
    • Scrum in 5 Minutes - Really nice post that describe very clearly the basic concepts and roles involve in Agile. It also suggests a book for more detailed explanations and a tool AgileSonic that looks gorgeous. A post to read.
    “The problem is that writing code is much more like Finding a Cure for Cancer than Building a Brick Wall.”




    Reading Notes #58

    clip_image002
    Ahhhhhhhhh! That was great! I was in vacation enjoying family time.

    I read two no-technical books
    • Catching Fire – The Hunger Games book 2 (Suzanne Collins) – Great book!
    • Confessions of a Freelance Penmonkey (Chuck Wendig) – In this book you will found a lot of the really good post about writers… The style is different I and liked it!
     
     


    And of course I have some reading notes that I didn’t publish before I went to vacation:

    Cloud
    Programming
    Miscellaneous

    ~Frank










    Azure Tools Belt: Auto-scaling Application Block – WASABi

    One of the questions that clients often ask is: What tools could be used for Windows Azure development. Everyone knows that you need a web browser and a code editor (ex: Visual Studio), but what else? So, I decided to do a serie of posts to present them. This second post is about the Auto-scaling Application Block or WASABi for friends.

    This serie is not meant to be an exhaustive list of all tools. Some other excellent tools are surely available. If you think I have forgotten one or want me to talk about one, let me know. I will be more than happy to adding it to the list.

    Already in the Azure Tool Belt:

    What is WASABi?

    To achieve elasticity until now, you needed to do it manually through the Azure management portal or writing your own code using the REST API. Using Wasabi, you just need to define some rules and the application will scale automatically: It can use a schedule or can be triggered by metrics, for example running fewer instances at night or adding extra instances if the CPUs are used at more than 80%.

    The auto-scaling application block can be hosted either in a Windows Azure role or in an on-premises application. The auto-scaling application is typically hosted in a separate application from the target application that you want to scale.

    Various scenarios are available to help you manage the auto-scaling by dynamically changing instance counts or performing application throttling of web/worker roles. The rules can auto scale based on timetables or metrics collected from the application and/or Windows Azure. You can even use notifications to preview any scaling operations before they take place and you can also use some PowerShell cmdlets to manage the autoscaler. You can constrain the auto scaling by:
    • Setting the instance counts upper and lower bounds
    • Preventing fast oscillations in the number of role instances with the stabilizer
    • Limiting scaling operations acknowledging billing hours

    How to use it

    For this demo we will use a simple Hello word application and scale it with a rule via a console application based on time.


    Step 1: Put the app in Azure

    clip_image001[4]To get started an Azure application is needed. Don’t forget to assign a certificate since the console application will need it.

    You can then publish the application on the cloud.





    Step 2: Adding the scaling application

    clip_image002[4]Now create a console application and name it AutoScalingConsole. Add the WASABi package by executing: Install-Package EnterpriseLibrary.WindowsAzure.Autoscaling.
    It should run without error and your Solution should look like this.







    Step 3: Add and configure the rules

    Add a new file call Rules.xml and set the property Copy to Output Directory: Copy always. Copy-paste this xml into the rules file.
    <?xml version="1.0" encoding="utf-8" ?>
    <rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules">
      <constraintRules>
        <rule name="default" enabled="true" rank="1" description="The default constraint rule">
          <actions>
            <range min="1" max="1" target="AutoscalingApplicationRole"/>
          </actions>
        </rule>
        <rule name="peaktime" enabled="true" rank="10" description="Increase instance count at peak times">
          <timetable startTime="20:00:00"  duration="00:20:00" />
          <actions>
            <range min="2" max="4" target="AutoscalingApplicationRole"/>
          </actions>
        </rule>
      </constraintRules>
    </rules>
    

    It contains two rules: A default one that is always active, defining minimum and maximum instance counts of 1, and a second one used for scaling. The variable “Is rank” with a value of one means that it can be overridden by other constraint rules with a higher rank. . Naturally, if that rule is applied, there will be only a single instance of the role.

    The second rule is named peaktime. This rule has the same target, a higher rank, a minimum value of two, a maximum value of four. Also a timetable makes the rule active for 20 minutes, starting at 10 minutes from the current time.

    Step 4: Define the service model

    You will now add a new xml file called services.xml and set the property Copy to Output Directory: Copy always. Copy-paste this xml into the services file.
    <?xml version="1.0" encoding="utf-8" ?>
    <serviceModel xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
    
      <subscriptions>
        <subscription name="[yoursubscriptionname]"
                      certificateThumbprint="[yourmanagementcertificatethumbprint]"
                      subscriptionId="[yoursubscriptionid]"
                      certificateStoreLocation="CurrentUser" certificateStoreName="My">
          <services>
            <service dnsPrefix="[yourhostedservicednsprefix]" slot="Staging">
              <roles>
                <role alias="AutoscalingApplicationRole" roleName="AutoscalingApplicationRole" wadStorageAccountName="elazurehol"/>
              </roles>
            </service>
          </services>
          <storageAccounts>
            <storageAccount alias="elazurehol"
                            connectionString="DefaultEndpointsProtocol=https;AccountName=[yourstorageaccountname];AccountKey=[yourstorageaccountkey]">
            </storageAccount>
          </storageAccounts>
        </subscription>
      </subscriptions>
    </serviceModel>

    In this file, make the following changes:

    Replace [yoursubscriptionname] with the name of your Windows Azure subscription and [yoursubscriptionid] with your Windows Azure subscription ID.
    clip_image001

    Replace [yourmanagementcertificatethumbprint] with your Windows Azure management certificate thumbprint.
    clip_image002

    Replace [yourhostedservicednsprefix] with the URL prefix of your Windows Azure hosted service.

    Replace [yourstorageaccountname] with your Windows Azure storage account name and [yourstorageaccountkey] with your Windows Azure storage account primary access key.
    clip_image003

    Step 5: Configure the Auto-scaling Application Block

    Right-click on the App.config file in Solution Explorer, add one if needed, then click Edit Configuration File. In the Blocks menu, click Add Autoscaling Settings. Now set the rules.xml and services.xml as sources for Rules Store and Service Information Store. Via the File menu, Save then Exit.

    wasabidemo_4

    To by able to track evolution of the the testing let’s add some logging.  In Visual Studio, double-click on the App.config file to open it in the editor. Then add this system.diagnostics at the end of the file:
    <system.diagnostics>
       <sources>
          <source name="Autoscaling General"  switchName="SourceSwitch" switchType="System.Diagnostics.SourceSwitch" />
          <source name="Autoscaling Updates"  switchName="SourceSwitch" switchType="System.Diagnostics.SourceSwitch" />
       </sources>
       <switches>
          <add name="SourceSwitch" value="Verbose, Information, Warning, Error, Critical" />
       </switches>
    </system.diagnostics>

    Step 6: Try it

    You can now run the console application and observe how the auto-scaling rules work with the Azure application. Check the Output window in Visual Studio that logs which rules are being matched.


    Conclusion

    Using Wasabi makes your application elastic but doesn’t make your application scalable you must therefore design for scalability. If you have any comments, suggestions or experiences to share, feel free to let me know by adding a comment, by e-mail or by the contact page.
     

    Where to find More info?


    Note:


    ~Frank


    Reading Notes #57

     
    “Cloud Book Study” by Heidi Neilson
    Cloud
    Check out the paper.

    Programming

    Miscellaneous

      ~ Frank


      Reading Notes #56

      Azure_features
      Cloud

      Programming

      Miscellaneous
      […]And the user exclaimed with a snarl and a taunt, “It’s just what I asked for, but not what I want!” That was 30 years ago, and I doubt the poem was new then.[…]

        ~Frank


        Azure Tools Belt: SQL Azure Migration Wizard


        One of the questions that clients often ask is: What tools could be used for Windows Azure development. Everyone knows that you need a web browser and a code editor (ex: Visual Studio), but what else? So, I decided to do a serie of posts to present them. I’m therefore beginning with the indispensable SQL Azure Migration Wizard, since it’s used more often at the beginning of a project.

        This serie is not meant to be an exhaustive list of all tools. Some other excellent tools are surely available. If you think I have forgotten one or want me to talk about one, let me know. I will be more than happy to adding it to the list.

        What is SQL Azure Migration Wizard?

        Most of the Azure projects that are starting these days are migration project or at least contain some data migration. The SQL Azure Migration Wizard, like its name implies , is a tool that will take you be the hand and help you migrate your database. In a few clicks the wizard will bring the database schemas and the data to the cloud.

        Because Azure SQL database is very similar, but not totally compatible to Windows SQL Server 2008,the Wizard will also provide you a list of things that you should take care of like a missing clustered key.

        How to use it

        First, I will assume that you already have an active Azure account, if you don’t, please follow the instructions on this web page. Then of course you will need the SQLAzureMW tool that you can download on the CodePlex page project. Let’s do a simple migration from a local database to SQLAzure.

        clip_image001[1] To get started, just double-click on the executable.
        Some options will be proposed, but in our case we need to select: Analyse / Migrate SQL Database (second choice from the top)
        clip_image002[1] Then pick your source. One nice thing with keeping the Master database selected, the list of all available databases on the specified server will be populated. Once you are done, click the Connect button.
        clip_image003[1] The database used in this demo is a subset of Northwind database with three tables: Products, Suppliers, and Categories.
        Once you have selected what you wanted to migrate, click the Next button.
        clip_image004[1]
        clip_image005[1]
        Here three outputs are generated:
        1. A result Summary: This explains all the steps made to extract the schemas and data of the database. The analysis will also highlight some incompatibilities and suggest some modifications. In this case, since I have not added any primary keys or indexes, it warned me that a clustered index will be added.
        2. SQL Script: A nicely written database creation script that you can save for maintenance.
        3. Data file: Since one of the best way to import massive data in AzureSQL database is by using BCP, some data files have been prepared to be imported.
        Click the Next button to continue.
        clip_image006[1] For the next step you will need a database server in Azure. So connect to the Azure portal, and from the left panel select Database.
        You can than create a new server by clicking the Create button. You could also use a server that you already have.
        Put the server name in your clipboard you will needed.
        clip_image007[1] Back to our SQLAzureMW, paste the full name of the server in the Server name dropdown. It should be something like xxx.database.windows.net
        Then enter the credentials of your SQL server. Note that the username should be follow by “@” and the first part of the server name.
        Click Connect when you’re done.
        clip_image008[1] Since no database was created, the list is empty. Let’s create a new database by clicking the Create Database button.
        A popup window will ask for the name, location and format of the database to be created.
        Click Create Database, and after few seconds you should be able to click the Next button to continue.
        clip_image009[1] To see that the new database is really created go on the AzurePortal: you will see it in the database section.
        clip_image010[1] After a quick confirmation the migration will be done.
        A Nice summary is displayed so you can see if something went wrong.
        The migration has been performed successfully, click Exit.
        clip_image011[1] You can now connect to the new database by SQL Server Management Studio or by the Azure Management Portal.
        You can see that the three tables are there and the data has also been migrated.
        clip_image012[1] Like it was supposed to, the index was successfully created. This is really magic!


        Conclusion

        To conclude, let’s say that this tool is really fantastic and that you should definitely try it if you are planning to do a migration. It will save you a lot of time. Please note that the SQLAzureMW does not manage logins and users. I therefore strongly suggest using the Azure User Management Console – AUMC, available on CodePlex.

        If you have any comments, suggestions or experiences to share, feel free to let me know by adding a comment, by e-mail or by the contact page. Next post is about the Windows Azure Auto-scaling Application Block (WASABi)


        ~Frank


        References

        Reading Notes #55

        Ruby_in_AzureCloud

        Programming

        Miscellaneous


        ~Frank



          Reading Notes #54

          Web Sites or Cloud Apps
          Cloud
          Programming
          Miscellaneous
          • Defend Your Sweet Spot (Peter) - Interesting post by Peter Bregman, the author of 18 minutes, that explains why finding and keeping your sweet spot is important.
          […] time management isn’t primarily about using minutes well, it’s about using yourself well.[…]

          ~Frank