All posts in Microsoft Azure

Protected: ITPro|DevConnections 2014

Categories: DotNetZone, Events, Microsoft Azure
Enter your password to view comments.

This content is password protected. To view it please enter your password below:


This session is so awesome, I just had to post it here so that I can play it over and over again…
What great times are we living…


Two days left for AzureConf 2014, if you haven’t registered for it yet now is the time to do it.

On October 21st, 2014, Microsoft will be hosting AzureConf, another free event for the Azure community. This event will feature a keynote presentation by Scott Guthrie, along with numerous sessions executed by Azure community members. Streamed live for an online audience on Channel 9, the event will allow you to see how developers just like you are using Azure to develop robust, scalable applications on Azure.

Community members from all over the world will join known speakers such as Michael Collier, Mike Martin, Rick Garibay, and Chris Auld in the Channel 9 studios to present their own inventions and experiences. Whether you’re just learning Microsoft Azure or you’ve already achieved success on the platform, you won’t want to miss this special event.

 


The Microsoft Azure Storage Team released their latest Azure Storage Client Libraries and Tools which now supports accessing the Azure Storage from Portable libraries which in turn means that you are now able to access Azure store from Window 8 phone and Metro style applications directly.

Following are some of the new features and highlights:

Azure Storage SDK for .NET v4.3.0
Added support for building Universal and Windows Runtime based Windows Phone applications.
Updated OData dependencies to v5.6.2 and Newtonsoft.Json dependency to v5.0.8
Readme | changelog

Azure Storage SDK for Python v0.8.4
Fixed the issue of incorrect content type on blob
Readme | changelog | [supports REST API protocol version: 2012-02-12]

Azure XPlat CLI v0.8.1
Readme | changelog
Added additional commands for working with File/Table/Queue and Blob Service (visit the changelog for a full list).
Added SAS support for storage container/blob/table and queue
Switched storage library to Azure storage module

Documentation
Monitoring, Diagnosing and Troubleshooting Guide | Link
PowerShell Storage cmdlets Documentation | Link


Today the Azure Media Services team announced a new tool, namely the Azure Media Services Explorer Tool.

The Azure Media Services Explorer Tool is a Windows Forms tool based on the Azure Media SDKs that can be used by non-developers to test media workflows, monitor activities on their Azure Media Services accounts, or do just about anything that the full API allows you to do today without writing a line of code.

capt1

You can find the installation package on http://aka.ms/amse.

What’s even better is that the full source code for this tool is published to GitHub which can really help you better learn the APIs and integrate features into your own applications.

Summary of features

Asset upload/download/management

  • Asset upload from files, folder, in batch mode, with a watch folder
  • Asset import from Azure Storage or from any http source
  • Asset download to local, and export to Azure Storage
  • Asset files management (upload or delete) within an existing asset
  • Duplicate/merge assets

Process assets

  • Encode with Azure Media Encoder (standard and custom presets, video stitching, audio or video overlay, etc)
  • Extract keywords and TTML caption files with Media Indexer
  • Generate thumbnails for your existing assets
  • Call any Media Processor generically
  • Manage jobs (progress, priority…)
  • List all available processors in your account

Live streaming

  • Enable live channels and programs (creation, start, stop, delete, reset)
  • Live preview playback, program playback

Publish assets

  • Dynamic encryption setup (AES, Common Encryption) and key/license delivery service
  • SAS and streaming locators creation/deletion
  • Playback assets with web based players (Silverlight, Flash, HTML5/Dash)
  • Manage streaming endpoints management (creation, deletion, settings)

Display and reporting

  • Display detailed information on assets (locators, protection), jobs (tasks), live channels, programs, streaming endpoints
  • Send email report for jobs and assets
  • Links to players and online documentation, and offline help file for Media Services

Note: you can select multiple assets, jobs, channels or programs for some features.

Read more about the new tool from here


image_thumb33Last month I had the opportunity to speak at a Microsoft event about best patterns and practices of Microsoft Azure development.

Today I noticed that most of the things we talked about at the event is included in a very nice book available for free from Microsoft Press:  “Patterns & Practices: Cloud Design Patterns”. So if you’re interested on how to build your software for Microsoft Azure this is a very nice starting point.

Containing twenty-four design patterns and ten related guidance topics, this guide articulates the benefit of applying patterns by showing how each piece can fit into the big picture of cloud application architectures. It also discusses the benefits and considerations for each pattern. Most of the patterns have code samples or snippets that show how to implement the patterns using the features of Windows Azure. However the majority of topics described in this guide are equally relevant to all kinds of distributed systems, whether hosted on Windows Azure or on other cloud platforms.

Additionally, there is sample code:

