Skip to content

Commit feac554

Browse files
committed
Whitespace formatting
1 parent 7047eae commit feac554

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 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.
@@ -45,6 +47,7 @@ Yeoman creates an application package with the appropriate application and manif
4547
<a id="manually"></a>
4648

4749
## Manually package and deploy an existing executable
50+
4851
The process of manually packaging a guest executable is based on the following general steps:
4952

5053
1. Create the package directory structure.
@@ -57,9 +60,11 @@ The process of manually packaging a guest executable is based on the following g
5760
-->
5861

5962
### Create the package directory structure
63+
6064
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).
6165

6266
### Add the application's code and configuration files
67+
6368
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.
6469

6570
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 +75,7 @@ Service Fabric does an `xcopy` of the content of the application root directory,
7075
>
7176
7277
### Edit the service manifest file
78+
7379
The next step is to edit the service manifest file to include the following information:
7480

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

111117
#### Update ServiceTypes
118+
112119
```xml
113120
<ServiceTypes>
114121
<StatelessServiceType ServiceTypeName="NodeApp" UseImplicitHost="true" />
@@ -128,6 +135,7 @@ The CodePackage element specifies the location (and version) of the service's co
128135
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.
129136

130137
#### Optional: Update SetupEntrypoint
138+
131139
```xml
132140
<SetupEntryPoint>
133141
<ExeHost>
@@ -142,6 +150,7 @@ There is only one SetupEntryPoint, so setup scripts need to be grouped in a sing
142150
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).
143151

144152
#### Update EntryPoint
153+
145154
```xml
146155
<EntryPoint>
147156
<ExeHost>
@@ -166,12 +175,14 @@ The `ExeHost` element specifies the executable (and arguments) that should be us
166175
The WorkingFolder is useful to set the correct working directory so that relative paths can be used by either the application or initialization scripts.
167176

168177
#### Update Endpoints and register with Naming Service for communication
178+
169179
```xml
170180
<Endpoints>
171181
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" Type="Input" />
172182
</Endpoints>
173183

174184
```
185+
175186
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.
176187

177188
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 +195,11 @@ In the following example, once the service is deployed, in Service Fabric Explor
184195
<Endpoint Name="NodeAppTypeEndpoint" Protocol="http" Port="3000" UriScheme="http" PathSuffix="myapp/" Type="Input" />
185196
</Endpoints>
186197
```
198+
187199
You can use these addresses with [reverse proxy](service-fabric-reverseproxy.md) to communicate between services.
188200

189201
### Edit the application manifest file
202+
190203
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.
191204

192205
```xml
@@ -199,6 +212,7 @@ Once you have configured the `Servicemanifest.xml` file, you need to make some c
199212
```
200213

201214
#### ServiceManifestImport
215+
202216
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.
203217

204218
```xml
@@ -208,6 +222,7 @@ In the `ServiceManifestImport` element, you can specify one or more services tha
208222
```
209223

210224
## Set up logging
225+
211226
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.
212227
Console redirection can be configured in the `ServiceManifest.xml` file using the `ConsoleRedirection` element.
213228

@@ -236,6 +251,7 @@ Console redirection can be configured in the `ServiceManifest.xml` file using th
236251
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.
237252

238253
## Deployment
254+
239255
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.
240256

241257
```powershell
@@ -276,11 +292,12 @@ If you navigate to the node and browse to the application, you see the essential
276292

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

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:
295+
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:
280296

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

283299
## Next steps
300+
284301
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.
285302

286303
* [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

0 commit comments

Comments
 (0)