Posts

Migrating Azure VMs on VNet from Azure Service Management (Classic or ASM) to Azure Resource Manager (Resource Manager or ARM)

In this post you will find code snippet to migrate your classic Azure VMs that is part of virtual networks. That is, you will learn Migrating Azure VMs on VNet from Azure Service Management (Classic or ASM) to Azure Resource Manager (Resource Manager or ARM). Without too much discussion, let's start step by step.

You need to have PowerShell installed. In the process of migration you first need to sign in your subscription using modern way that is ARM to prepare migration and then sign in your same subscription using classic approach that is ASM to perform migration and commit.

Step 1.
Let's login ARM

Login-AzureRmAccount

Step 2.
Store subscription id into a variable

$SubID = "1345e4-4561-1bd7-55c1-e3848012qw4r"

Step 3.
Select subscription using above variable

Select-AzureRmSubscription -SubscriptionID $SubID

Step 4.
Now, let's prepare the migration on ARM, this operation may take few minutes.

Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastru…

Slug URL in MVC

Creating a human friendly URL is one of the important goal in content management system. Recently one developer asked me this question. Like he always sees 'id' in URL in MVC application which is not human friendly. He mentioned stack-overflow example when explaining issue to me, so let’s discuss about this. Open stack-overflow page https://stackoverflow.com/questions/40956081
you will be redirected to https://stackoverflow.com/questions/40956081/runtime-exception-thrown-when-stdvector-destructing
Notice the last part in the query, this is nothing but a slug that is being added in URL all the time. Technically both URL maps to same resource. And in URL number '40956081' is unique identifier.

I hope you know Stack-Overflow is also build using ASP.NET MVC. Let's build similar slug and similar behavior in your MVC application.
First you need to configure your route as give below:
public static void RegisterRoutes(RouteCollection routes) { ro…

Azure Media Service Encoding with custom presets

Image
In this post you will learn how to use custom preset for Azure Media Service Encoding. But before that let's look at a case study or issue which I faced.

When I uploaded a 55.5 MB mp4 file and encoded with "H264AdaptiveBitrateMP4Set720p" encoder preset, I received following output files:


















Look into green rectangular highlighted video files in the image, this looks good according to input file size. But if you look at red rectangular highlighted video files, these are *improved* files for adaptive streaming, which looks useless if you compare with my example "a dark line on my face in video can't be removed by system automatically...make sense". Here I'm trying to understand Azure Media Services encoding permutations but increasing file size 2-3 times larger than input file is never a acceptable deal.

Why I should pay more for bandwidth and storage on these large files, how I convince my clients?

On this issue I thought to understand this from community …

Microsoft MVP: Honored to have received the Microsoft MVP award for the 5th year

Image
MVP Again J 1st July 6:30 PM IST has a very special meaning to me, this day starts with full of expectations and fast heartbeats which lasts until the moment of receiving email from Microsoft. Earlier we had a trick to know renewal status even before official confirmation, but this is that hole is closed ;)
So, once again Microsoft awarded me with the MVP (Most Valuable Professional) award for the 5th time in a row in the Visual Studio and Development Technologies (earlier it was ASP.NET/IIS) category.

I'm honored to be the part of Microsoft MVP Program, this is one of the most prestigious award to me.
Here is the body of the mail that I received:


























I'd like to thanks to my family, all friends, Microsoft Indian MVP Group, Biplab Paul (India MVP Program Lead), Gandharv Rawat and my blog readers and followers.

A very-very special thanks to 👩 who is supporting me every day.
Thanks.

Caching in MVC with Donut Caching - excluding caching login

The main purpose of using caching is to dramatically improve the performance of your application. This is nothing but output caching that means whatever you see is cached, and exact similar things is display to everyone.
I recommend you to read Output Caching in MVC post before you read here, because you should be very careful when using any caching mechanism. Or, if you already know output caching, keep reading here only.
Biggest problem you face
If you display user login status on page which you want to cache, then you need to be careful. With output cache attribute [OutputCache(....)] caches everything on page and it will not exclude caching of some portion like login status.
In the situation, the best caching library you should use is Donut Caching (aka Donut Output Caching). Let’s understand its uses.
Using Donut Caching
The best way to add donut caching to your MVC project is to use the NuGet package. From within Visual Studio, select Tools | Library Package Manager and then choo…

Credential parameter can only be used with Organization ID credentials - Azure Deployment or Continuous Deployment Error

Image
I faced this error while Azure Web App Deployment starts in after Continuous Integration. Here's the detailed information you see in the error:

-Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account. There was an error with the Azure credentials used for deployment.

 Error Screenshot:


If you face this issue, here's quick way:

Step 1

Edit existing build definition and select "Azure Web App Deployment" and then click on "Manage".


Now you will be redirect on new tab.

Step 2

On new tab click on "Update service configuration" and this will open a dialog box where you need to select "Certificate Based" option and then fill up the details. You can click on "Publish settings file" to download, this file will have everything…

Azure media services transcoding JobState.Error handling

Image
In case you are facing error in scheduled transcoding task like the one which I can see on my dashboard (image give below):


You can use below code snippet to get more details about the error:


Here is the output after using above code snippet:



More details here: https://gist.github.com/itorian/4ac5fa723b3d5267258450a2c1a00294

Hope this helps.

Popular posts from this blog

5 Ways to send data between ASP.NET Pages