F5debug white paper on windows azure media services


Published on

This white paper focuses on Windows Azure Mobile Services in real time and how effectively used to scale the mobile paltform

Published in: Technology
  • Be the first to comment

  • Be the first to like this

F5debug white paper on windows azure media services

  1. 1. Windows Azure Media Services By Karthikeyan Anbarasan Windows Azure Media Services is one of the much expected feature release by Microsoft recently, with this new service we can provide a media content over the cloud with feasible options to process, manage and deliver media with high quality. Windows Azure Media Services provides flexible and scalable option to build a high quality media content delivery across the application globally with ease. Using Windows Azure Media Services we can build a work flow end to end which manages the media and deliver with quality which includes Uploading, encoding, decoding, downloading, formatting, and streaming of media contents in different platforms and different devices. Media Services are provided with the rich REST API using which we can call the services individually in any external application and use it across the application development as per the requirement. Media Services are currently available in preview, with Go Live feature where we can on board the application without waiting for the beta or the main Production release. As per MSDN, below is the basic architecture of the Windows Azure Media Services which involves the components that are currently incorporated with the preview release. Windows Azure Media Services can use to format and encode the media content into different formats that fits the best in to the industry devices which plays different formats with different resolutions and different Bit Rates. Windows Azure Media Services in preview is limited with the features that are currently involved with, were Microsoft has planned a huge enhancements with the upcoming versions of F5debug.Net
  2. 2. the Media Services which includes Flash Integration, HTML5 base streaming etc. So let us wait and see how the Media Services are going to satisfy the Market necessities. Each and every workflow has a separate management flow and entities that are involved which plays a major role in the development life cycle, in Windows Azure Media Services Workflow we have 4 important operations which are core components use in the application development and the 4 components are as follows. S No Operation Description 1 Ingest This operation is used to bring the Assets to the system, which basically takes the version of the Assets which are encoded and formatted before uploading them to the Windows Azure Storage Services. 2 Process This operation is used where we need to encode, decode, transform, format and convert the media tasks into different operations. 3 Manage This operation is used to manage the Assets that are already uploaded to the Media Services where we can delete, upload, manage, edit the assets. 4 Deliver This Operation is the output task where we want the encoded and formatted media content to be out of the box with a Smooth Streaming or on Demand live streaming, or to download to a specific medium. We can use the Windows Azure Media Services to be access programmatically through REST API’s where we have several objects that are used to perform the operations which basically we call as Entities. Below are the lists of entities that are used with the Media Services Operations. S No Entity Description 1 Asset Assets are basically a file which holds the metadata for the Media content which we upload or encode it to the Media Services. Asset plays a major role where we do manipulations based on the Asset, which is a unique key for the media content which we upload to the Media Server. 2 Task Task is used, if we want to do some operation over the asset which can be done using the Tasks. Tasks will not operate directly, it does the work with one of the entity called JOB. 3 Job Job is an entity which holds the metadata of a TASK, where a JOB is used to create new Assets and Files that are used in associating with more than one tasks. Basically we can associate creating Parent Tasks. 4 File File is one which is always associated with an Asset, which hold the object of the media content basically the audio or video object. 5 Access Policy Access Policy is a Security group which hold a policy on which are the users can access and what access can be provided (Read or write) specifically imposed for an Asset or a File. 6 Content Key Content Key is used as a key for secure access for an asset, which provides a key that is used to encrypt the asset with 3 types – Storage F5debug.Net
  3. 3. Encryption, MPEG Common Encryption or a PlayReady Encryption. 7 Job Template Job Template is basically a template which can be created as per a requirement that can be used repeatedly for many of the Tasks with the Media Server. 8 Locator Locator is the main entity which is basically an URI using which we can access the media content that can downloaded or used for streaming the content that tis stored in the Windows Azure Storage Services (Blob Storages). When it comes to Pricing, currently Windows Azure is on Preview with no cost to the subscription. But internally since the media services will be using the Storage Services (Blob), Content Delivery Network (CDN) where we have cost imposed based on the subscription. Also the Media Services manipulation (Encoding) limit is limited to 1TB which is of free of cost with the monthly subscription. Our next scope is to start using the Windows Azure Media Services, to start with we need to download the necessary prerequisites and keep our development environment ready. Prerequisites for Windows Azure Media Services:  Operating Systems: Windows 7 or Windows 2008 R2 or Windows 8 Release preview  .NET Framework 3.5 SP1, and .NET Framework 4.  VS 2010 SP1 (Professional, Premium, or Ultimate)  Windows Azure Media Services SDK for .NET  Windows Azure SDK for .NET November 2011  WCF Data Services 5.0 for OData v3 Windows Azure Media Services SDK for .NET is the new Software Development Kit released with the Media Service Preview Release which will install the necessary software’s that are required to build the media services application. Before we install the Windows Azure Media Services SDK, first check if the Windows Azure SDK is installed this is very much required as the base development kit to hold all the required software’s. Currently we have Windows Azure Media Services is in Preview and in order to use the environment we need to do some steps which provides us with the required keys basically the Account Key which is required to start using the Media Services with the code base. Step 1 – Sign in to Windows Azure Portal using the link http://Windows.Azure.com with a valid subscription and register for the Media Services preview which will be available under the Preview Features section of Account tab as shown in the screen below. Since my subscription is already subscribed we will see You are active, else we can see a default message of Try it now. F5debug.Net
  4. 4. Step 2 – Click on Try it Now will post the request to the Windows Azure team and we can see the request is queued, once we get the approval mail and status shows You are Active we can start using the Media Services from the code. Next step is to see if all the prerequisites are installed correctly. Install the missing software in order to avoid any interruption which setting up the Window Azure Media Services Account. Step 3 – Start creating a Windows Azure Storage Services (Basically used to store the media content) within the list of regions where Windows Azure Media Services are available. The regions involved are (West Europe, Southeast Asia, East Asia, North Europe, West US, East US). Once the storage is created we can see the storage listed as shown in the screen below. F5debug.Net
  5. 5. Step 4 – Now install the Windows Azure Media Services SDK which can be downloaded from the link “Windows Azure Media Services SDK 1.0”. As a part of Prerequisites if the SDK is installed please leave this step and proceed to the next step. Step 5 – Open Windows PowerShell v2.0 or greater (if you are proceeding with the setup on a Windows 8 Machine then it has inbuilt PowerShell v3.0 installed) so open the PowerShell ISE in administrator mode by right clicking and selecting “Run as Administrator” which opens the PowerShell in Administrator mode as shown in the screen below. F5debug.Net
  6. 6. Step 6 – Next step is to change the directory to the path where we installed the Windows Azure Media Services SDK, use the below script to change to the path. Note to keep the path in “” so that you will not get error. Script – cd “C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0” F5debug.Net
  7. 7. Step 6 – Next step is very important that we are going to activate the Windows Azure media Account using the below script, this script first creates a Management Certificate internally and uploads to the Media Server once the script is executed. If the script is executed correctly we can see a new Browser opened with the steps on how to proceed after installation as shown in the screens below. Script: PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> .GetMediaServicesEnv.ps1 F5debug.Net
  8. 8. After successful registration of the media services account: F5debug.Net
  9. 9. Once things are done correctly we can see a file (PublishSettings) prompted to download to the local machine, this file has the necessary information which are basically required while retrieving the account key. So Save the file to the local machine and the file contains the the management certificate details as shown in the screen below. F5debug.Net
  10. 10. Step 7 – Next step is to get the endpoint information to which the service is pointed to, so use the below script (which has the path to the downloaded Management Certificate) and execute it in the Windows PowerShell as shown in the screen below. On successful execution we will be getting the management service endpoint, certificate thumbprint, and the subscription Id of the Windows Azure account. Script: PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> .SetMediaServicesEnv.ps1 -path "D: Pathdownload.publishsettings" F5debug.Net
  11. 11. Step 8: Run the below script by providing the details of the 3 parameter outputs which we obtained from our last script as shown in the screen below. Script : PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> $context = Get-MediaServicesManagem entContext -managementserviceendpoint "https://management.core.windows.net/" - managementcertthumbprint "XXXXXXXXXXXXXXXXXXXXXXXX" -subscriptionid "XXXXXXXXXXXXXXXXXXXX" Step 9 – Next step is to check on which particular region we are going to create the account, basically now Windows Azure Media Services are available in few of the regions where Microsoft keeps on working to increase the availability zones one by one. To get the list execute F5debug.Net
  12. 12. the below script and we can see the result listed, select one region from the list and keep it aside as shown in the screen below. Script – PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> Get-MediaServicesAvailableRegions – managementcontext $context Step 10 – This step is important, before we proceed with giving a Media Service account name for our application first we need to check if the Media Service name is available. Since this is globally available there is a possibility some one from different region can used the name, so to check if the Account Name is available or not run the below script with your favorite name in the string as shown in the script and screen below. We will get result as True or False based on the availability. Script – F5debug.Net
  13. 13. PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> Get-MediaServicesAccountAvailabilit y -managementcontext $context -AccountName "F5debugMediaServices" Step 11 – We can see the Account Name is available, now we are ready with all the required information. Execute the below script which creates the account with the Windows Azure Media Services as shown in the screen below. Script : PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> Add-MediaServicesAccount -Managemen tContext $context -AccountName "F5debugMediaServices" -StorageAccountName "f5debugstorage" -StorageAccountKey "Primary or Secondary Key”-Region "US_East" – BlobStorageEndpoint http://storage.blob.core.windows.net/ F5debug.Net
  14. 14. Step 12 – On providing the information correctly and the scripts executed without any errors we can see the account gets created and we can see the Account ID and the Subscription details as shown in the screen below. F5debug.Net
  15. 15. Step 13 – Now we need to retrieve the Account Key using which only we will be connecting to the Media Services from the code behind, to get the media services Account key run the below script as shown in the screen below. (Need to execute both the scripts) Script : PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> $accountdetails = Get-Mediaservices accountdetails $context –AccountName "F5debugMediaServices" PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> $accountdetails.accountkey F5debug.Net
  16. 16. Step 14 – Once we get the Account key, to get the complete details of the account execute the below script as shown in the screen below which gives the account details as well as the account key. Script : PS C:Program Files (x86)Microsoft SDKsWindows Azure Media ServicesServicesv1.0> Get-MediaServicesAccounts $context Now we are done with all the necessary steps to register the account and as well got the Account Name and Account Key which are used to connect to the Windows Azure Media Services from the code to programmatically do the manipulations as per the requirement. F5debug.Net