Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 6c222d0

Browse files
levymuriukiLevi Muriuki
andauthored
Add clientcertificateId servicefabric backend property (#834)
Co-authored-by: Levi Muriuki <muriukilm@upmc.edu>
1 parent 94dc8f3 commit 6c222d0

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/ArmTemplates/Common/Constants/ResourceTypeConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static class ResourceTypeConstants
2020
public const string APISchema = "Microsoft.ApiManagement/service/apis/schemas";
2121
public const string AuthorizationServer = "Microsoft.ApiManagement/service/authorizationServers";
2222
public const string Backend = "Microsoft.ApiManagement/service/backends";
23+
public const string Certificate = "Microsoft.ApiManagement/service/certificates";
2324
public const string GlobalServicePolicy = "Microsoft.ApiManagement/service/policies";
2425
public const string Logger = "Microsoft.ApiManagement/service/loggers";
2526
public const string ProductApi = "Microsoft.ApiManagement/service/products/apis";

src/ArmTemplates/Common/Templates/Backend/BackendServiceFabricCluster.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Templates
77
{
88
public class BackendServiceFabricCluster
99
{
10+
public string ClientCertificateId { get; set; }
1011
public string ClientCertificatethumbprint { get; set; }
1112
public int MaxPartitionResolutionRetries { get; set; }
1213
public string[] ManagementEndpoints { get; set; }

src/ArmTemplates/Creator/TemplateCreators/BackendTemplateCreator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public Template CreateBackendTemplate(CreatorParameters creatorConfig)
3636
List<TemplateResource> resources = new List<TemplateResource>();
3737
foreach (BackendTemplateProperties backendTemplatePropeties in creatorConfig.Backends)
3838
{
39+
if (!string.IsNullOrWhiteSpace(backendTemplatePropeties.Properties?.ServiceFabricCluster?.ClientCertificateId)) {
40+
var clientCertId = backendTemplatePropeties.Properties.ServiceFabricCluster.ClientCertificateId;
41+
backendTemplatePropeties.Properties.ServiceFabricCluster.ClientCertificateId = $"[resourceId('{ResourceTypeConstants.Certificate}', parameters('{ParameterNames.ApimServiceName}'), '{clientCertId}')]";
42+
}
3943
// create backend resource with properties
4044
BackendTemplateResource backendTemplateResource = new BackendTemplateResource()
4145
{

0 commit comments

Comments
 (0)