forked from Azure/PSRule.Rules.Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Azure.Redis.MigrateAMR rule for Azure Cache for Redis migration #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1bf98e1
Initial plan
Copilot 9fb095f
Add Azure.Redis.Retirement rule
Copilot 1dbd2b1
Fix resource type naming in documentation
Copilot d072045
Address feedback: update rule reference, synopsis, and documentation
Copilot 7ac3e86
Address feedback: rename rule, update dates, and clarify changelog
Copilot 9db7937
Address feedback: improve timeline clarity and rename localized string
Copilot 277a291
fixes
BenjaminEngeset 6f304b8
Merge branch 'main' into copilot/create-rule-for-issue-3605
BenjaminEngeset 220006b
Rename localized string to CacheRedisMigrateAMR
Copilot 49a8b6c
Updates
BernieWhite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| --- | ||
| reviewed: 2025-11-23 | ||
| severity: Important | ||
| pillar: Operational Excellence | ||
| category: OE:05 Infrastructure as code | ||
| resource: Azure Cache for Redis | ||
| resourceType: Microsoft.Cache/redis | ||
| online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.Redis.MigrateAMR/ | ||
| --- | ||
|
|
||
| # Migrate to Azure Managed Redis | ||
|
|
||
| ## SYNOPSIS | ||
|
|
||
| Azure Cache for Redis is being retired. Migrate to Azure Managed Redis. | ||
|
|
||
| ## 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 (Basic, Standard, Premium) will be retired according to the following timeline: | ||
|
|
||
| - 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. | ||
|
|
||
| To avoid service disruption, migrate your workloads to Azure Managed Redis. | ||
|
|
||
| ## 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 Bicep | ||
|
|
||
| To deploy resource that pass this rule: | ||
|
|
||
| - Create resources of type `Microsoft.Cache/redisEnterprise` and an Azure Managed Redis SKU, such as: | ||
| - `Balanced_*` | ||
| - `MemoryOptimized_*` | ||
| - `ComputeOptimized_*` | ||
|
|
||
| For example: | ||
|
|
||
| ```bicep | ||
| resource primary 'Microsoft.Cache/redisEnterprise@2025-07-01' = { | ||
| name: name | ||
| location: location | ||
| properties: { | ||
| highAvailability: 'Enabled' | ||
| publicNetworkAccess: 'Disabled' | ||
| } | ||
| sku: { | ||
| name: 'Balanced_B10' | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Configure with Azure template | ||
|
|
||
| To deploy resource that pass this rule: | ||
|
|
||
| - Create resources of type `Microsoft.Cache/redisEnterprise` and an Azure Managed Redis SKU, such as: | ||
| - `Balanced_*` | ||
| - `MemoryOptimized_*` | ||
| - `ComputeOptimized_*` | ||
|
|
||
| For example: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "Microsoft.Cache/redisEnterprise", | ||
| "apiVersion": "2025-07-01", | ||
| "name": "[parameters('name')]", | ||
| "location": "[parameters('location')]", | ||
| "properties": { | ||
| "highAvailability": "Enabled", | ||
| "publicNetworkAccess": "Disabled" | ||
| }, | ||
| "sku": { | ||
| "name": "Balanced_B10" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## NOTES | ||
|
|
||
| Redis Enterprise and Enterprise Flash used the `Microsoft.Cache/redisEnterprise` resource type. | ||
| Redis Enterprise and Enterprise Flash SKUs `Enterprise_*` and `EnterpriseFlash_*` are also deprecated. | ||
|
|
||
| ## LINKS | ||
|
|
||
| - [OE:05 Infrastructure as code](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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // Bicep documentation examples | ||
|
|
||
| @minLength(1) | ||
| @maxLength(63) | ||
| @sys.description('The name of the resource.') | ||
| param name string | ||
|
|
||
| @sys.description('The location resources will be deployed.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @sys.description('The location of a secondary replica.') | ||
| param secondaryLocation string = location | ||
|
|
||
| // An example Azure Managed Redis instance with availability zones. | ||
| resource primary 'Microsoft.Cache/redisEnterprise@2025-07-01' = { | ||
| name: name | ||
| location: location | ||
| properties: { | ||
| highAvailability: 'Enabled' | ||
| publicNetworkAccess: 'Disabled' | ||
| } | ||
| sku: { | ||
| name: 'Balanced_B10' | ||
| } | ||
| } | ||
|
|
||
| // An example secondary replica in an alternative region. | ||
| resource secondary 'Microsoft.Cache/redisEnterprise@2025-07-01' = { | ||
| name: name | ||
| location: secondaryLocation | ||
| properties: { | ||
| highAvailability: 'Enabled' | ||
| publicNetworkAccess: 'Disabled' | ||
| } | ||
| sku: { | ||
| name: 'Balanced_B10' | ||
| } | ||
| } | ||
|
|
||
| // An example database replicated across the primary and secondary instances. | ||
| resource database 'Microsoft.Cache/redisEnterprise/databases@2025-07-01' = { | ||
| parent: primary | ||
| name: 'default' | ||
| properties: { | ||
| clientProtocol: 'Encrypted' | ||
| evictionPolicy: 'VolatileLRU' | ||
| clusteringPolicy: 'OSSCluster' | ||
| deferUpgrade: 'NotDeferred' | ||
| modules: [ | ||
| { | ||
| name: 'RedisJSON' | ||
| } | ||
| ] | ||
| persistence: { | ||
| aofEnabled: false | ||
| rdbEnabled: true | ||
| rdbFrequency: '12h' | ||
| } | ||
| accessKeysAuthentication: 'Disabled' | ||
| geoReplication: { | ||
| groupNickname: 'group' | ||
| linkedDatabases: [ | ||
| { | ||
| id: resourceId('Microsoft.Cache/redisEnterprise/databases', secondary.name, 'default') | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "metadata": { | ||
| "_generator": { | ||
| "name": "bicep", | ||
| "version": "0.39.26.7824", | ||
| "templateHash": "6517319720095351040" | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "name": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 63, | ||
| "metadata": { | ||
| "description": "The name of the resource." | ||
| } | ||
| }, | ||
| "location": { | ||
| "type": "string", | ||
| "defaultValue": "[resourceGroup().location]", | ||
| "metadata": { | ||
| "description": "The location resources will be deployed." | ||
| } | ||
| }, | ||
| "secondaryLocation": { | ||
| "type": "string", | ||
| "defaultValue": "[parameters('location')]", | ||
| "metadata": { | ||
| "description": "The location of a secondary replica." | ||
| } | ||
| } | ||
| }, | ||
| "resources": [ | ||
| { | ||
| "type": "Microsoft.Cache/redisEnterprise", | ||
| "apiVersion": "2025-07-01", | ||
| "name": "[parameters('name')]", | ||
| "location": "[parameters('location')]", | ||
| "properties": { | ||
| "highAvailability": "Enabled", | ||
| "publicNetworkAccess": "Disabled" | ||
| }, | ||
| "sku": { | ||
| "name": "Balanced_B10" | ||
| } | ||
| }, | ||
| { | ||
| "type": "Microsoft.Cache/redisEnterprise", | ||
| "apiVersion": "2025-07-01", | ||
| "name": "[parameters('name')]", | ||
| "location": "[parameters('secondaryLocation')]", | ||
| "properties": { | ||
| "highAvailability": "Enabled", | ||
| "publicNetworkAccess": "Disabled" | ||
| }, | ||
| "sku": { | ||
| "name": "Balanced_B10" | ||
| } | ||
| }, | ||
| { | ||
| "type": "Microsoft.Cache/redisEnterprise/databases", | ||
| "apiVersion": "2025-07-01", | ||
| "name": "[format('{0}/{1}', parameters('name'), 'default')]", | ||
| "properties": { | ||
| "clientProtocol": "Encrypted", | ||
| "evictionPolicy": "VolatileLRU", | ||
| "clusteringPolicy": "OSSCluster", | ||
| "deferUpgrade": "NotDeferred", | ||
| "modules": [ | ||
| { | ||
| "name": "RedisJSON" | ||
| } | ||
| ], | ||
| "persistence": { | ||
| "aofEnabled": false, | ||
| "rdbEnabled": true, | ||
| "rdbFrequency": "12h" | ||
| }, | ||
| "accessKeysAuthentication": "Disabled", | ||
| "geoReplication": { | ||
| "groupNickname": "group", | ||
| "linkedDatabases": [ | ||
| { | ||
| "id": "[resourceId('Microsoft.Cache/redisEnterprise/databases', parameters('name'), 'default')]" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "dependsOn": [ | ||
| "[resourceId('Microsoft.Cache/redisEnterprise', parameters('name'))]", | ||
| "[resourceId('Microsoft.Cache/redisEnterprise', parameters('name'))]" | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.