我正在关注Use managed identities to access app configuration。对于第 5 步,我已将我的函数 FilterFunction 分配为具有 App Configuration Data Reader 角色:
我的函数在启动时的代码如下:
var appConfigEndpoint = Environment.GetEnvironmentVariable("Endpoint");
var environment = Environment.GetEnvironmentVariable("Environment");
var sentinelValue = Environment.GetEnvironmentVariable("ConfigSentinelKey");
builder.ConfigurationBuilder.AddAzureAppConfiguration(options =>
{
// Load the configuration using labels
options.Connect(new Uri(appConfigEndpoint), new ManagedIdentityCredential())
.ConfigureRefresh(refreshoptions => refreshoptions.Register(
key: sentinelValue,
label: environment,
true))
.Select(KeyFilter.Any, environment);
});
但是,当我将函数发布到 Azure 时,我看到以下错误:
为什么我会收到此错误?