The example applications for use in conjunction with Cloud Design Pattern guide. It consists of 10 samples to show how to implement design patterns using the features of Windows Azure.
See the Readme for information about the sample code. Each sample has a corresponding readme for information about how to run the sample.
Note: The samples are simplified to focus on and demonstrate the essential features of each pattern. They are not designed to be used in production scenarios.

 


With Global Windows Azure Bootcamp only a few days away I just received confirmation of all the things we’re going to be giving away this Saturday and I must say that the list is long and contains a lot of interesting oferings from our sponsors.

MyGet http://www.myget.org/ Every attendee gets 2 free months1 winner at each location win a 1 year subscription
JetBrains http://www.jetbrains.com/ 1 winner at each location win a free personal license to one of JetBrain’s .NET Products or IDEs (their choice) See www.jetbrains.com for a list, or it is included in the giveaway slides.
Blue Syntax http://www.bluesyntax.net 3 winners at each location win an Enterprise license to Enzo Cloud Backup
Infragistics http://www.infragistics.com/ 1 winner at each location win a Infragistics Ultimate License
Opsgility http://www.opsgility.com/ 1 winner at each location wins a voucher (up to $200) for an online course.
Cerebrata http://www.cerebrata.com/ 5 winners at each location win a license to Azure Management Studio
CloudBerry http://www.cloudberrylab.com/ 5 winners at each location win a license of their choice to CloudBerry Drive, Explorer Pro or Backup
Paraleap https://www.paraleap.com/ Every attendees gets 1 free month of Azure Watch
CODE Magazine http://www.codemag.com/magazine/ Every attendee gets a digital copy of the March/April issue of CODE MagazineEvery attendee gets 1 year free digital subscription to CODE Magazine
Zudio https://zud.io/ Every Attendee gets 6 months free
Stackify http://www.stackify.com/ Every attendee gets 1 free license. Install it and get a TShirt sent to you.
Wintellect Now! http://www.wintellectnow.com/ Every attendee gets a 2 week subscription. If they register before April 25th they can get a 50% discount.
FacetFlow https://facetflow.com/ Every attendee gets 2 free months when they sign up past the trial.
Appveyor http://www.appveyor.com/ Every attendee gets 2 free months with the purchase of any plan.

And that’s not all… register and find out what the big prize of GWAB Greece is…


It was only last week, when I talked about Windows Azure mobile services in a www.dotnetzone.gr event at Microsoft, that I argued about the need business logic – data store separation and it seems that ScottGu might have been listening Smile

Today ScottGu announced a bunch of major ultra cool new features for Windows Azure Mobile Services which are:

  • Custom API support
  • Git Source Control support
  • Node.js NPM Module support
  • A .NET API via NuGet
  • Free 20MB SQL Database Option for Mobile Services and Web Sites
  • Android Broadcast Push Notification Support

If you want to find more about how these new features work visit ScottGu’s blog post or drop by next week at the TechEd Europe expo to show you Winking smile

I’ve got only one more thing to say, if you’re a mobile app /windows 8 developer you should definitely have a look …


As you may have already read, a couple of months back I migrated my blog to Windows Azure WebSites and changed my blog engine to WordPress. The WordPress gallery template comes with a MySQL database 20MB free offer from ClearDB which was more than I needed (or so I thought) so I went alone and used it.

Lately though I”ve been experiencing a strange behavior, at undeterminable intervals my changes stopped being persisted at the database. After getting in contact with the ClearDB guys, I learned that the problem was that the MySQL engine was generating temp tables in order to facilitate the queries being made to it and the size of the data in these tables was greater from my quota leading to a block. The conversation reached a point where the ClearDB guy said

…I”m sorry for the inconvenience. If you”re not able to optimize your queries, and I gather that you”re using a stock WordPress install, the solution is simply to upgrade to the next service tier… (You can read the full transcript here)

I got so frustrated by this that I decided to investigate if moving to SQL Azure was an option and guess what… you can easily use SQL Azure with your WordPress Azure WebSite here”s how.

webmatrix

Step 1

Create a new WordPress site using WebMatrix localy by clicking new and selecting App Gallery from the menu.

Step 2

Download WP Db Abstraction. This plugin provides db access abstraction and SQL dialect abstraction for SQL Server. It is an mu (Must-Use) plugin AND also a db.php drop-in.

Step 3

Put the wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins.  This should be parallel to your regular plugins directory.  If the mu-plugins directory does not exist, you must create it. Put the db.php file from inside the wp-db-abstraction.php directory to wp-content/db.php. Rename the wp-config.php file in the root folder to wp-config_old.php since this is going to be written by the setup wizard at a later step.

Step 4

Publish your newly created WordPress site to an empty Azure WebSite slot.

