Skip to content

Commit

Permalink
Use IsAccessKeyAuthenticationDisabled property
Browse files Browse the repository at this point in the history
  • Loading branch information
eerhardt authored and github-actions committed Oct 25, 2024
1 parent 5369bcf commit 83c8da1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Aspire.Hosting.Azure.Redis/AzureRedisExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ public static IResourceBuilder<AzureRedisCacheResource> AddAzureRedis(
{
IsAadEnabled = "true"
};

// TODO: This property should be available from the CDK in the latest version.
var disableAccessKeys = BicepValue<string>.DefineProperty(redis, "DisableAccessKeyAuthentication", ["properties", "disableAccessKeyAuthentication"], isOutput: false, isRequired: false);
disableAccessKeys.Assign("true");
redis.IsAccessKeyAuthenticationDisabled = true;

var principalIdParameter = new ProvisioningParameter(AzureBicepResource.KnownParameters.PrincipalId, typeof(string));
var principalNameParameter = new ProvisioningParameter(AzureBicepResource.KnownParameters.PrincipalName, typeof(string));
Expand Down Expand Up @@ -244,10 +241,7 @@ public static IResourceBuilder<AzureRedisCacheResource> WithAccessKeyAuthenticat
infrastructure.Add(keyVault);

redis.RedisConfiguration.Value!.IsAadEnabled.Kind = BicepValueKind.Unset;

// TODO: This property should be available from the CDK in the latest version.
var disableAccessKeys = BicepValue<string>.DefineProperty(redis, "DisableAccessKeyAuthentication", ["properties", "disableAccessKeyAuthentication"], isOutput: false, isRequired: false);
disableAccessKeys.Kind = BicepValueKind.Unset;
redis.IsAccessKeyAuthenticationDisabled.Kind = BicepValueKind.Unset;

var secret = new KeyVaultSecret("connectionString")
{
Expand Down

0 comments on commit 83c8da1

Please sign in to comment.