9
votes

After changing the target framework from 4.5.1 to 4.6 the service in Auzure Fail, the local deployment is working.

Do I need to add .Net 4.6 support ? - I'm unable to find where I can see the frameworks available in my cluster in azure.

Thank you

ApplicationName : fabric:/Lending20.Service.IdentityManagement AggregatedHealthState
: Error UnhealthyEvaluations : Unhealthy services: 100% (1/1), ServiceType='IdentityManagementServiceType', MaxPercentUnhealthyServices=0%.

Unhealthy service: ServiceName='fabric:/Lending20.Service.IdentityManagement/Identity ManagementService', AggregatedHealthState='Error'.

Unhealthy partitions: 100% (1/1), MaxPercentUnhealthyPartitionsPerService=0%.

Unhealthy partition: PartitionId='7c68b397-fda3-491d-9e17-921cd24217ca', AggregatedHealthState='Error'.

Error event: SourceId='System.FM', Property='State'.

ServiceHealthStates : ServiceName : fabric:/Lending20.Service.IdentityManagement/IdentityManagementService AggregatedHealthState : Error

DeployedApplicationHealthStates : ApplicationName : fabric:/Lending20.Service.IdentityManagement NodeName : _lending1 AggregatedHealthState : Ok

HealthEvents : SourceId : System.CM Property : State HealthState : Ok SequenceNumber : 3464 SentAt : 11/21/2015 12:38:08 PM ReceivedAt : 11/21/2015 12:38:08 PM TTL : Infinite Description : Application has been created. RemoveWhenExpired : False IsExpired : False Transitions : Warning->Ok = 11/21/2015 12:38:08 PM, LastError = 1/1/0001 12:00:00 AM

6

6 Answers

5
votes

.NET 4.6 is not yet available in the default Windows Server 2012 image used in Azure. At this point, your only option is to log into each VM and install it.

17
votes

You can use the following ARM template to install .NET 4.6.1. Note that it's dependent on this script (used by Service Profiler). You also can replace it with any other PowerShell script.

The parameter is the base name of the node. So if you have VM0,.. VM5 in your cluster, you should set vmName = 'VM'. The vmExtensionLoop is set to 5 nodes; you can also change that of course.

If you use an ARM template to deploy your cluster, you can include this as part of it. Note it can slow down the deployment of the scale set, since it requires a restart.

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "vmName": {
      "type": "string",
      "metadata": {
        "description": "Virtual machine name."
      },
    }
  },
  "resources": [
    {
      "apiVersion": "2015-05-01-preview",
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "name": "[concat(parameters('vmName'),copyIndex(0), '/CustomScriptExtensionInstallNet461')]",
      "location": "[variables('location')]",
      "tags": {
        "displayName": "CustomScriptExtensionInstallNet461"
      },
      "properties": {
        "publisher": "Microsoft.Compute",
        "type": "CustomScriptExtension",
        "typeHandlerVersion": "1.4",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "fileUris": [ "https://gist.githubusercontent.com/aelij/7ea90dda4a187a482584/raw/a3e0f946d4a22b0af803edb503d0a30a263fba2c/InstallNetFx461.ps1" ],
          "commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File InstallNetFx461.ps1"
        }
      },
      "copy": {
        "name": "vmExtensionLoop",
        "count": 5
      }
    }
  ]
}
3
votes

Use the windows Server 2016 image to get .net 4.6.1. pre installed. vmImageSku:"2016-Datacenter" when provisoning the cluster.

0
votes

another option is use azure resource group template that includes a DSC extension to provision your VMs to have .net 46 installed. Here is the snippet in my dsc powershell to deal with the installation of .net 461 code or gist for more complete script

0
votes

Until 4.6 is supported by Azure natively, I'd use a custom VM image with .NET 4.6 preinstalled. See this article for details on how to create and use one.

0
votes

Now .NET 4.6 and above is available in the Release of SDK 2.5.216 and Runtime 5.5.216

For more details please see: https://azure.microsoft.com/en-us/blog/announcing-azure-service-fabric-5-5-and-sdk-2-5/