To deploy and run Azure Service Fabric applications on your Linux development machine, install the runtime and common SDK. You can also install optional SDKs for Java and .NET Core.
The following operating system versions are supported for development:
- Ubuntu 16.04 (
Update your APT sources
To install the SDK and the associated runtime package via the apt-get command-line tool, you must first update your Advanced Packaging Tool (APT) sources.
- Open a terminal.
Add the Service Fabric repo to your sources list.
sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/servicefabric/ trusty main" > /etc/apt/sources.list.d/servicefabric.list'
dotnetrepo to your sources list.
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
Add the new Gnu Privacy Guard (GnuPG, or GPG) key to your APT keyring.
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
Add the official Docker GPG key to your APT keyring.
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Set up the Docker repository.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Refresh your package lists based on the newly added repositories.
sudo apt-get update
Install and set up the SDK for containers and guest executables
After you have updated your sources, you can install the SDK.
Install the Service Fabric SDK package, confirm the installation, and agree to the license agreement.
sudo apt-get install servicefabricsdkcommon
The following commands automate accepting the license for Service Fabric packages:
echo "servicefabric servicefabric/accepted-eula-v1 select true" | debconf-set-selections echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-v1 select true" | debconf-set-selections
Run the SDK setup script.
After you have installed the common SDK package, you should be able to create apps with guest executable or container services by running
yo azuresfguest or
yo azuresfcontainer. You might need to set your $NODE_PATH environment variable to the location of the node modules.
If you are using the environment as root, you might need to set the variable with the following command:
You might want to add these commands to your ~/.bashrc file so that you don't have to set the environment variable at every login.
Set up the XPlat Service Fabric CLI
The XPlat CLI includes commands for interacting with Service Fabric entities, including clusters and applications. It is based on Node.js, so ensure that you have installed Node before you proceed with the following instructions:
Clone the GitHub repo to your development machine.
git clone https://github.com/Azure/azure-xplat-cli.git
Switch to the cloned repo and install the CLI dependencies by using the node package manager (npm).
cd azure-xplat-cli npm install
Create a symlink from the
bin/azurefolder of the cloned repo to
sudo ln -s $(pwd)/bin/azure /usr/bin/azure
Finally, enable auto-completion Service Fabric commands.
azure --completion >> ~/azure.completion.sh echo 'source ~/azure.completion.sh' >> ~/.bash_profile source ~/azure.completion.sh
Set up Azure CLI 2.0
As an alternative to the XPlat CLI, there is now a Service Fabric command module included in Azure CLI.
For more information about installing Azure CLI 2.0 and using the Service Fabric commands, see Get started with Service Fabric and Azure CLI 2.0.
Set up a local cluster
If the installation is successful, you should be able to start a local cluster.
Run the cluster setup script.
Open a web browser and go to Service Fabric Explorer. If the cluster has started, you should see the Service Fabric Explorer dashboard.
At this point, you can deploy pre-built Service Fabric application packages or new ones based on guest containers or guest executables. To build new services by using the Java or .NET Core SDKs, follow the optional setup steps that are provided in subsequent sections.
Standalone clusters aren't supported in Linux. The preview supports only one-box and Azure Linux multi-machine clusters.
Install the Java SDK (optional, if you want to use the Java programming models)
The Java SDK provides the libraries and templates that are required to build Service Fabric services by using Java.
Install the Java SDK package.
sudo apt-get install servicefabricsdkjava
Run the SDK setup script.
Install the Eclipse Neon plug-in (optional)
You can install the Eclipse plug-in for Service Fabric from within the Eclipse IDE for Java Developers. You can use Eclipse to create Service Fabric guest executable applications and container applications in addition to Service Fabric Java applications.
The Java SDK is a prerequisite to using the Eclipse plug-in, even if you use it only for guest executables and container applications.
In Eclipse, ensure that you have latest Eclipse Neon and the latest Buildship version (1.0.17 or later) installed. You can check the versions of installed components by selecting Help > Installation Details. You can update Buildship by using the instructions at Eclipse Buildship: Eclipse Plug-ins for Gradle.
To install the Service Fabric plug-in, select Help > Install New Software.
In the Work with box, type http://dl.microsoft.com/eclipse.
Select the ServiceFabric plug-in, and then click Next.
Complete the installation steps, and then accept the end-user license agreement.
If you already have the Service Fabric Eclipse plug-in installed, make sure that you have the latest version. You can check by selecting Help > Installation Details and then searching for Service Fabric in the list of installed plug-ins. If a newer version is available, select Update.
For more information, see Service Fabric plug-in for Eclipse Java application development.
Install the .NET Core SDK (optional, if you want to use the .NET Core programming models)
The .NET Core SDK provides the libraries and templates that are required to build Service Fabric services with .NET Core.
Install the .NET Core SDK package.
sudo apt-get install servicefabricsdkcsharp
Run the SDK setup script.
Update the SDK and runtime
To update to the latest version of the SDK and runtime, run the following commands (deselect the SDKs that you don't want):
sudo apt-get update sudo apt-get install servicefabric servicefabricsdkcommon servicefabricsdkcsharp servicefabricsdkjava
Updating the packages might cause your local development cluster to stop running. Restart your local cluster after an upgrade by following the instructions on this page.
- Create and deploy your first Service Fabric Java application on Linux by using Yeoman
- Create and deploy your first Service Fabric Java application on Linux by using Service Fabric Plugin for Eclipse
- Create your first CSharp application on Linux
- Prepare your development environment on OSX
- Use the XPlat CLI to manage your Service Fabric applications
- Service Fabric Windows/Linux differences