Merge pull request #116 from Azure/twhitney-updatepreviewdocs
Twhitney updatepreviewdocs
This commit is contained in:
Коммит
78170d73f2
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: include file
|
||||
description: include file
|
||||
services: service-fabric-mesh
|
||||
author: TylerMSFT
|
||||
ms.service: service-fabric-mesh
|
||||
ms.topic: include
|
||||
ms.date: 05/24/2018
|
||||
ms.author: twhitney
|
||||
ms.custom: include file
|
||||
---
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 11 KiB После Ширина: | Высота: | Размер: 11 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 12 KiB После Ширина: | Высота: | Размер: 12 KiB |
|
@ -3,8 +3,8 @@ title: Overview of Azure Service Fabric Mesh
|
|||
description: An overview of Azure Service Fabric Mesh. With Service Fabric Mesh, you can deploy and scale your application without worrying about the infrastructure needs of your application.
|
||||
services: Azure Service Fabric Mesh
|
||||
keywords:
|
||||
author: thraka
|
||||
ms.author: adegeo
|
||||
author: TylerMSFT
|
||||
ms.author: twhitney
|
||||
ms.date: 04/30/2018
|
||||
ms.topic: overview
|
||||
ms.service: service-fabric-mesh
|
||||
|
@ -16,13 +16,9 @@ manager: timlt
|
|||
|
||||
Service Fabric Mesh is a server-less platform that runs on top of [Service Fabric][service-fabric-overview] and is hosted on Microsoft Azure. With Service Fabric Mesh, you can run and scale your microservices without worrying about the infrastructure powering it. Contrast this to pure [Service Fabric][service-fabric-overview] where you not only manage your services, but you also manage the cluster running your services. Service Fabric Mesh automatically allocates the infrastructure needed by your microservices, and also handles infrastructure failures, making sure your services are highly-available.
|
||||
|
||||
![Diagram of Service Fabric Mesh for Azure](./media/service-fabric-mesh-overview/diagram.png)
|
||||
|
||||
You worry about your code, Azure takes care of the hardware.
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview, and only supports the **East US** region. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
||||
[!INCLUDE [preview note](./includes/include-preview-note.md)]
|
||||
|
||||
## Microservices
|
||||
|
||||
|
@ -46,7 +42,7 @@ You can also take advantage of the Service Fabric runtime that Service Fabric Me
|
|||
|
||||
It only takes a few steps to deploy a sample project with the Azure CLI. For more information, see [Deploy a container](service-fabric-mesh-quickstart-deploy-container.md).
|
||||
|
||||
If you're using Visual Studio, try the [Create an ASP.NET Core website](service-fabric-mesh-tutorial-deploy-dotnetcore.md) tutorial.
|
||||
If you're using Visual Studio, try the [Create an ASP.NET Core website](service-fabric-mesh-tutorial-create-dotnetcore.md) tutorial.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,9 +20,7 @@ Service Fabric Mesh makes it easy to create and manage Docker containers in Azur
|
|||
|
||||
To read more about applications and Service Fabric Mesh, head over to the [Service Fabric Mesh Overview](./service-fabric-mesh-overview.md)
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview, and only supports the **East US** region. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
||||
[!INCLUDE [preview note](./includes/include-preview-note.md)]
|
||||
|
||||
If you don't already have an Azure account, [create a free account](https://azure.microsoft.com/free/) before you begin.
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ This quickstart shows how to deploy your first .NET Core application to Service
|
|||
|
||||
You can easily create a free Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview, and only supports the **East US** region. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
||||
[!INCLUDE [preview note](./includes/include-preview-note.md)]
|
||||
|
||||
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ title: Setup new Windows environment for Service Fabric Mesh on Azure
|
|||
description: Details all of the prerequisites required to create a Service Fabric Application to deploy to Azure Service Fabric Mesh.
|
||||
services: Azure Service Fabric Mesh
|
||||
keywords:
|
||||
author: thraka
|
||||
ms.author: adegeo
|
||||
ms.date: 05/04/2018
|
||||
author: TylerMSFT
|
||||
ms.author: twhitney
|
||||
ms.date: 05/24/2018
|
||||
ms.topic: get-started-article
|
||||
ms.service: service-fabric-mesh
|
||||
manager: timlt
|
||||
|
@ -14,11 +14,9 @@ manager: timlt
|
|||
|
||||
# Setup your Windows environment for Service Fabric Mesh
|
||||
|
||||
To build and run Azure Service Fabric applications on your Windows development machine, install the Service Fabric runtime, SDK, and tools. You also need to enable execution of the Windows PowerShell scripts included in the SDK.
|
||||
To build and run Azure Service Fabric applications on your Windows development machine, install the Service Fabric runtime, SDK, and tools. You also need to enable use of the Windows PowerShell scripts.
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview, and only supports the **East US** region. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
||||
[!INCLUDE [preview note](./includes/include-preview-note.md)]
|
||||
|
||||
## Supported operating system versions
|
||||
The following operating system versions are supported for development:
|
||||
|
@ -34,9 +32,36 @@ Service Fabric uses Windows PowerShell scripts for creating a local development
|
|||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -Scope CurrentUser
|
||||
```
|
||||
|
||||
## Enable Hyper-V
|
||||
|
||||
Hyper-V must be enabled for you to create Service Fabric applications.
|
||||
|
||||
#### Windows 10
|
||||
|
||||
Open PowerShell as an administrator and run the following command:
|
||||
|
||||
```powershell
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
|
||||
```
|
||||
|
||||
Restart your computer. For more information about how to enable Hyper-V, see [Install Hyper-V on Windows 10](https://docs.microsoft.com/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v).
|
||||
|
||||
#### Windows Server 2016
|
||||
|
||||
Open PowerShell as an administrator and run the following command:
|
||||
|
||||
```powershell
|
||||
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
|
||||
```
|
||||
|
||||
Restart your computer. For more information about how to enable Hyper-V, see [Install the Hyper-V role on Windows Server 2016](https://docs.microsoft.com/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server).
|
||||
|
||||
|
||||
|
||||
|
||||
## Visual Studio
|
||||
|
||||
Deploying Service Fabric Applications to Service Fabric Mesh requires Visual Studio 2017. Install version 15.6.0 or greater and enable the following workloads:
|
||||
Deploying Service Fabric Applications to Service Fabric Mesh requires Visual Studio 2017. [Install version 15.6.0][download-visual-studio] or greater and enable the following workloads:
|
||||
|
||||
- ASP.NET and Web Development
|
||||
- Azure Development
|
||||
|
@ -45,39 +70,57 @@ Deploying Service Fabric Applications to Service Fabric Mesh requires Visual Stu
|
|||
|
||||
You'll need to install Docker to support the containerized Service Fabric applications used by Service Fabric Mesh.
|
||||
|
||||
If you're installing Docker on **Windows Server 2016**, use the following PowerShell commands to install Docker. For more information, see [Docker Enterprise Edition for Windows Server][download-docker-server].
|
||||
#### Windows 10
|
||||
|
||||
Download and install the latest version of [Docker Community Edition for Windows][download-docker].
|
||||
|
||||
During the installation, select **Use Windows containers instead of Linux containers** when asked. You'll be required to log off and log back in. After logging back in, if you did not previously enable Hyper-V, you may be prompted to enable Hyper-V. You must enable Hyper-V and then restart your computer.
|
||||
|
||||
After your computer has restarted, Docker will prompt you to enable the **Containers** feature, enable it and restart your computer.
|
||||
|
||||
#### Windows Server 2016
|
||||
|
||||
Use the following PowerShell commands to install Docker. For more information, see [Docker Enterprise Edition for Windows Server][download-docker-server].
|
||||
|
||||
```powershell
|
||||
Install-Module DockerMsftProvider -Force
|
||||
Install-Package Docker -ProviderName DockerMsftProvider -Force
|
||||
|
||||
# This next command will restart the server if needed
|
||||
Install-WindowsFeature Containers -Restart
|
||||
Install-WindowsFeature Containers
|
||||
```
|
||||
|
||||
If you're installing Docker for **Windows 10**, install the latest version of [Docker Community Edition for Windows][download-docker]. During the installation, select **Use Windows containers instead of Linux containers** when asked. You'll be required to log off and log back in. After logging back in, you may be prompted to enable Hyper-V, enable it. When you enable Hyper-V, you'll have to restart your computer.
|
||||
Restart your computer.
|
||||
|
||||
## SDK and tools
|
||||
|
||||
Install the SDK and Visual Studio tools to create new Service Fabric Applications. Currently, you must remove any existing Service Fabric runtime and SDK from your system. Service Fabric Mesh components can't be installed alongside the current Service Fabric components.
|
||||
Install the Service Fabric runtime, SDK, and tools.
|
||||
|
||||
1. If necessary, remove any existing Service Fabric SDK and runtime.
|
||||
2. Install the [Service Fabric Mesh Runtime][download-runtime] with the **/AcceptEULA** flag on the command line.
|
||||
5. Install the [Service Fabric Mesh SDK][download-sdk].
|
||||
3. Install the [Visual Studio Service Fabric Mesh tools][download-tools].
|
||||
4. Open a **new** elevated PowerShell window and run
|
||||
`"C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1" -CreateOneNodeCluster -UseMachineName`
|
||||
5. (Optional) Start the local Cluster Manager tool:
|
||||
`"C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager\ServiceFabricLocalClusterManager.exe"`
|
||||
6. Reboot your computer.
|
||||
1. Install the [Service Fabric Runtime][download-runtime] with the **/AcceptEULA** flag on the command line.
|
||||
2. Install the [Service Fabric SDK][download-sdk].
|
||||
3. Install the [Service Fabric Mesh SDK][download-sdkmesh].
|
||||
4. Install the [Visual Studio Service Fabric Tools (preview)][download-tools].
|
||||
|
||||
## Build a cluster
|
||||
|
||||
To create and run Service Fabric applications, you must have a single-node local development cluster. This cluster must be running whenever you use Visual Studio with a Service Fabric Mesh project.
|
||||
|
||||
Docker **must** be running before you can build a cluster. Test that Docker is running by opening a terminal window and running `docker ps` to see if an error occurs. If the response does not indicate an error, Docker is running and you're ready to build a cluster.
|
||||
|
||||
After you install the SDK and Visual Studio tools, create a development cluster. Open a **new**, **elevated**, PowerShell window and run the following PowerShell commands:
|
||||
|
||||
```powershell
|
||||
. "C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1" -CreateOneNodeCluster -UseMachineName
|
||||
```
|
||||
|
||||
You're now ready to create Service Fabric Mesh services!
|
||||
|
||||
## Next steps
|
||||
|
||||
Read through the [Deploy a .NET Core app to Service Fabric Mesh](service-fabric-mesh-tutorial-deploy-dotnetcore.md) tutorial.
|
||||
Read through the [Create a .NET Core app to Service Fabric Mesh](service-fabric-mesh-tutorial-create-dotnetcore.md) tutorial.
|
||||
|
||||
[download-docker]: https://store.docker.com/editions/community/docker-ce-desktop-windows
|
||||
[download-docker-server]: https://docs.docker.com/install/windows/docker-ee/
|
||||
[download-runtime]: http://aka.ms/meshdlruntime
|
||||
[download-sdk]: http://aka.ms/meshdlsdk
|
||||
[download-tools]: https://aka.ms/sfapptools
|
||||
[powershell5-download]: https://www.microsoft.com/download/details.aspx?id=50395
|
||||
[download-runtime]: http://aka.ms/sfruntime
|
||||
[download-sdk]: http://aka.ms/sfsdk
|
||||
[download-sdkmesh]: http://aka.ms/sfmeshsdk
|
||||
[download-tools]: https://aka.ms/sfvstools
|
||||
[download-visual-studio]: https://www.visualstudio.com/downloads/
|
|
@ -0,0 +1,136 @@
|
|||
---
|
||||
title: Test and deploy a .NET Core app for Azure Service Fabric Mesh
|
||||
description: In this tutorial you create an ASP.NET Core website and deploy it to the local Service Fabric test cluster. After that, you will deploy to Azure.
|
||||
services: service-fabric-mesh
|
||||
documentationcenter: .net
|
||||
author: TylerMSFT
|
||||
manager: timlt
|
||||
editor: ''
|
||||
|
||||
ms.assetid:
|
||||
ms.service: service-fabric-mesh
|
||||
ms.devlang: dotNet
|
||||
ms.topic: tutorial
|
||||
ms.tgt_pltfrm: NA
|
||||
ms.workload: NA
|
||||
ms.date: 05/15/2018
|
||||
ms.author: twhitney
|
||||
ms.custom: mvc, devcenter
|
||||
#Customer intent: As a developer, I want to use visual studio to locally run a .net core application on Service Fabric Mesh so that I can see it run and then I will deploy it to Azure.
|
||||
---
|
||||
|
||||
# Tutorial: Create an ASP.NET Core website for Service Fabric Mesh
|
||||
|
||||
In this tutorial you will create a new Service Fabric Mesh project, add an ASP.NET Core website to it, and run it locally in the Service Fabric cluster. After that, you will deploy the project to Azure.
|
||||
|
||||
In this tutorial you learn how to:
|
||||
> [!div class="checklist"]
|
||||
> * Create a new Service Fabric Mesh project.
|
||||
> * Debug the service locally.
|
||||
> * Publish the service to Azure.
|
||||
|
||||
If you don’t have an Azure subscription, [create a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
|
||||
|
||||
[!INCLUDE [preview note](./includes/include-preview-note.md)]
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you get started, make sure that you've [set up your development environment](service-fabric-mesh-setup-developer-environment-sdk.md). This process includes installing the Service Fabric runtime, SDK, Docker, and Visual Studio 2017.
|
||||
|
||||
## Create a Service Fabric Mesh project
|
||||
|
||||
Open Run Visual Studio and select **File** > **New** > **Project...**
|
||||
|
||||
In the **New Project** dialog, type **mesh** into the **Search** box at the top. Select the **Service Fabric Mesh Application** template.
|
||||
|
||||
In the **Name** box, type **ServiceFabricMesh1** and in the **Location** box, set the folder path of where the files for the project will be stored.
|
||||
|
||||
Make sure that **Create directory for solution** is checked, and press **OK** to create the Service Fabric Mesh project.
|
||||
|
||||
![Visual studio new Service Fabric Mesh project dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-project.png)
|
||||
|
||||
### Create a service
|
||||
|
||||
After you create a Service Fabric Application project, a new dialog is displayed, **New Service Fabric Service**. Select the **ASP.NET Core** project type, make sure **Container OS** is set to **Windows**.
|
||||
|
||||
You must set the **Service Name** to something unique. Why? Because the name of the service is used as the repository name of the Docker image. If you have an existing Docker image with the same repository name, it will be overwritten by Visual Studio. Open a terminal and use the Docker command `docker images` to verify your project name is unique.
|
||||
|
||||
Press **OK** to create the ASP.NET Core project.
|
||||
|
||||
|
||||
![Visual studio new Service Fabric Mesh project dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-service-fabric-service.png)
|
||||
|
||||
A new dialog is displayed, **New ASP.NET Core Web Application** dialog. Select **Web Application** and then press **OK**.
|
||||
|
||||
![Visual studio new ASP.NET core application](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-aspnetcore-app.png)
|
||||
|
||||
Visual Studio will create both the Service Fabric Application project and the ASP.NET Core project. The combination of these two projects represent your service.
|
||||
|
||||
## Build and deploy
|
||||
|
||||
A Docker image will automatically be built and deployed to your local cluster as soon as your project loads. This process may take some time and you can monitor the progress of the Service Fabric tools in the **Output** pane if you want. Select the **Service Fabric Tools** item in the pane. You are not prevented from running your project.
|
||||
|
||||
After the project has been created, press **F5** to compile and run your service locally. This may take some time if your project has never been run before. Whenever the project is run and debugged locally, Visual Studio will:
|
||||
|
||||
1. Make sure that Docker for Windows is running and set to use Windows as the container operating system.
|
||||
2. Downloads any missing Docker base images. This part may take some time
|
||||
3. Builds (or rebuilds) the Docker image used to host your code project.
|
||||
4. Deploys and runs the container on the local Service Fabric development cluster.
|
||||
6. Runs your services and hits any breakpoints you have set.
|
||||
|
||||
After the local deployment is finished, and Visual Studio is running your projects, a browser window will open and automatically navigate to the sample webpage.
|
||||
|
||||
When you are done browsing the deployed service you can stop debugging your project by pressing **Shift+F5** in Visual Studio.
|
||||
|
||||
## Publish to Azure
|
||||
|
||||
To publish your Service Fabric Mesh project to Azure, right-click on the **Service Fabric Mesh project** in Visual studio and select **Publish...**
|
||||
|
||||
![Visual studio right-click Service Fabric Mesh project](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-right-click-publish.png)
|
||||
|
||||
You will see a **Publish Service Fabric Application** dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh publish dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-dialog.png)
|
||||
|
||||
Select your Azure account and subscription. Choose a **Location**. This article uses **East US**.
|
||||
|
||||
Under **Resource group**, select **\<Create New Resource Group...>**. This will show you a dialog where you will create a new resource group. Choose the **East US** location and name the group **sfmeshTutorial1RG**. Press **Create** to create the resource group and return to the publish dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh new resource group dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-new-resource-group-dialog.png)
|
||||
|
||||
Back in the **Publish Service Fabric Application** dialog, under **Azure Container Registry**, select **\<Create New Container Registry...>**. In the **Create Container Registry** dialog, use a unique name for the **Container registry name**. For **Location**, pick **East US**. Select the **sfmeshTutorial1RG** resource group. Set the **SKU** to **Basic** and then press **Create** to return to the publish dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh new resource group dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-new-container-registry-dialog.png)
|
||||
|
||||
In the publish dialog, press the **Publish** button to deploy your Service Fabric application to Azure.
|
||||
|
||||
When you publish to Azure for the first time, it can take up to 10 or more minutes. Subsequent publishes of the same project generally take around five minutes. Obviously, these estimates will vary based on your internet connection speed and other factors. You can monitor the progress of the deployment by selecting the **Service Fabric Tools** item in the Visual Studio **Output** pane. Once the deployment has finished, the **Service Fabric Tools** output will display the IP address and port of your application in the form of a URL.
|
||||
|
||||
```json
|
||||
Packaging Application...
|
||||
Building Images...
|
||||
Web1 -> C:\Code\ServiceFabricMesh1\Web1\bin\Any CPU\Release\netcoreapp2.0\Web1.dll
|
||||
Uploading the images to Azure Container Registy...
|
||||
Deploying application to remote endpoint...
|
||||
The application was deployed successfully and it can be accessed at http://10.000.38.000:20000.
|
||||
```
|
||||
|
||||
Open a web browser and navigate to the URL to see the website running in Azure.
|
||||
|
||||
## Clean up resources
|
||||
|
||||
When no longer needed, delete all of the resources you created. Since you created a new resource group to host both the ACR and Service Fabric Mesh service resources, you can safely delete this resource group.
|
||||
|
||||
```azurecli
|
||||
az group delete --resource-group sfmeshTutorial1RG
|
||||
```
|
||||
|
||||
```powershell
|
||||
Remove-AzureRmResourceGroup -Name sfmeshTutorial1RG
|
||||
```
|
||||
|
||||
Alternatively, you can delete the resource group [from the portal](../azure-resource-manager/resource-group-portal.md#delete-resource-group-or-resources).
|
||||
|
||||
## Next steps
|
||||
|
||||
Explore the [samples](https://github.com/Azure/seabreeze-preview-pr/tree/master/samples) for Service Fabric Mesh.
|
|
@ -1,195 +0,0 @@
|
|||
---
|
||||
title: Test and deploy a .NET Core app for Azure Service Fabric Mesh
|
||||
description: In this tutorial you create an ASP.NET Core website and deploy it to the local Service Fabric test cluster. After that, you will deploy to Azure.
|
||||
services: service-fabric-mesh
|
||||
documentationcenter: .net
|
||||
author: thraka
|
||||
manager: timlt
|
||||
editor: ''
|
||||
|
||||
ms.assetid:
|
||||
ms.service: service-fabric-mesh
|
||||
ms.devlang: dotNet
|
||||
ms.topic: tutorial
|
||||
ms.tgt_pltfrm: NA
|
||||
ms.workload: NA
|
||||
ms.date: 05/15/2018
|
||||
ms.author: adegeo
|
||||
ms.custom: mvc, devcenter
|
||||
#Customer intent: As a developer, I want to use visual studio to locally run a .net core application on Service Fabric Mesh so that I can see it run and then I will deploy it to Azure.
|
||||
---
|
||||
|
||||
# Tutorial: Create an ASP.NET Core website for Service Fabric Mesh
|
||||
|
||||
In this tutorial you will create a new Service Fabric Mesh project, add an ASP.NET Core website to it, and run it locally in the Service Fabric cluster. After that, you will deploy the project to Azure.
|
||||
|
||||
In this tutorial you learn how to:
|
||||
> [!div class="checklist"]
|
||||
> * Create a new Service Fabric Mesh project
|
||||
> * Deploy the service to the local cluster
|
||||
> * Deploy the service to Azure
|
||||
|
||||
If you don’t have an Azure subscription, [create a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
|
||||
|
||||
| |
|
||||
| --- |
|
||||
| Service Fabric Mesh is in currently in preview, and only supports the **East US** region. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA). |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you get started, make sure that you've set up your development environment. This process includes installing the Service Fabric Mesh SDK and Visual Studio 2017.
|
||||
|
||||
<!--
|
||||
For more information on installing the prerequisites, see [Set up your developer machine]().
|
||||
-->
|
||||
|
||||
|
||||
## Create a Service Fabric Mesh project
|
||||
|
||||
After you've installed the Service Fabric Mesh SDK, new templates for Service Fabric Mesh are available in Visual Studio. Open Run Visual Studio and select **File** > **New** > **Project...**
|
||||
|
||||
In the **New Project** dialog, type **mesh** into the **Search** box at the top. Select the **Service Fabric Mesh Application** template. Next, Make sure that **Create directory for solution** is checked.
|
||||
|
||||
In the **Name** box, type **ServiceFabricMesh1** and in the **Location** box, set the folder path of where the files for the project will be stored.
|
||||
|
||||
Press **OK** to create the Service Fabric Mesh project.
|
||||
|
||||
![Visual studio new Service Fabric Mesh project dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-project.png)
|
||||
|
||||
A new dialog is displayed, **New Service Fabric Service**. Select the **ASP.NET Core** project type, make sure **Container OS** is set to **Windows**.
|
||||
|
||||
You may change the **Service Name** to something unique. Why? Because the name of the service is used as the repository name of the Docker image. If you have an existing Docker image with the same repository name, it will be overwritten by Visual Studio. Use the command `docker image list` to verify your name is unique.
|
||||
|
||||
Press **OK** to create the ASP.NET Core project.
|
||||
|
||||
|
||||
![Visual studio new Service Fabric Mesh project dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-service-fabric-service.png)
|
||||
|
||||
A new dialog is displayed, **New ASP.NET Core Web Application** dialog. Select **Web Application** and then press **OK**.
|
||||
|
||||
![Visual studio new ASP.NET core application](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-new-aspnetcore-app.png)
|
||||
|
||||
Visual Studio will create your Service Fabric Mesh project and then the ASP.NET Core project. A Docker image will automatically be built and deployed to your local Docker host. This process may take some time. You can monitor the progress of the Service Fabric tools in the **Output** pane. Select the **Service Fabric Tools** item in the pane.
|
||||
|
||||
![Visual studio new ASP.NET core application](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-docker-tools-start.png)
|
||||
|
||||
>**Possible failure**
|
||||
>The NuGet package **Microsoft.VisualStudio.Azure.SFApp.Targets** is required and may not be available, causing the project build to fail. You may need to temporarily add the NuGet package from the Service Fabric extension install directory. This is different on each computer but is generally located somewhere in the folder `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\[UNIQUE NAME]\Nuget`. The `[UNIQUE NAME]` is different for each install and is named something similar to `x2lwnl23.hto`. Scan each directory (sort by *last modified date*) for a file named `Microsoft.VisualStudio.Azure.SFApp.Targets.0.6.0.nupkg`. Add this folder as a package source to NuGet in Visual Studio. For more information on adding package sources, see [Package Manager UI](/nuget/tools/package-manager-ui#package-sources).
|
||||
>
|
||||
> If you run into this problem, and after you have added the NuGet source, rebuild the app to verify the package can be found. Then, close your solution and reload it. Or, restart Visual Studio and reload your solution.
|
||||
|
||||
|
||||
Verify that the image has been created by running `docker image list` in your CLI of choice. In the results, there's a **REPOSITORY** value named the same as your ASP.NET Core project name.
|
||||
|
||||
```cli
|
||||
> docker image list
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
web1 dev 2394cbc74553 6 days ago 482MB
|
||||
microsoft/aspnetcore 2.0 6636e7059d8d 7 days ago 482MB
|
||||
```
|
||||
|
||||
## Build and deploy
|
||||
|
||||
After the project has been created, press **F5** to run it. Whenever the project is run and debugged locally, Visual Studio will:
|
||||
|
||||
1. Make sure that Docker for Windows is installed and running.
|
||||
2. Make sure that Docker for Windows is set to use Windows as the container operating system.
|
||||
3. Downloads any missing Docker base images.
|
||||
4. Builds (or rebuilds) the Docker image used to host your code project.
|
||||
5. Deploys and runs the container on the local Service Fabric development cluster.
|
||||
6. Launches the web browser and navigates to the project website.
|
||||
|
||||
After the local deployment is finished, and your web browser has popped up, you can query Docker for state. For example, use `docker ps` to see the running container hosting your app.
|
||||
|
||||
```cli
|
||||
> docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
a4997407f7c2 web3:dev "C:\\remote_debugger\\…" 2 minutes ago Up 2 minutes 0.0.0.0:20000->20000/tcp sf-5-0082a275-aaf4-4657-9f90-7885a16a9dd9_97be639e-67dc-456a-a614-241c1e4040bd
|
||||
```
|
||||
|
||||
Use the **CONTAINER ID** with the `docker inspect` command to find the IP address the container is using. This command returns you a **json** formatted string that gives you details about the docker container. The last part of the output should be the network settings, which provide you the IP address.
|
||||
|
||||
```cli
|
||||
> docker inspect a4997407f7c2
|
||||
[
|
||||
{
|
||||
"Id": "a4997407f7c2b9edeed0fd041207e7dd11075e0aa8e0a4f0d660f0305c63015d",
|
||||
|
||||
... <CUT FOR SPACE> ...
|
||||
|
||||
"Networks": {
|
||||
"nat": {
|
||||
"IPAMConfig": null,
|
||||
"Links": null,
|
||||
"Aliases": null,
|
||||
"NetworkID": "d9068c71d74865bc95b36d168b8a6f346c72e7b95ad2a143b6bf6d1f65563d95",
|
||||
"EndpointID": "099056ab00076606aa0138c57b3dda392015bfb4d45b173f6be917c2c08ae5df",
|
||||
"Gateway": "172.16.16.1",
|
||||
"IPAddress": "172.16.24.220",
|
||||
"IPPrefixLen": 16,
|
||||
"IPv6Gateway": "",
|
||||
"GlobalIPv6Address": "",
|
||||
"GlobalIPv6PrefixLen": 0,
|
||||
"MacAddress": "00:15:dd:cf:3a:a5",
|
||||
"DriverOpts": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
In Visual Studio, press **Shift+F5** to stop debugging.
|
||||
|
||||
## Deploy to Azure
|
||||
|
||||
To deploy your Service Fabric Mesh project to Azure, right-click on the **Service Fabric Mesh project** in Visual studio and select **Publish...**
|
||||
|
||||
![Visual studio right-click Service Fabric Mesh project](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-right-click-publish.png)
|
||||
|
||||
You will see a **Publish Service Fabric Application** dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh publish dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-dialog.png)
|
||||
|
||||
Select your Azure account and subscription. The **Location** must be set to **East US**.
|
||||
|
||||
Under **Resource group**, select **\<Create New Resource Group...>**. This will show you a dialog where you will create a new resource group. Choose the **East US** location and name the group **sfmeshTutorial1RG**. Press **Create** to create the resource group and return to the publish dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh new resource group dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-new-resource-group-dialog.png)
|
||||
|
||||
Back in the **Publish Service Fabric Application** dialog, under **Azure Container Registry**, select **\<Create New Container Registry...>**. In the **Create Container Registry** dialog, use a unique name for the **Container registry name**. For **Location**, pick **East US**. Select the **sfmeshTutorial1RG** resource group. Set the **SKU** to **Basic** and then press **Create** to return to the publish dialog.
|
||||
|
||||
![Visual studio Service Fabric Mesh new resource group dialog](media/service-fabric-mesh-tutorial-deploy-dotnetcore/visual-studio-publish-new-container-registry-dialog.png)
|
||||
|
||||
In the publish dialog, press the **Publish** button to deploy your Service Fabric application to Azure.
|
||||
|
||||
When you publish to Azure for the first time, it can take up to 10 or more minutes. Subsequent publishes of the same project generally take around five minutes. Obviously, these estimates will vary based on your internet connection speed and other factors. You can monitor the progress of the deployment by selecting the **Service Fabric Tools** item in the Visual Studio **Output** pane. Once the deployment has finished, the **Service Fabric Tools** output will display the IP address and port of your application in the form of a URL.
|
||||
|
||||
```json
|
||||
Packaging Application...
|
||||
Building Images...
|
||||
Web1 -> C:\Code\ServiceFabricMesh1\Web1\bin\Any CPU\Release\netcoreapp2.0\Web1.dll
|
||||
Uploading the images to Azure Container Registy...
|
||||
Deploying application to remote endpoint...
|
||||
The application was deployed successfully and it can be accessed at http://10.000.38.000:20000.
|
||||
```
|
||||
|
||||
Open a web browser and navigate to the URL to see the website running in Azure.
|
||||
|
||||
## Clean up resources
|
||||
|
||||
When no longer needed, delete all of the resources you created. Since you created a new resource group to host both the ACR and Service Fabric Mesh service resources, you can safely delete this resource group.
|
||||
|
||||
```cli
|
||||
az group delete --resource-group sfmeshTutorial1RG
|
||||
```
|
||||
|
||||
```powershell
|
||||
Remove-AzureRmResourceGroup -Name sfmeshTutorial1RG
|
||||
```
|
||||
|
||||
Alternatively, you can delete the resource group [from the portal](../azure-resource-manager/resource-group-portal.md#delete-resource-group-or-resources).
|
||||
|
||||
## Next steps
|
||||
|
||||
Explore the [samples](https://github.com/Azure/seabreeze-preview-pr/tree/master/samples) for Service Fabric Mesh.
|
Загрузка…
Ссылка в новой задаче