0

I have created Azure App configuration and sets Key and value pairs. I have also created a HTTP Azure function via VS 2019 and write below code.

using Microsoft.Extensions.Configuration;
using Azure.Identity;

var config = new ConfigurationBuilder().AddAzureAppConfiguration(options =>
{
    options.Connect(new Uri("https://xxx-xxx-azf-global-parameters.azconfig.io"),
    new ManagedIdentityCredential());
}).Build();
string str = config["AzfApp:Cloud"].ToString();
log.LogInformation("AzfApp:Cloud:" + config["AzfApp:Cloud"].ToString());

Enable System assigned Identity of Azure Function. The identity I am using via ManagedIdentityCredential is assigned to both the Azure App Configuration Data Reader and Azure App Configuration Data Owner roles. But above my code is not working Azure portal. I have capture the error via log information.

Error message :Retry failed after 3 tries. (No such host is known.) (No such host is known.) (No such host is known.)Source=Azure.CoreStackTrace:at Azure.Core.Pipeline.RetryPolicy.

Please help on this how do I resolve the issue.

abatishchev
  • 98,240
  • 88
  • 296
  • 433

1 Answers1

0

I test in my site with your code and it works very well. enter image description here

Go to azure app configuration and double check that you have assign Azure App Configuration Data Reader to the function's Identity.

enter image description here

And the output screenshot is as below:

enter image description here

Joey Cai
  • 18,968
  • 1
  • 20
  • 30