There were a lot of great Azure Service Fabric announcements at Build this year. Most importantly, you can now run Windows Server Containers on Service Fabric. Linux remains in public preview for now, but will be GA’ing soon in the next release. You can read all about these announcements over at the Azure Service Fabric Team blog.

There were two much smaller features that I especially liked though. Both are changes in the portal experience for creating new clusters.

First of all, there’s now an option to create a single node cluster in Azure. Previously the smallest size you could choose was a three node cluster. Now obviously you should not run your production workloads on a single node cluster, but this is great for dev/test clusters. On the current project I’m doing we’re often testing multiple features on separate (three node) clusters in the cloud. Scaling this back to single node clusters will save us a bunch of money.

SingleNodeCluster.png

Also note that single node clusters cannot be scaled out. So if for example you want to test your application fail-over, you’ll need to spin up a new cluster with more nodes.

The other feature I really like is out-of-the-box support for Application Insights. During cluster setup, you can now enter your Application Insights Instrumentation Key.

ApplicationInsightsInstrumentationKey.png

If you do this, all Service Fabric logging will be sent to your Application Insights instance. This includes Service Fabric system events, Reliable Services events and Reliable Actors events.

ApplicationInsightsTelemetry.png

If you look at the ARM template that is generated by the wizard you can see how this is set up. The template already included a Windows Azure Diagnostics section that ensures that Service Fabric log events are written to Azure Table Storage. Now, if you’ve entered a valid Application Insights Instrumentation Key the ARM template will include an Application Insights sink to push those same events into your Application Insights instance.

{
  "name": "[concat('VMDiagnosticsVmExt','_vmNodeType0Name')]",
  "properties": {
    "type": "IaaSDiagnostics",
    "autoUpgradeMinorVersion": true,
    "protectedSettings": {
      "storageAccountName": "[parameters('applicationDiagnosticsStorageAccountName')]",
      "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('applicationDiagnosticsStorageAccountName')),'2015-05-01-preview').key1]",
      "storageAccountEndPoint": "https://core.windows.net/"
    },
    "publisher": "Microsoft.Azure.Diagnostics",
    "settings": {
      "WadCfg": {
        "DiagnosticMonitorConfiguration": {
          "overallQuotaInMB": "50000",
          "sinks": "applicationInsights",
          "EtwProviders": {
            "EtwEventSourceProviderConfiguration": [
            {
              "provider": "Microsoft-ServiceFabric-Actors",
              "scheduledTransferKeywordFilter": "1",
              "scheduledTransferPeriod": "PT5M",
              "DefaultEvents": {
                "eventDestination": "ServiceFabricReliableActorEventTable"
              }
            },
            {
              "provider": "Microsoft-ServiceFabric-Services",
              "scheduledTransferPeriod": "PT5M",
              "DefaultEvents": {
              "eventDestination": "ServiceFabricReliableServiceEventTable"
            }
          }
        ],
        "EtwManifestProviderConfiguration": [
        {
          "provider": "cbd93bc2-71e5-4566-b3a7-595d8eeca6e8",
          "scheduledTransferLogLevelFilter": "Information",
          "scheduledTransferKeywordFilter": "4611686018427387904",
          "scheduledTransferPeriod": "PT5M",
          "DefaultEvents": {
            "eventDestination": "ServiceFabricSystemEventTable"
          }
        }
      ]
    }
  },
  "SinksConfig": {
    "Sink": [
      {
        "name": "applicationInsights",
        "ApplicationInsights": "[parameters('applicationInsightsKey')]"
      }
    ]
  }
}

Note that these are low level Service Fabric events. To push your application level logging into Application Insights you can either use the Microsoft Diagnostics EventFlow library or directly use the Application Insights SDK. Using the SDK directly was discouraged due to performance issues, but at the Build conference the Service Fabric team assured us that those issues have been resolved.