I am changing the authentication method of a redis resource from managedidentity to access token what should be added in redis config PreferredDataPersistenceAuthMethod. Currently it is "preferred-data-persistence-auth-method": "ManagedIdentity"
whst should be the "preferred-data-persistence-auth-method" while using connection string(access token) as a auth method
What should be the "preferred-data-persistence-auth-method" while using a connection string (access token) as an auth method?
According to this Github-Document, the preferred-data-persistence-auth-method
is used to communicate with the storage account for data persistence, either by SAS
or Managed identity
.
If changing the authentication method of a Redis resource from managed identity to connection string, what should be added in the Redis config PreferredDataPersistenceAuthMethod?
To authenticate with a storage account connection string, use the following PowerShell command to modify the RedisConfiguration:
Command and output:
PS /home/venkatesan> Set-AzRedisCache -ResourceGroupName "v-xxx" -Name "xxx" -RedisConfiguration @{"rdb-backup-enabled" = "true"; "rdb-storage-connection-string" = "DefaultEndpointsProtocol=https;AccountName=venkat123;AccountKey=MnvIVSoYyxxxxxad+G9+SrsS+AStxf+aMQ==;EndpointSuffix=core.windows.net"; "rdb-backup-frequency" = "30"}
Name : sampleredis1
Id : /subscriptions/xxx/resourceGroups/xxxx/providers/Microsoft.Cache/Redis/sampleredis1
Location : East US
Type : Microsoft.Cache/Redis
HostName : sampleredis1.redis.cache.windows.net
Port : 6379
ProvisioningState : Succeeded
SslPort : 6380
RedisConfiguration : {[rdb-backup-enabled, true], [rdb-backup-frequency, 30], [rdb-storage-connection-string, DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=venkat123;AccountKey=[key hidden]], [aof-backup-enabled, false]…}
EnableNonSslPort : False
RedisVersion : 6.0
Size : 6GB
Sku : Premium
ResourceGroupName : xxxx
IdentityType :
SystemAssignedIdentity :
UserAssignedIdentity :
PrimaryKey : ATlKxxxxx
SecondaryKey : rBXHGXs2z3zxxxxxxx
SubnetId :
StaticIP :
TenantSettings :
ShardCount :
Tag : {}
Zone :
Portal:
Reference: Set-AzRedisCache (Az.RedisCache) | Microsoft Learn