Deploy a Service Fabric Cluster to Azure with .NET Framework 4.6

DZone 's Guide to

Deploy a Service Fabric Cluster to Azure with .NET Framework 4.6

Here's how to get started running a Service Fabric Cluster to Microsoft Azure.

· Cloud Zone ·
Free Resource

For anyone working with Service Fabric and wishing to build a solution targeting the .NET Framework 4.6, deploying to Azure is a challenge given this version of the framework is not yet available in the default Windows Server 2012 image. 

To overcome the above limitation and to make the process as easy as possible, we'll employ a customised Azure Resource Manager (ARM) template which we'll first generate via the Azure Portal. 

To get started simply click here or search for Service Fabric Cluster in the Azure Marketplace.

As there is great guidance and content on Microsoft's Azure portal, I won't repeat the steps on Deploying a Service Fabric Cluster using an ARM template, but I will ask you to complete all the fields as you normally would (login, password, custom ports for http and https), but instead of pressing create and deploying your cluster, we'll opt to download the ARM template.

Opening the ARM template in Visual Code or your text editor of choice, search for the following JSON section:

"virtualMachineProfile": {
      "extensionProfile": {
         "extensions": [

Then add a custom script extension block with the following content:

         "commandToExecute":"powershell.exe -ExecutionPolicy Unrestricted -File InstallNetFx46.ps1"

Note, for additional security & flexibility self-host a copy of the InstallNetFx46.ps1 script file.

Download the ARM template — in my case I also rename the file to correspond to the environment targeted (for example AcmeServiceFabricUATCluster.json) and open a PowerShell window to the same folder. Then, issue the following commands, substituting the Acme values for your own:


Get-AzureRmSubscription –SubscriptionName "AcmeCorp" | Select-AzureRmSubscription

New-AzureRmResourceGroup -Name AcmeUAT -Location "West US"

New-AzureRmResourceGroupDeployment -Name AcmeUATDeployment -ResourceGroupName AcmeUAT -TemplateFile AcmeServiceFabricUATCluster.json

Enter the values requested such as password if executing interactively. Upon ARM completion, your Service Fabric nodes will now contain an installation of .NET Framework 4.6. How simple! The next step is to deploy your solution.

azure, devops, microservices, microsoft, service fabric

Published at DZone with permission of Andrej Medic . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}