0

Need some help understanding why the configuration settings of a service fabric application aren't being overriden by the values defined in the application manifest, as expected. Curently I have some settings defined for my two different environments: the default settings are for the final Azure cluster and I have a custom publish profile for my local dev cluster.

Below what I have for each file:

SampleServFabricApp/ApplicationPackageRoot/ApplicationManifest.xml

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="SampleServFabricAppType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateFindValue" DefaultValue="e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764" />
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateRemoteCommonNames" DefaultValue="*.thefinaldomain.com" />
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateRemoteThumbprints" DefaultValue="e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764" />
    <Parameter Name="SampleServFabricApp_PartitionCount" DefaultValue="10" />
    <Parameter Name="SampleServFabricApp_MinReplicaSetSize" DefaultValue="3" />
    <Parameter Name="SampleServFabricApp_TargetReplicaSetSize" DefaultValue="3" />
  </Parameters>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="SampleServFabricApp.EndpointPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides>
      <ConfigOverride Name="Config">
        <Settings>
          <Section Name="SampleServFabricApp_MessageTransportConfig">
            <Parameter Name="CertificateFindValue" Value="[SampleServFabricApp_MessageTransportConfig_CertificateFindValue]" />
            <Parameter Name="CertificateRemoteCommonNames" Value="[SampleServFabricApp_MessageTransportConfig_CertificateRemoteCommonNames]" />
            <Parameter Name="CertificateRemoteThumbprints" Value="[SampleServFabricApp_MessageTransportConfig_CertificateRemoteThumbprints]" />
          </Section>
        </Settings>
      </ConfigOverride>
    </ConfigOverrides>
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="SampleServFabricAppActorService" GeneratedIdRef="e07529c2-2426-4065-b621-90033a78704c|Persisted">
      <StatefulService ServiceTypeName="SampleServFabricAppActorServiceType" TargetReplicaSetSize="[SampleServFabricApp_TargetReplicaSetSize]" MinReplicaSetSize="[SampleServFabricApp_MinReplicaSetSize]">
        <UniformInt64Partition PartitionCount="[SampleServFabricApp_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
      </StatefulService>
    </Service>
  </DefaultServices>
</ApplicationManifest>

SampleServFabricApp/ApplicationParameters/dev_cluster.xml

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/SampleServFabricApp" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateFindValue" Value="4826f9a3ac95bca949fab19ea136e197" />
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateRemoteCommonNames" Value="ServiceFabricDevClusterCert" />
    <Parameter Name="SampleServFabricApp_MessageTransportConfig_CertificateRemoteThumbprints" Value="4826f9a3ac95bca949fab19ea136e197" />
  </Parameters>
</Application>

SampleServFabricApp.Endpoint/PackageRoot/Config/Settings.xml

<?xml version="1.0" encoding="utf-8"?>
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Section Name="SampleServFabricApp_MessageTransportConfig">
    <Parameter Name="MaxMessageSize" Value="10000000" />
    <Parameter Name="SecurityCredentialsType" Value="X509" />
    <Parameter Name="CertificateFindType" Value="FindByThumbprint" />
    <Parameter Name="CertificateFindValue" Value="e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764" />
    <Parameter Name="CertificateStoreLocation" Value="LocalMachine" />
    <Parameter Name="CertificateStoreName" Value="My" />
    <Parameter Name="CertificateProtectionLevel" Value="EncryptAndSign" />
    <Parameter Name="CertificateRemoteCommonNames" Value="*.thefinaldomain.com" />
    <Parameter Name="CertificateRemoteThumbprints" Value="e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764" />
  </Section>
</Settings>

When publishing the application to the local cluster, I can see in the output the log when creating the application and it seems the parameters are ok:

2>Creating application... 2> 2> 2>ApplicationName : fabric:/SampleServFabricApp 2>ApplicationTypeName : SampleServFabricAppType 2>ApplicationTypeVersion : 1.0.0 2>ApplicationParameters : { "SampleServFabricApp_MessageTransportConfig_CertificateRemoteThumbprints" = 2> "4826f9a3ac95bca949fab19ea136e197"; 2> "SampleServFabricApp_MessageTransportConfig_CertificateRemoteCommonNames" = 2> "ServiceFabricDevClusterCert"; 2> "SampleServFabricApp_MessageTransportConfig_CertificateFindValue" = 2> "4826f9a3ac95bca949fab19ea136e197"; } 2> 2>Create application succeeded.

But using the service explorer I can see that errors occurred during the application startup and if I check the event log I can see the following error:

failed to set security settings to { provider=SSL protection=EncryptAndSign certType = '' store='LocalMachine/My' findValue='FindByThumbprint:e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764' remoteCertThumbprints='e47c0e4b80e9b83e39e5e1dc35610b6b84a3b764' remoteX509Names=('*.thefinaldomain.com',issuer=) certChainFlags=40000000 isClientRoleInEffect=false claimBasedClientAuthEnabled=false }: FABRIC_E_CERTIFICATE_NOT_FOUND

Some things I've already tried: - Used Service Fabric explorer and confirmed that the Parameters under the Details tab of the application are correct and match the parameters that have been sent to the deployment script according to the Output window; - Confirmed that the contents of the "Settings.xml" file under "C:\SfDevCluster\Data_App_Node_0\SampleServFabricAppType_App18\SampleServFabricApp.EndpointPkg.Config.1.0.0" are equal to the contents of the "SampleServFabricApp.Endpoint/PackageRoot/Config/Settings.xml";

Any idea if this is a bug or if its missing something that I truly cannot see? As you can see it seems that the deployment process assumes the correct overridden values, but the application doesn't work and event viewer shows the default values instead of the ones used during deployment.

Thanks.

nunob
  • 592
  • 7
  • 24
  • Are you creating a new application or performing an upgrade? – Oleg Karasik Oct 31 '18 at 06:25
  • Also can you share `ServiceManifest.xml`? – Oleg Karasik Oct 31 '18 at 06:38
  • The third comment in a row but, can you also check whether `C:\SfDevCluster\Data\_App\_Node_0\SampleServFabricAppType_App18\* .Package. * .xml` file contains the required value? They should be equal to values from the `SampleServFabricApp/ApplicationParameters/dev_cluster.xml`. – Oleg Karasik Oct 31 '18 at 07:56
  • @OlegKarasik this happens during the creation of a new application. the *Package*.xml files contain the correct settings indeed. In the meantime I had a reply on the GitHub repo. Please check the answer below. Thanks for the comments – nunob Oct 31 '18 at 08:57

1 Answers1

1

I just had a reply to the issue I opened on GitHub. It seems the described behavior is known and it will be fixed on the SDK 3.3 release. For all of you that may want to check it, you can find the issue here

nunob
  • 592
  • 7
  • 24