Azure函数ServiceBustrigger连接字符串值不在应用程序设置中

发布于 2025-01-23 04:00:57 字数 624 浏览 0 评论 0原文

在我通过PowerShell>部署功能应用程序之前ARM模板我动态获取服务总线连接字符串,并在function.json文件中的连接绑定中更新值。然后,我部署功能应用程序和函数。

部署有效,但是功能应用程序返回错误消息:

Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'Endpoint=sb://sbname.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;[Hidden Credential]' is missing or empty.

问题是:我们是否真的必须在功能应用程序上使用此连接字符串创建应用程序设置?除了使用应用程序设置之外,没有其他选择吗?

感觉就像将连接字符串存储在另一个位置,而不是在服务总线上创建另一个漏洞。 我知道我可以在function.json文件中定义“连接”:“ rootmanageHaredAccesskey_servicebus”,然后创建一个具有相同名称的应用程序设置,但这不是我想要前进的方式。

Before I deploy a function app and functions through PowerShell > ARM template I dynamically get a service bus connection string and update the value in the connection binding in the function.json file. Then I deploy the function app and function.

Deployment works, but the function app returns an error message:

Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'Endpoint=sb://sbname.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;[Hidden Credential]' is missing or empty.

The question is: Do we really have to create an application setting on the function app with this connection string in it? Is there no other option than using the app setting?

It feels like storing the connection string in another location than on the service bus would just create another vulnerability.
I am aware that I could define "connection": "RootManageSharedAccessKey_SERVICEBUS" in the function.json file and then create an app setting with that same name, but that's not the way forward I want to go.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浴红衣 2025-01-30 04:00:57

请检查我的发现是否有助于

  • 您可以使用 azure键库服务 azure App App配置服务。

  1. 您可以存储机密值,例如连接字符串,键值对,客户端秘密,证书密码等。

假设您已将ServiceBus连接字符串存储在密钥库中。您需要通过应用程序设置在函数应用程序中检索,但是在应用程序设置中,您可以定义为:

"connection": @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/RootManageSharedAccessKey_SERVICEBUS/)

此键Vault URI无法由任何其他用户访问 。 /em>或 用户分配的托管身份 权限。

  1. Azure应用程序配置是您可以管理应用程序设置并在一个地方保护其访问的中心地点。请参阅此处有关更多信息。

Please check if my findings help to:

  • Instead of storing the Service Bus Connection String directly, you can utilize the Azure Key Vault Service or Azure App Configuration Service.

  1. You can store the confidential values like Connection Strings, Key-value pairs, Client Secrets, Certificate Passwords, etc. in Azure Key Vault.

Assume you have stored the ServiceBus connection string in the Key Vault. That you want to retrieve in the Function App through Application Settings but here in the app setting you can define as:

"connection": @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/RootManageSharedAccessKey_SERVICEBUS/)

This KeyVault URI cannot be accessed by any other user until they are assigned with System or User Assigned Managed Identity Permission.

  1. Azure App Configuration is a central place where you can manage application settings and secure their accesses in one place. Refer here for more information.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文