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. Here's how to set it up.
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
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. You can use either Bash or PowerShell with Cloud Shell to work with Azure services. You can use the Cloud Shell preinstalled commands to run the code in this article without having to install anything on your local environment.
To start Azure Cloud Shell:
|Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell.|
|Go to https://shell.azure.com, or select the Launch Cloud Shell button to open Cloud Shell in your browser.|
|Select the Cloud Shell button on the menu bar at the upper right in the Azure portal.|
To run the code in this article in Azure Cloud Shell:
Start Cloud Shell.
Select the Copy button on a code block to copy the code.
Paste the code into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux or by selecting Cmd+Shift+V on macOS.
Select Enter to run the code.
Install the Azure Service Fabric Mesh CLI
You must install the Azure CLI version 2.0.67 or later. Run
az --versionto find the version. To install or upgrade to the latest version of the CLI, see Install the Azure CLI.
Install the Azure Service Fabric Mesh CLI extension module using the following command.
az extension add --name mesh
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:
- 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.
You can also set up your Windows development environment.
Find answers to common questions and issues.