Get-​Service​Fabric​Deployed​Application

Gets a Service Fabric application on a node.

Syntax

Get-ServiceFabricDeployedApplication
   [-NodeName] <String>
   [[-ApplicationName] <Uri>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricDeployedApplication cmdlet gets a Service Fabric application deployed on a specified node.

Service Fabric creates work, log, and temporary directories on the node for each deployed application. Because the directory names include the application ID, the directory names cannot be guessed. When the DeployedApplicationStatus is Active, Get-ServiceFabricDeployedApplication returns the directory names in the WorkDirectory, LogDirectory, and TempDirectory return values. When the DeployedApplicationStatus is Downloading, the WorkDirectory, LogDirectory, and TempDirectory values are null.

The deployed application services store their persisted data in the WorkDirectory. For debugging or diagnostic purposes a different application or process may need to know the location of the WorkDirectory.

The deployed application services should store their log in the LogDirectory created by Service Fabric. A custom uploader of the log files may need to know the location. The location of the LogDirectory may be needed for diagnostic purposes as well when an application on a particular node is not working as expected.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Get active application

PS C:\> Get-ServiceFabricDeployedApplication -NodeName "VIPULM4-RK01-BD01" -ApplicationName fabric:/samples/CalcApp2
ApplicationName           : fabric:/samples/CalcApp2

ApplicationTypeName       : CalculatorApp

DeployedApplicationStatus : Active

WorkDirectory             : D:\ServiceFabric\Data\VIPULM4-RK01-BD01\Fabric\work\Applications\CalculatorApp_App5\work

LogDirectory              : D:\ServiceFabric\Data\VIPULM4-RK01-BD01\Fabric\work\Applications\CalculatorApp_App5\log

TempDirectory             : D:\ServiceFabric\Data\VIPULM4-RK01-BD01\Fabric\work\Applications\CalculatorApp_App5\temp

This command returns deployed applications. In this example, the DeployedApplicationStatus is Active, and, therefore, Get-ServiceFabricDeployedApplication returns the directory names in the WorkDirectory, LogDirectory, and TempDirectory return values.

Example 2: Get downloading application

PS C:\> Get-ServiceFabricDeployedApplication -NodeName VIPULM4-RK01-BD01 fabric:/samples/VQueueApp2
ApplicationName           : fabric:/samples/VQueueApp2

ApplicationTypeName       : VolatileQueueApp

DeployedApplicationStatus : Downloading

This command returns deployed applications. In this example, the DeployedApplicationStatus is Downloading, and, therefore, the command returns values of null for WorkDirectory, LogDirectory, and TempDirectory.

Required Parameters

-NodeName

Specifies the name of a Service Fabric node. The cmdlet gets applications deployed on the node that you specify.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApplicationName

Specifies the Uniform Resource Identifier (URI) of a Service Fabric application. The cmdlet gets the application that has the URI that you specify.

Type:Uri
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Uri, String

This cmdlet accepts a URI that represents the name of the Service Fabric application, or a string representing the Service Fabric node name.

Outputs

System.Object

This cmdlet returns the System.Fabric.Query.DeployedApplication objects that represent the deployed applications in the cluster.