Quickstart: Deploy Hello World to Service Fabric Mesh

Important

The preview of Azure Service Fabric Mesh has been retired. New deployments will no longer be permitted through the Service Fabric Mesh API. Support for existing deployments will continue through April 28, 2021.

For details, see Azure Service Fabric Mesh Preview Retirement.

Service Fabric Mesh makes it easy to create and manage microservices applications in Azure, without having to provision virtual machines. In this quickstart, you will create a Hello World application in Azure and expose it to the internet. This operation is completed in a single command. Within just a couple minutes, you'll see this view in your browser:

Hello world app in the browser

Service Fabric Mesh is currently in preview. Previews are made available to you on the condition that you agree to the supplemental terms of use. Some aspects of this feature may change prior to general availability (GA).

If you don't already have an Azure account, create a free account before you begin.

Set up Service Fabric Mesh CLI

You can use the Azure Cloud Shell or a local installation of the Azure CLI to complete this quickstart. Install Azure Service Fabric Mesh CLI extension module by following these instructions.

Sign in to Azure

Sign in to Azure and set your subscription.

az login
az account set --subscription "<subscriptionID>"

Create resource group

Create a resource group to deploy the application to. You can use an existing resource group and skip this step.

az group create --name myResourceGroup --location eastus 

Deploy the application

Note

Effective November 2, 2020, download rate limits apply to anonymous and authenticated requests to Docker Hub from Docker Free plan accounts and are enforced by IP address.

These templates makes use of public images from Docker Hub. Please note that you may be rate limited. For more details, see Authenticate with Docker Hub.

Create your application in the resource group using the az mesh deployment create command. Run the following:

az mesh deployment create --resource-group myResourceGroup --template-uri https://raw.githubusercontent.com/Azure-Samples/service-fabric-mesh/master/templates/helloworld/helloworld.linux.json --parameters "{'location': {'value': 'eastus'}}" 

The preceding command deploys a Linux application using linux.json template. If you want to deploy a Windows application, use windows.json template. Windows container images are larger than Linux container images and may take more time to deploy.

This command will produce a JSON snippet that is shown below. Under the outputs section of the JSON output, copy the publicIPAddress property.

"outputs": {
    "publicIPAddress": {
    "type": "String",
    "value": "40.83.78.216"
    }
}

This information comes from the outputs section in the ARM template. As shown below, this section references the Gateway resource to fetch the public IP address.

  "outputs": {
    "publicIPAddress": {
      "value": "[reference('helloWorldGateway').ipAddress]",
      "type": "string"
    }
  }

Open the application

Once the application successfully deploys, copy the public IP address for the service endpoint from the CLI output. Open the IP address in a web browser. A web page with the Azure Service Fabric Mesh logo displays.

Check the application details

You can check the application's status using the az mesh app show command. This command provides useful information that you can follow up on.

The application name for this quickstart is helloWorldApp, to gather the details on the application execute the following command:

az mesh app show --resource-group myResourceGroup --name helloWorldApp

See the application logs

Examine the logs for the deployed application using the az mesh code-package-log get command:

az mesh code-package-log get --resource-group myResourceGroup --application-name helloWorldApp --service-name helloWorldService --replica-name 0 --code-package-name helloWorldCode

Clean up resources

When you are ready to delete the application, run the az group delete command to remove the resource group and the application and network resources it contains.

az group delete --name myResourceGroup

Next steps

To learn more about creating and deploying Service Fabric Mesh applications, continue to the tutorial.