Step 5

Create a new SQL Azure database

Step 6

Once the site is published visit http://your_wordpress_url/wp-content/mu-plugins/wp-db-abstraction/setup-config.php to generate your wp-config.php file and follow the instructions to connect WordPress with the database you created in the previous step. In the database type field you’ll have to select BDO_SQL as the type to connect to SQL Azure. Note that WordPress should be able to connect to the database otherwise you”ll get an error.

Step 7

Complete the normal WordPress installation

Step 8

There is a known bug in the  WP Db Abstraction that causes your posts and media files to not appear in their corresponding lists in the admin. You can read more about it here. So you’2015-04-28 07:02:14’ll have to edit the function is translate_limit in the wp-db-abstraction/translations/sqlsrv/translations.php file

// Check for true offset
if ( (count($limit_matches) == 5  )  && $limit_matches[1] != ''0'' ) {
    $true_offset = true;
} elseif ( (count($limit_matches) == 5 )  && $limit_matches[1] == ''0'' ) {
    $limit_matches[1] = $limit_matches[4];
}

The “$limit_matches” returns 6 items and in a validation is asking for 5 that”s all.

// Check for true offset
if ( (count($limit_matches) == 5  )  && $limit_matches[1] != ''0'' ) {
    $true_offset = true;
} elseif ( (count($limit_matches) >= 5 )  && $limit_matches[1] == ''0'' ) {
    $limit_matches[1] = $limit_matches[4];
}

just change the == for a >= and it works like a charm.

If you already had a WordPress installation like I did then you can easily migrate your data to your new SQL Azure backed installation. You just export all your data from you old site and import them to the new one.

Now, with half the price (4.99$ per month) of what I would have had to pay ClearDB to upgrade to the next service level I”ve got all the space I”ll ever going to need (up to 100MB) and all available for my data not temp.


In Part 1 of this series I’ve shown you how easy it was to build my Google Reader backing service using Windows Azure Mobile Services. In this part I’ll show you how I put that service to work using a Windows 8 client application and how I managed my data with it.

The client application I had been using with Google Reader so far was Modern Reader and I must admit that I got quite fond and used to it. So I’ve decided to build something similar, a Windows 8 application that would connect and sync with my newly created service. So I fired up Visual Studio and using the new Widows 8 application wizard I’ve created my client.

Now, from the Windows Azure Mobile Service tab you can get detailed instructions on how to connect your existing applications to the service or even download an already hooked to the service project for all the available platforms.

instructionsSo the first thing I did once my application had been created was to connect it with my mobile service. So I first imported the Windows Azure Mobile Services nuget package to get the necessary assemblies to my project (instead of installing the sdk) and then added a static member to my App class to allow easy access to my service as the guide suggests.

public static MobileServiceClient MobileService = new MobileServiceClient(
    "https://cloudreader.azure-mobile.net/", 
    "YOUR_MOBILE-SERVICE-KEY");

Having hooked my app with my CloudReader mobile service, I needed a way to manage (add/remove) and import my feeds. As mentioned earlier in my previous post I already had downloaded my data from Google Reader, so I had an OPML formatted xml file that contained all my subscriptions, so I needed some UI to help me pick that file, parse it and save my subscription data to my service. I thought that the best place for this UI was probably a custom fly out spawned by the settings charm bar like the Clasic RSS app does. So using the new Page wizard from visual studio I’ve created a Settings Flyout page and added a few controls to help my pick up the OPML file (DISCLAIMER I’m not a designer so the UI I’ve created is probably not the best you’ve seen but it gets the job done. We’ll talk about design more extensively in the last post of this series). The resulting UI looked something like that:

SettingsFlyout

In order to save some space in this post I will post the full xaml source code of this page as well as any other page of my solution at the end. To hook it up with the settings charm all I had to do was to handle the CommandsRequested event for the current view immediately after the window activation.

SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;

Then on the event handler I instanciated a new UICommandInvokedHandler and provided a IUICommand to be called when this handler was selected.

void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    UICommandInvokedHandler handler = new UICommandInvokedHandler(OnSettingsCommand);

    SettingsCommand generalCommand = new SettingsCommand("FeedsId", "Feeds", handler);
    args.Request.ApplicationCommands.Add(generalCommand); 
}

The OnSettingsCommand, in turn, created a new popup at runtime set its child control to be the settings flyout page I had already created and then opened it using some transitions.

void OnSettingsCommand(IUICommand command)
{
    // Create a Popup window which will contain our flyout. 
    settingsPopup = new Popup();
    settingsPopup.Closed += settingsPopup_Closed;
    Window.Current.Activated += Current_Activated;
    settingsPopup.Width = settingsWidth;
    settingsPopup.Height = Window.Current.Bounds.Height;

    // Add the proper animation for the panel. 
    settingsPopup.ChildTransitions = new TransitionCollection();
    settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
    {
        Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
               EdgeTransitionLocation.Right :
               EdgeTransitionLocation.Left
    });

    // Create a SettingsFlyout the same dimenssions as the Popup. 
    SettingsFlyout mypane = new SettingsFlyout();
    mypane.Width = settingsWidth;
    mypane.Height = Window.Current.Bounds.Height;

    // Place the SettingsFlyout inside our Popup window. 
    settingsPopup.Child = mypane;

    // Let's define the location of our Popup. 
    settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? 
        (Window.Current.Bounds.Width - settingsWidth) : 0);
    settingsPopup.SetValue(Canvas.TopProperty, 0);
    settingsPopup.IsOpen = true; 
}
Now all I had to do to complete my feed management / importing was to actually write the code for it in my settings flyout page. Since I didn’t want my code to be coupled with the page though I’ve decided to use MVVM. So I used nuget again to import MVVM light and created a ViewModel for my settings flyout page.
The ViewModel code was pretty straight forward, I used 2 commands that were triggered by the buttons on my UI to call the ImportFeeds method which in turn handled all the business logic.
public class SettingsViewModel : NavigationViewModel
 {

     public SettingsViewModel()
     {
         ////if (IsInDesignMode)
         ////{
         ////    // Code runs in Blend --> create design time data.
         ////}
         ////else
         ////{
         ////    // Code runs "for real"
         ////}
     }

     private StorageFile _selectedFile;
     public StorageFile SelectedFile
     {
         get { return _selectedFile; }
         set
         {
             _selectedFile = value;
             RaisePropertyChanged("SelectedFile");
         }
     }

     private RelayCommand _OpmlSelectCommand;
     public RelayCommand OpmlSelectCommand
     {
         get
         {
             return _OpmlSelectCommand
                 ?? (_OpmlSelectCommand = new RelayCommand(async () =>
                     {
                         var filePicker = new FileOpenPicker();
                         filePicker.FileTypeFilter.Add(".xml");
                         filePicker.ViewMode = PickerViewMode.List;
                         filePicker.SuggestedStartLocation = PickerLocationId.Downloads;
                         filePicker.SettingsIdentifier = "OPML Picker";
                         filePicker.CommitButtonText = "Select File";

                         SelectedFile = await filePicker.PickSingleFileAsync();
                     }));
         }
     }

     private RelayCommand _ImportFeedsCommand;
     public RelayCommand ImportFeedsCommand
     {
         get
         {
             return _ImportFeedsCommand
                 ?? (_ImportFeedsCommand = new RelayCommand(async () =>
                     {
                         if (SelectedFile != null)
                         {
                             var stream = await FileIO.ReadTextAsync(SelectedFile);
                             var opml = XDocument.Parse(stream);
                             if (opml != null)
                             {
                                 ImportFeeds(opml);
                             }
                         }
                     }));
         }
     }

     private async void ImportFeeds(XDocument opml)
     {
         foreach (var item in opml.Descendants("outline").Where(el => el.Attribute("xmlUrl") == null))
         {
             var feedGroupTable = App.MobileService.GetTable<FeedGroup>();
             var feedFolder = new FeedGroup()
                 {
                     Text = item.Attribute("text").Value,
                     Title = item.Attribute("title").Value
                 };
             await feedGroupTable.InsertAsync(feedFolder);

             foreach (var fds in item.Descendants("outline").Where(el => el.Attribute("xmlUrl") != null))
             {
                 var feedTable = App.MobileService.GetTable<Feed>();
                 var newFeed = new Feed()
                 {
                     FeedGroupId = feedFolder.Id,
                     FeedType = 1,
                     HtmlUrl = fds.Attribute("htmlUrl").Value,
                     Text = fds.Attribute("text").Value,
                     Title = fds.Attribute("title").Value,
                     XmlUrl = fds.Attribute("xmlUrl").Value
                 };
                 await feedTable.InsertAsync(newFeed);
             }

         }
     }

 }
The only interesting part in this piece of code is how easy it was to actually save my subscriptions to my database through my Windows Azure Mobile Service. All it took was two lines of code first I had to get a reference to my table using the call
var feedGroupTable = App.MobileService.GetTable<FeedGroup>();
and then I called
await feedTable.InsertAsync(newFeed);
for every feed in my subscriptions OPML formatted xml file.Now that my feeds were safely stored in my database I had to find a way to download news for each feed.
Stay tuned to read, in part 3 of this series how I wrote my server side code to read news for my stored subscriptions.