azure - How can I override the host settings of my azure function locally?
问题描述
Say you have a host.json file like this:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"messageHandlerOptions": {
"maxConcurrentCalls": 16,
"maxAutoRenewDuration": "00:05:00"
}
}
}
}
But you wish to override the setting locally in local.settings.json
or in the settings for a given environment on Azure. Is it possible, and how do you do it?
解决方案
It is possible, but poorly documented. Fabio Cavalcante describes it in a comment here.
You simply have to prefix the setting with AzureFunctionsJobHost
in your local.settings.json
file (or on Azure) like this:
{
"IsEncrypted": false,
"Values": {
"AzureFunctionsJobHost:Extensions:ServiceBus:MessageHandlerOptions:MaxConcurrentCalls": 32,
"AzureFunctionsJobHost:Extensions:ServiceBus:MessageHandlerOptions:MaxAutoRenewDuration": "00:10:00"
}
}
You can also use double underscore (__
) instead of colon (:
).
推荐阅读
- python - 尝试从函数分配时全局变量不起作用
- javascript - 在 JavaScript 中导入 Azure 密钥保管库模块的问题
- java - Firebase 依赖项没有出现?
- html - CSS 媒体查询在 GRID 中没有响应
- struct - 用于将嵌套结构转换为查询的 udf 或 inbuild 函数
- azure-cosmosdb - EF Core Cosmos DB 提供程序是否支持 Cosmos DB 的新批量 API?
- mysql - 如何设置指向不同模式中的表的外键约束?
- amazon-web-services - 在 ECS 上设置 CI/CD 管道的最佳方法是什么?
- javascript - CSS/Canvas:隐藏元素但使用其计算样式
- javascript - 为什么边距不一致?