Skip to content
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
- App Configuration:
- Check that replica locations are in allowed regions by @BernieWhite.
[#3441](https://github.com/Azure/PSRule.Rules.Azure/issues/3441)
- Azure Cache for Redis:
- Check for Azure Cache for Redis retirement path by @BenjaminEngeset.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This was a hard sentence to read, try to write something that makes more sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified changelog entry to "Check that Azure Cache for Redis is migrated to Azure Managed Redis" in 7ac3e86

[#3605](https://github.com/Azure/PSRule.Rules.Azure/issues/3605)
- Managed Instance for Apache Cassandra:
- Check that Managed Instance for Apache Cassandra clusters have availability zones enabled by @BenjaminEngeset.
[#3592](https://github.com/Azure/PSRule.Rules.Azure/issues/3592)
Expand Down
105 changes: 105 additions & 0 deletions docs/en/rules/Azure.Redis.Retirement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
severity: Important
pillar: Operational Excellence
category: Infrastructure provisioning
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot OE:05 Infrastructure as code

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated category to "OE:05 Infrastructure as code" in d072045

resource: Azure Cache for Redis
resourceType: Microsoft.Cache/redis
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Redis.Retirement/
---

# Migrate to Azure Managed Redis

## SYNOPSIS

Azure Cache for Redis is on the retirement path. Migrate to Azure Managed Redis.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Change to the same as the one I said to use in the rule.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated synopsis to match the rule in d072045


## DESCRIPTION

Microsoft has announced the retirement timeline for Azure Cache for Redis across all SKUs.
The recommended replacement going forward is Azure Managed Redis.

Azure Cache for Redis will be retired according to the following timeline:

- Basic and Standard SKUs will be retired on September 30, 2025.
- Premium SKU will be retired on September 30, 2027.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

Azure Cache for Redis (Basic, Standard, Premium):
Creation blocked for new customers: April 1, 2026
Creation blocked for existing customers: October 1, 2026
Retirement Date: September 30, 2028
Instances will be disabled starting October 1, 2028

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated retirement timeline with correct dates in 7ac3e86

To avoid service disruption, migrate your workloads to Azure Managed Redis.

Azure Managed Redis provides several advantages:

- **Improved Performance**: Enhanced throughput and lower latency.
- **Enhanced Security**: Built-in support for Azure Active Directory authentication and managed identities.
- **Better Availability**: Higher availability SLA and improved zone redundancy support.
- **Simplified Management**: Streamlined configuration and maintenance with automated updates.
- **Cost Optimization**: More predictable pricing and better resource utilization.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Remove this, this rule is targeted strictly against informing about the deprecation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the advantages section in d072045

## RECOMMENDATION

Plan and execute migration from Azure Cache for Redis to Azure Managed Redis before the retirement dates to avoid service disruption.

## EXAMPLES

### Configure with Azure template

Azure Managed Redis uses a different resource type. Update your templates to use `Microsoft.Cache/redisEnterprise` instead of `Microsoft.Cache/Redis`.

For example:

```json
{
"type": "Microsoft.Cache/redisEnterprise",
"apiVersion": "2023-11-01",
"name": "[parameters('redisCacheName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Enterprise_E10",
"capacity": 2
},
"zones": [
"1",
"2",
"3"
],
"properties": {
"minimumTlsVersion": "1.2"
}
}
```

### Configure with Bicep

Azure Managed Redis uses a different resource type. Update your Bicep files to use `Microsoft.Cache/redisEnterprise` instead of `Microsoft.Cache/Redis`.

For example:

```bicep
resource redisEnterprise 'Microsoft.Cache/redisEnterprise@2023-11-01' = {
name: redisCacheName
location: location
sku: {
name: 'Enterprise_E10'
capacity: 2
}
zones: [
'1'
'2'
'3'
]
properties: {
minimumTlsVersion: '1.2'
}
}
```

## NOTES

This rule will fail for all Azure Cache for Redis resources as part of informing you about the retirement path.
Consider migrating to Azure Managed Redis before the retirement dates.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Remove this, lets keep it away from this rule as there is much more involved in a migration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the EXAMPLES section in d072045

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Remove this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed NOTES section in 7ac3e86

## LINKS

- [Infrastructure provisioning](https://learn.microsoft.com/azure/architecture/framework/devops/automation-infrastructure)
- [Azure Cache for Redis retirement: What to know and how to prepare](https://techcommunity.microsoft.com/blog/azure-managed-redis/azure-cache-for-redis-retirement-what-to-know-and-how-to-prepare/4458721)
- [Azure Cache for Redis retirement FAQ](https://learn.microsoft.com/azure/azure-cache-for-redis/retirement-faq)
- [Azure Managed Redis documentation](https://learn.microsoft.com/azure/azure-cache-for-redis/managed-redis/managed-redis-overview)
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.cache/redisenterprise)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Remove this line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the Azure deployment reference link in d072045

1 change: 1 addition & 0 deletions src/PSRule.Rules.Azure/en/PSRule-rules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@
ResourceHasNoTags = "The resource does not have any tags. Expected tags: {0}."
ActiveSecurityAlerts = "There are {0} active security alerts of high or medium severity."
KeyValueShouldNotContainSecrets = "The key value '{0}' property should not contain secrets."
AzureCacheRedisRetirement = "Azure Cache for Redis is on the retirement path. Migrate to Azure Managed Redis."
}
5 changes: 5 additions & 0 deletions src/PSRule.Rules.Azure/rules/Azure.Redis.Rule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ Rule 'Azure.Redis.Version' -Ref 'AZR-000347' -Type 'Microsoft.Cache/redis' -Tag
).Reason($LocalizedData.AzureCacheRedisVersion)
}

# Synopsis: Azure Cache for Redis is on the retirement path. Migrate to Azure Managed Redis.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Azure Cache for Redis is being retired. Migrate to Azure Managed Redis.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to "Azure Cache for Redis is being retired. Migrate to Azure Managed Redis." in d072045

Rule 'Azure.Redis.Retirement' -Ref 'AZR-000505' -Type 'Microsoft.Cache/redis' -Tag @{ release = 'GA'; ruleSet = '2025_12'; 'Azure.WAF/pillar' = 'Operational Excellence'; } {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot AZR-000506. AZR-000505 is already in another PR that is not merged yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed reference number to AZR-000506 in d072045

$Assert.Fail($LocalizedData.AzureCacheRedisRetirement)
}

#region Helper functions

function global:GetCacheMemory {
Expand Down
13 changes: 13 additions & 0 deletions tests/PSRule.Rules.Azure.Tests/Azure.Redis.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,19 @@ Describe 'Azure.Redis' -Tag 'Redis' {
$ruleResult.TargetName | Should -BeIn 'redis-R';
$ruleResult.Length | Should -Be 1;
}

It 'Azure.Redis.Retirement' {
$filteredResult = $result | Where-Object { $_.RuleName -eq 'Azure.Redis.Retirement' };

# Fail - All Azure Cache for Redis instances should fail this rule
$ruleResult = @($filteredResult | Where-Object { $_.Outcome -eq 'Fail' });
$ruleResult | Should -Not -BeNullOrEmpty;
$ruleResult.Length | Should -Be 12;
$ruleResult.TargetName | Should -BeIn 'redis-A', 'redis-B', 'redis-C', 'redis-D', 'redis-E', 'redis-F', 'redis-G', 'redis-H', 'redis-I', 'redis-J', 'redis-Q', 'redis-R';

# Verify the reason message
$ruleResult[0].Reason | Should -BeExactly "Azure Cache for Redis is on the retirement path. Migrate to Azure Managed Redis.";
}
}

Context 'With Configuration Option' -Tag 'Configuration' {
Expand Down