public static voID ProcessQueueMessage([ServiceBusTrigger("myQueuename")] brokeredMessage message,TextWriter log)@H_301_12@但是,我希望能够在不重新编译的情况下更改队列名称,例如根据配置appsetting,可以完成吗?
解决方法 我已经使用 azure-webjobs-sdk-samples中的配置设置找到了InameResolver的实现./// <summary>/// Resolves %name% variables in attribute values from the config file./// </summary>public class ConfignameResolver : InameResolver{ /// <summary> /// Resolve a %name% to a value from the confi file. Resolution is not recursive. /// </summary> /// <param name="name">The name to resolve (without the %... %)</param> /// <returns> /// The value to which the name resolves,if the name is supported; otherwise throw an <see cref="InvalIDOperationException"/>. /// </returns> /// <exception cref="InvalIDOperationException"><paramref name="name"/>has not been found in the config file or its value is empty.</exception> public string Resolve(string name) { var resolvedname = CloudConfigurationManager.GetSetting(name); if (string.IsNullOrWhiteSpace(resolvedname)) { throw new InvalIDOperationException("Cannot resolve " + name); } return resolvedname; }}@H_301_12@ 总结以上是内存溢出为你收集整理的azure – 如何为Web作业处理提供基于配置的队列名称?全部内容,希望文章能够帮你解决azure – 如何为Web作业处理提供基于配置的队列名称?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
azure – 如何为Web作业处理提供基于配置的队列名称?
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
![微信扫一扫](/view/img/theme/weipay.png)
![支付宝扫一扫](/view/img/theme/alipay.png)
html – 表单水平内的Bootstrap表单组,给出一个水平滚动条
上一篇
2022-05-27
HTML – 使用Bootstrap的电子邮件模板设计
下一篇
2022-05-27
评论列表(0条)