Skip to content

Commit 013e1c8

Browse files
Merge pull request #109623 from erikadoyle/sf-guestexec
Remove guide on now obsolete servicefabricpacktool
2 parents b3539c8 + 78954b7 commit 013e1c8

File tree

4 files changed

+37
-215
lines changed

4 files changed

+37
-215
lines changed

.openpublishing.redirection.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50487,6 +50487,10 @@
5048750487
{
5048850488
"source_path": "articles/sql-database/sql-database-features-index.yml",
5048950489
"redirect_url": "/azure/sql-database/sql-database-features"
50490+
},
50491+
{
50492+
"source_path": "articles/service-fabric/service-fabric-deploy-multiple-apps.md",
50493+
"redirect_url": "/azure/service-fabric/service-fabric-deploy-existing-app"
5049050494
}
5049150495
]
5049250496
}

articles/service-fabric/service-fabric-deploy-existing-app.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ title: Deploy an existing executable to Azure Service Fabric
33
description: Learn how to package an existing application as a guest executable, so it can be deployed to a Service Fabric cluster.
44

55
ms.topic: conceptual
6-
ms.date: 07/02/2017
6+
ms.date: 03/30/2020
77
---
88
# Package and deploy an existing executable to Service Fabric
9+
910
When packaging an existing executable as a [guest executable](service-fabric-guest-executables-introduction.md), you can choose either to use a Visual Studio project template or to [create the application package manually](#manually). Using Visual Studio, the application package structure and manifest files are created by the new project template for you.
1011

1112
> [!TIP]
1213
> The easiest way to package an existing Windows executable into a service is to use Visual Studio and on Linux to use Yeoman
1314
>
1415
1516
## Use Visual Studio to package and deploy an existing executable
17+
1618
Visual Studio provides a Service Fabric service template to help you deploy a guest executable to a Service Fabric cluster.
1719

1820
1. Choose **File** > **New Project**, and create a Service Fabric application.
@@ -32,6 +34,13 @@ Visual Studio provides a Service Fabric service template to help you deploy a gu
3234

3335
For an example walkthrough, see [Create your first guest executable application using Visual Studio](quickstart-guest-app.md).
3436

37+
### Packaging multiple executables with Visual Studio
38+
39+
You can use Visual Studio to produce an application package that contains multiple guest executables. After adding the first guest executable, right click on the application project and select the **Add->New Service Fabric service** to add the second guest executable project to the solution.
40+
41+
> [!NOTE]
42+
> If you choose to link the source in the Visual Studio project, building the Visual Studio solution, will make sure that your application package is up to date with changes in the source.
43+
3544
## Use Yeoman to package and deploy an existing executable on Linux
3645

3746
The procedure for creating and deploying a guest executable on Linux is the same as deploying a csharp or java application.
@@ -42,24 +51,30 @@ The procedure for creating and deploying a guest executable on Linux is the same
4251

4352
Yeoman creates an application package with the appropriate application and manifest files along with install and uninstall scripts.
4453

54+
### Packaging multiple executables using Yeoman on Linux
55+
56+
To add another service to an application already created using `yo`, perform the following steps:
57+
58+
1. Change directory to the root of the existing application. For example, `cd ~/YeomanSamples/MyApplication`, if `MyApplication` is the application created by Yeoman.
59+
2. Run `yo azuresfguest:AddService` and provide the necessary details.
60+
4561
<a id="manually"></a>
4662

4763
## Manually package and deploy an existing executable
64+
4865
The process of manually packaging a guest executable is based on the following general steps:
4966

5067
1. Create the package directory structure.
5168
2. Add the application's code and configuration files.
5269
3. Edit the service manifest file.
5370
4. Edit the application manifest file.
5471

55-
<!--
56-
>[AZURE.NOTE] We do provide a packaging tool that allows you to create the ApplicationPackage automatically. The tool is currently in preview. You can download it from [here](https://aka.ms/servicefabricpacktool).
57-
-->
58-
5972
### Create the package directory structure
73+
6074
You can start by creating the directory structure, as described in [Package an Azure Service Fabric App](https://docs.microsoft.com/azure/service-fabric/service-fabric-package-apps).
6175

6276
### Add the application's code and configuration files
77+
6378
After you have created the directory structure, you can add the application's code and configuration files under the code and config directories. You can also create additional directories or subdirectories under the code or config directories.
6479

6580
Service Fabric does an `xcopy` of the content of the application root directory, so there is no predefined structure to use other than creating two top directories, code and settings. (You can pick different names if you want. More details are in the next section.)
@@ -70,6 +85,7 @@ Service Fabric does an `xcopy` of the content of the application root directory,
7085
>
7186
7287
### Edit the service manifest file
88+
7389
The next step is to edit the service manifest file to include the following information:
7490

7591
* The name of the service type. This is an ID that Service Fabric uses to identify a service.
@@ -109,6 +125,7 @@ The following is an example of a `ServiceManifest.xml` file:
109125
The following sections go over the different parts of the file that you need to update.
110126

111127
#### Update ServiceTypes
128+
112129
```xml
113130
<ServiceTypes>
114131
<StatelessServiceType ServiceTypeName="NodeApp" UseImplicitHost="true" />
@@ -128,6 +145,7 @@ The CodePackage element specifies the location (and version) of the service's co
128145
The `Name` element is used to specify the name of the directory in the application package that contains the service's code. `CodePackage` also has the `version` attribute. This can be used to specify the version of the code, and can also potentially be used to upgrade the service's code by using the application lifecycle management infrastructure in Service Fabric.
129146

130147
#### Optional: Update SetupEntrypoint
148+
131149
```xml
132150
<SetupEntryPoint>
133151
<ExeHost>
@@ -142,6 +160,7 @@ There is only one SetupEntryPoint, so setup scripts need to be grouped in a sing
142160
In the preceding example, the SetupEntryPoint runs a batch file called `LaunchConfig.cmd` that is located in the `scripts` subdirectory of the code directory (assuming the WorkingFolder element is set to CodeBase).
143161

144162
#### Update EntryPoint
163+
145164
```xml
146165
<EntryPoint>
147166
<ExeHost>
@@ -166,12 +185,14 @@ The `ExeHost` element specifies the executable (and arguments) that should be us
166185
The WorkingFolder is useful to set the correct working directory so that relative paths can be used by either the application or initialization scripts.
167186

168187
#### Update Endpoints and register with Naming Service for communication
188+
169189
```xml
170190
<Endpoints>
171191
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" Type="Input" />
172192
</Endpoints>
173193

174194
```
195+
175196
In the preceding example, the `Endpoint` element specifies the endpoints that the application can listen on. In this example, the Node.js application listens on http on port 3000.
176197

177198
Furthermore you can ask Service Fabric to publish this endpoint to the Naming Service so other services can discover the endpoint address to this service. This enables you to be able to communicate between services that are guest executables.
@@ -184,9 +205,11 @@ In the following example, once the service is deployed, in Service Fabric Explor
184205
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" UriScheme="http" PathSuffix="myapp/" Type="Input" />
185206
</Endpoints>
186207
```
208+
187209
You can use these addresses with [reverse proxy](service-fabric-reverseproxy.md) to communicate between services.
188210

189211
### Edit the application manifest file
212+
190213
Once you have configured the `Servicemanifest.xml` file, you need to make some changes to the `ApplicationManifest.xml` file to ensure that the correct service type and name are used.
191214

192215
```xml
@@ -199,6 +222,7 @@ Once you have configured the `Servicemanifest.xml` file, you need to make some c
199222
```
200223

201224
#### ServiceManifestImport
225+
202226
In the `ServiceManifestImport` element, you can specify one or more services that you want to include in the app. Services are referenced with `ServiceManifestName`, which specifies the name of the directory where the `ServiceManifest.xml` file is located.
203227

204228
```xml
@@ -208,6 +232,7 @@ In the `ServiceManifestImport` element, you can specify one or more services tha
208232
```
209233

210234
## Set up logging
235+
211236
For guest executables, it is useful to be able to see console logs to find out if the application and configuration scripts show any errors.
212237
Console redirection can be configured in the `ServiceManifest.xml` file using the `ConsoleRedirection` element.
213238

@@ -236,6 +261,7 @@ Console redirection can be configured in the `ServiceManifest.xml` file using th
236261
Log files are saved in one of the service's working directories. To determine where the files are located, use Service Fabric Explorer to determine which node the service is running on, and which working directory is being used. This process is covered later in this article.
237262

238263
## Deployment
264+
239265
The last step is to [deploy your application](service-fabric-deploy-remove-applications.md). The following PowerShell script shows how to deploy your application to the local development cluster, and start a new Service Fabric service.
240266

241267
```powershell
@@ -276,14 +302,14 @@ If you navigate to the node and browse to the application, you see the essential
276302

277303
![Location on disk](./media/service-fabric-deploy-existing-app/locationondisk2.png)
278304

279-
If you browse to the directory by using Server Explorer, you can find the working directory and the service's log folder, as shown in the following screenshot:
305+
If you browse to the directory by using Server Explorer, you can find the working directory and the service's log folder, as shown in the following screenshot:
280306

281307
![Location of log](./media/service-fabric-deploy-existing-app/loglocation.png)
282308

283309
## Next steps
310+
284311
In this article, you have learned how to package a guest executable and deploy it to Service Fabric. See the following articles for related information and tasks.
285312

286313
* [Sample for packaging and deploying a guest executable](https://github.com/Azure-Samples/service-fabric-dotnet-getting-started), including a link to the prerelease of the packaging tool
287314
* [Sample of two guest executables (C# and nodejs) communicating via the Naming service using REST](https://github.com/Azure-Samples/service-fabric-containers)
288-
* [Deploy multiple guest executables](service-fabric-deploy-multiple-apps.md)
289315
* [Create your first Service Fabric application using Visual Studio](service-fabric-tutorial-create-dotnet-app.md)

0 commit comments

Comments
 (0)