Configuring and setting environment variables

Environment variables for the service can be set within the service manifest. They can also be overridden in the application manifest or by application parameters supplied at runtime. Following is an example explaining how this can be done in a service manifest:

<ServiceManifest Name="FrontendServicePackage" Version="1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<Description>a guest executable service in a container</Description>
<ServiceTypes>
<StatelessServiceType ServiceTypeName="StatelessFrontendService" UseImplicitHost="true"/>
</ServiceTypes>
<CodePackage Name="FrontendService.Code" Version="1.0">
<EntryPoint>
<ContainerHost>
<ImageName>myrepo/myimage:v1</ImageName>
<Commands></Commands>
</ContainerHost>
</EntryPoint>
<EnvironmentVariables>
<EnvironmentVariable Name="HttpGatewayPort" Value=""/>
<EnvironmentVariable Name="BackendServiceName" Value=""/>
</EnvironmentVariables>
</CodePackage>
</ServiceManifest>

The following example shows how this can be overridden in an application manifest:

<ServiceManifestImport> 
<ServiceManifestRef ServiceManifestName="FrontendServicePackage" ServiceManifestVersion="1.0"/>
<EnvironmentOverrides CodePackageRef="FrontendService.Code">
<EnvironmentVariable Name="BackendServiceName" Value="[BackendSvc]"/>
<EnvironmentVariable Name="HttpGatewayPort" Value="19080"/>
</EnvironmentOverrides>
</ServiceManifestImport>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.213.27