Monthly Archives: November 2014

Getting Started with Office 365 Video

Kloud Blog

Starting Tuesday November 18 Microsoft started rolling out Office 365 Video to customers who have opted in to the First Release programme (if you haven’t you will need to wait a little longer!)

Kloud has built video solutions on Office 365 in the past so it’s great to see Microsoft deliver this as a native feature of SharePoint Online – and one that leverages the underlying power of Azure Media Services capabilities for video cross-encoding and dynamic packaging.

In this blog post we’ll take a quick tour of the new offering and show a simple usage scenario.

Basic Restrictions

In order to have access to Office 365 Video the following must be true for your Office 365 tenant:

  • SharePoint Online must be part of your subscription and users must have been granted access to it.
  • Users must have E1, E2, E3, E4, A2, A3 or A4 licenses.
  • There is no…

View original post 423 more words

Use Azure Management API SDK in an Entity Framework custom database initializer

A post over on Stack Overflow got me thinking about how you can override the default behaviour of the Entity Framework code first database initializer so that the tier of the database created is something other than the deprecated ‘Web’ tier. Here’s one way to go about it.

Required bits

There are a few things to get going here – you’ll need to add the the Microsoft Azure SQL Database Management Library nuget package to your solution which will install a bunch of dependencies required to interact with the Azure Management API.

You should also familiarise yourself with how to create and use Management Certificates which will be required for all interactions with the Azure Management API.

Once you’ve looked through that I suggest having a good read of Brady Gaster’s blogs on using the Management API in which he gives some good overviews on working with Azure SQL Database AND on how you can go about uploading your Management Certificate to an Azure Website.

For the purpose of the remainder of this post we’ll be using the sample MVC / EF code first sample application which can be downloaded from MSDN’s code site.

Now you’ve done that, let’s get started…

Create a custom EF initializer

Entity Framework provides a nice extensibility point for managing initialisation of databases amongst other items (primarily to allow you to use the latest hipster database of choice and roll your own supporting code) and we’re going to use a simple sample to show how we could change the behaviour we’re seeing above.

In the below sample we create Standard tier databases – we could just as easily change this to a configuration element and modify which database we wish to create. Note that I load a lot of information from configuration – in the below sample I can deploy those configuration elements at the Cloud Service level and manage via the Azure Management Portal. I could just as easily leave them in the web.config if I wanted to.

A sample of what appears in the configuration (this is from a web.config)

    <add key="AzureSqlDatabaseServerName" value="t95xxttjmj"/>
    <add key="AzureSqlDatabaseName" value="SchoolDemo"/>
    <add key="AzureSubscriptionId" value="00000000-0000-0000-0000-000000000000"/>
    <add key="AzureSubscriptionCertThumbprint" value="61b463082dcb0198aab451c14efb7ff4b83a42b4"/>

In our global.asax of our web application we then need to include the following code:

Database.SetInitializer(new ContosoCustomDatabaseInitializer());

At this point when EF attempts to fire up a new database instance it will call our custom code and initialise a new database on the specified server using the management libraries.

Hopefully in a future release we’ll see an update to the default database setting to use the new Standard tier instead.

Tagged , , , ,

TechEd 2014: Azure API Management Talk now available.

For those of you who didn’t get a chance to come along to my presentation on Azure API Management at TechEd in Melbourne this year the session is now up on Channel 9. Slides to go along with the session are also available.


Tagged ,

An Octoberfest of blog posts

I’ve been busy through October writing over on the Kloud blog. Here’s the posts I authored if you want to check them out – there’s some good content in here that you will hopefully find useful!