Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 0ee28a6

Browse files
authored
Added mitigation for problem with certificate tags not being saved (#83)
1 parent 798582e commit 0ee28a6

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

ContainerApps.Acmebot/ContainerApps.Acmebot.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Azure.Identity" Version="1.10.4" />
7+
<PackageReference Include="Azure.Identity" Version="1.11.2" />
88
<PackageReference Include="Azure.ResourceManager.AppContainers" Version="1.1.1" />
99
<PackageReference Include="Azure.ResourceManager.Dns" Version="1.1.0" />
1010
<PackageReference Include="DnsClient" Version="1.7.0" />

ContainerApps.Acmebot/Functions/SharedActivity.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,23 +510,25 @@ public async Task<ContainerAppCertificateItem> UploadCertificate([ActivityTrigge
510510
{
511511
Password = password,
512512
Value = pfxBlob
513-
},
514-
Tags =
515-
{
516-
{ "Issuer", IssuerName },
517-
{ "Endpoint", _options.Endpoint.Host },
518-
{ "DnsNames", string.Join(",", dnsNames) }
519513
}
520514
});
521515

522516
var containerAppCertificate = operation.Value;
523517

518+
// 証明書リソースの作成後にタグのみ追加する
519+
ContainerAppManagedEnvironmentCertificateResource containerAppCertificateWithTags = await containerAppCertificate.SetTagsAsync(new Dictionary<string, string>
520+
{
521+
{ "Issuer", IssuerName },
522+
{ "Endpoint", _options.Endpoint.Host },
523+
{ "DnsNames", string.Join(",", dnsNames) }
524+
});
525+
524526
return new ContainerAppCertificateItem
525527
{
526-
Id = containerAppCertificate.Id,
527-
Name = containerAppCertificate.Data.Name,
528-
ExpireOn = containerAppCertificate.Data.Properties.ExpireOn ?? DateTimeOffset.MaxValue,
529-
Tags = containerAppCertificate.Data.Tags
528+
Id = containerAppCertificateWithTags.Id,
529+
Name = containerAppCertificateWithTags.Data.Name,
530+
ExpireOn = containerAppCertificateWithTags.Data.Properties.ExpireOn ?? DateTimeOffset.MaxValue,
531+
Tags = containerAppCertificateWithTags.Data.Tags
530532
};
531533
}
532534

0 commit comments

Comments
 (0)