c# - 使用 Azure Redis 在逻辑应用中进行缓存
问题描述
我正在分析 Biztalk 应用程序到逻辑应用程序的迁移。因此,目前我在 SQL Server 中几乎没有需要在逻辑应用程序中使用的数据映射表。所以我可能不得不寻找不同的存储选项,例如 sql server、azure storage 等。我想尝试 Azure redis 缓存在逻辑应用程序中的工作方式。我搜索了很多,但找不到包含我需要遵循的整个过程或步骤/代码的示例。任何人都可以分享我在逻辑应用程序中使用 Redis 需要遵循的教程/步骤。
解决方案
逻辑应用程序中没有可用于 Redis 缓存的直接连接器。您需要通过Azure Function
.
string cstring = System.Configuration.ConfigurationManager.ConnectionStrings["SampleLogicAppState"].ConnectionString;
ConnectionMultiplexer LogicAppStatusConnection = ConnectionMultiplexer.Connect(cstring);
System.Net.Http.Headers.HttpRequestHeaders reqHeaders = req.Headers;
string LogicApp = reqHeaders.Contains("LogicApp") ? reqHeaders.GetValues("LogicApp").First() : null;
string ID = reqHeaders.Contains("ID") ? reqHeaders.GetValues("ID").First() : null;
string Status = reqHeaders.Contains("Status") ? reqHeaders.GetValues("Status").First() : null;
string cacheKey = LogicApp + "+" + ID;
IDatabase LogicAppStatusCache = LogicAppStatusConnection.GetDatabase();
推荐阅读
- swift - Swift 中的默认字典值
- azure - AAD B2C - 启用多因素身份验证后,无法提交验证码以登录 iOS 模拟器
- swift - 版本控制系统未提供作者信息
- python - 如何防止 for 循环停止?
- python - 在 Django 中使用 iframe,不断收到“TemplateDoesNotExist”
- vue.js - 如何修复不立即执行方法的简单自定义 v-on 指令?
- android - 完全隐藏的 APK 尝试在 Play 商店中发布 apk 时
- html - 每当我添加折叠和导航栏折叠时,“ul”和“li”就会完全消失
- python - 如何对已排序的 pandas.Series 进行分组?
- android - 从 SDK 版本 28 以下的 TypeFace 创建 TypeFaceSpan