Deploy Azure Service Fabric Application with VSTS

The Azure Service Fabric is one of the most mature platforms for building microservice-based applications. It has a lot of built in functionality and integrates great with Visual Studio and Visual Studio Team Services (VSTS).

If you want to start playing around with it you can use a lot of samples from GitHub. I always use the VisualObject projects because it’s nice to show Automatic Update and Self-Heeling.

To build a azure service application you can use the special template. You don’t have to change anything – just run the build with the default steps.


The output generates a application package and project artifacts containing all projects from the solution.


To create a Release definition you can also use the template to start with.


In the “Deploy Service Fabric Application” click “Add” to add a new Service Connection.


Depending the configuration of your cluster you can choose Azure Active Directory or Certificate Based authentication. My cluster is configured to use certificate bases authentication.


If your certificate is stored in KeyVault you can use the following script to get the certificate and password.

$s = Get-AzureKeyVaultSecret -VaultName {KeyVaultName} -Name {CertThumbPrint} -Version {Version}

$arr = ([System.Convert]::FromBase64String($s.SecretValueText))
$json = ConvertFrom-Json ([System.Text.Encoding]::UTF8.GetString($arr))



If you have to certificate as a pfx you can do [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("C:\path\to\certificate.pfx")).

If you want, you can override the upgrade settings from the publish profile.


This will ensure that every change is rolled out to the cluster.

That’s it. if you have checked continuous integration and continuous deployment every change to your repository will now trigger a release to your cluster.


Leave a Reply


You are commenting using your account. Log Out /  Change )

Google photo


Twitter picture


Facebook photo


Connecting to %s