On a Windows Server standalone cluster, you can run a service as a group managed service account (gMSA) using a RunAs policy. By default, Service Fabric applications run under the account that the Fabric.exe process runs under. Running applications under different accounts, even in a shared hosted environment, makes them more secure from one another. By using a gMSA, there is no password or encrypted password stored in the application manifest. You can also run a service as an Active Directory user or group.
The following example shows how to create a gMSA account called svc-Test$, how to deploy that managed service account to the cluster nodes, and how to configure the user principal.
Note
Using a gMSA with a standalone Service Fabric cluster requires Active Directory on-premises within your domain (rather than Microsoft Entra ID).
Pre-requisites:
The domain needs a KDS root key.
There must be at least one Windows Server 2012 (or R2) DC in the domain.
Have an Active Directory domain administrator create a group-managed service account using the New-ADServiceAccount cmdlet and ensure that the PrincipalsAllowedToRetrieveManagedPassword includes all of the Service Fabric cluster nodes. AccountName, DnsHostName, and ServicePrincipalName must be unique.
If you apply a RunAs policy to a service and the service manifest declares endpoint resources with the HTTP protocol, you must specify a SecurityAccessPolicy. For more information, see Assign a security access policy for HTTP and HTTPS endpoints.
The following articles will guide you through next steps: