RedisPatch patch = new RedisPatch()
{
RedisConfiguration = new RedisCommonConfiguration()
{
PreferredDataPersistenceAuthMethod = "sas",
AofStorageConnectionString0 = connectionstring1,
AofStorageConnectionString1 = connectionstring2,
}
Identity = null
};
RedisResource resource = redisCollection.GetAsync(clusterName).GetResult();
resource.UpdateAsync(WaitUntil.Completed, patch).GetResult();
我正在从托管身份切换回基于连接字符串的 Redis 缓存身份验证。但我无法从缓存中删除现有的用户分配的托管标识 Identity = null 并没有删除与redis集群链接的身份,我猜它没有考虑null值,但我想删除与缓存链接的usermanagementidentity,有什么办法吗?
我正在从托管身份切换回 Redis 缓存的基于连接字符串的身份验证。但是,我无法删除现有的用户分配的托管标识。
您可以使用相同的 C# 代码通过 Redis 缓存的连接字符串进行身份验证。
要从 Redis 缓存中删除现有的用户分配的托管标识,可以使用下面的 Azure CLI 命令。
命令:
az redis identity remove --mi-user-assigned "venkatmg" --name "testvenkat" --resource-group "xxxxx"
{
"principalId": null,
"tenantId": null,
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/xxxx/resourcegroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/vxxxx": {
"clientId": "9bexxxx87571f85",
"principalId": "573f9xxxxc1461b"
}
}
}