【问题标题】:Azure App Configuration from Azure functionAzure 函数中的 Azure 应用程序配置
【发布时间】:2021-02-01 18:39:41
【问题描述】:

我正在访问存储在 Azure Appconfiguration 中的配置。我正在使用 Azure 函数中的 SDK (Azure.Data.AppConfiguration)。仿照https://github.com/Azure/azure-sdk-for-net/blob/Azure.Data.AppConfiguration_1.0.2/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md的例子

我不断收到 400 错误。

以下是我的代码

 var client = new ConfigurationClient(_azureAppConfigurationOptions.ConnectionString);
            
            ConfigurationSetting setting = client.
                                        GetConfigurationSetting(
                                            "appid");  

唯一的区别是我从 Azure 函数调用。

感谢任何帮助或见解。

【问题讨论】:

  • 您在哪里看到 400 错误?能否分享一下异常或 HTTP 响应?
  • 你能用下面的答案解决这个问题吗?

标签: azure azure-functions azure-function-app azure-app-configuration


【解决方案1】:

尝试在azure功能中获取配置(应用设置)时,应使用此方法Environment.GetEnvironmentVariable(xxx)

详情请参考this article

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-08
    • 2018-11-24
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 2020-11-20
    • 2021-09-17
    • 2021-01-10
    相关资源
    最近更新 更多