Azure的功能,CosmosDB触发:如何存储在keyvault连接字符串

问题描述 投票:1回答:2

对于宇宙DB触发功能的框架代码是:

[CosmosDBTrigger(
            databaseName: "databaseName",
            collectionName: "collectionName",
            ConnectionStringSetting = "string",
            LeaseCollectionName = "leases")]

ConnectionStringSetting仅限于这里为AppSetting。我想去关键金库抓住这个秘密。

该属性的言论表明,有使用CosmosDBOptions方式:

    /// Optional. A string value indicating the app setting to use as the CosmosDB connection string, if different
    /// than the one specified in the <see cref="CosmosDBOptions"/>.

但目前还不清楚如何使用Azure的功能范围内该类。

这可能吗?

azure-functions azure-cosmosdb
2个回答
2
投票

现在的解决方案是在Azure中提供的功能

你可以把你所有的钥匙,秘密和证书到关键库,并通过KEYVALUE URL访问(与管理身份)。随着管理的身份,你并不需要存储KeyVault凭证在Azure的功能配置。

Key Vault Secrets in Azure Function with Manage Identity


1
投票

所述CosmosDBOptions是指能够在host.json级别设置的配置。

目前,它是无法从Azure的关键库设置连接字符串,但它是我们希望包括特征。

© www.soinside.com 2019 - 2024. All rights reserved.