Set up Service Fabric Mesh CLI

Service Fabric Mesh Command Line Interface (CLI) is required to deploy and manage resources locally and in Azure Service Fabric Mesh.

There are three types of CLI that can be used and they are summarized in the table below.

CLI Module Target Environment Description
az mesh Azure Service Fabric Mesh The primary CLI which allows you to deploy your applications and manage resources against the Azure Service Fabric Mesh environment.
sfctl Local clusters Service Fabric CLI that allows deployment and testing of Service Fabric resources against local clusters.
Maven CLI Local clusters & Azure Service Fabric Mesh A wrapper around az mesh and sfctl that allows Java developers to use a familiar command line experience for local and Azure development experience.

For the preview, Azure Service Fabric Mesh CLI is written as an extension to Azure CLI. You can install it in the Azure Cloud Shell or a local installation of Azure CLI.

Use Azure Cloud Shell

Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. Cloud Shell lets you use either bash or PowerShell to work with Azure services. You can use the Cloud Shell pre-installed commands to run the code in this article without having to install anything on your local environment.

To launch Azure Cloud Shell:

Option Example/Link
Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell. Example of Try It for Azure Cloud Shell
Go to https://shell.azure.com or select the Launch Cloud Shell button to open Cloud Shell in your browser. Launch Cloud Shell in a new window
Select the Cloud Shell button on the top-right menu bar in the Azure portal. Cloud Shell button in the Azure portal

To run the code in this article in Azure Cloud Shell:

  1. Launch Cloud Shell.
  2. Select the Copy button on a code block to copy the code.
  3. Paste the code into the Cloud Shell session with Ctrl+Shift+V on Windows and Linux, or Cmd+Shift+V on macOS.
  4. Press Enter to run the code.

Install the Azure Service Fabric Mesh CLI

  1. You must install the Azure CLI version 2.0.43 or later. Run az --version to find the version. To install or upgrade to the latest version of the CLI, see Install the Azure CLI.

  2. Install the Azure Service Fabric Mesh CLI extension module using the following command.

    az extension add --name mesh
    
  3. Update an existing Azure Service Fabric Mesh CLI module using the following command.

    az extension update --name mesh
    

Install the Service Fabric CLI (sfctl)

Follow instructions on Set up Service Fabric CLI. The sfctl module can be used for deployment of applications based on the resource model against Service Fabric clusters on your local machine.

Install the Maven CLI

In order to use the Maven CLI, the following needs to be installed on your machine:

  • Java
  • Maven
  • Git
  • Azure Mesh CLI (az mesh) - To target Azure Service Fabric Mesh
  • SFCTL (sfctl) - To target local clusters

The Maven CLI for Service Fabric is still in preview.

To use the Maven plugin in your Maven Java app, add the following snippet to your pom.xml file:

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>com.microsoft.azure</groupId>
          <artifactId>azure-sfmesh-maven-plugin</artifactId>
          <version>0.1.0</version>
          <configuration>
            ...
          </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Read the Maven CLI reference section to learn about detailed usage.

Next steps

You can also set up your Windows development environment.

Find answers to common questions and issues.