1

I am using Quickstart: Create an ASP.NET Core app with Azure App Configuration

I have created an Azure App Configuration for centralized storage and management of application settings for an ASP.NET Core app. I have coded an app instance (tutorial code) using Visual Studio 2019 which runs locally.

My Azure App Configuration has been configured in the portal with identity on. I have no role assignments.

When I run my tutorial app in Visual Studio with debugging I get 3 lines of:

Exception thrown: 'Azure.Identity.CredentialUnavailableException' in System.Private.CoreLib.dll

Exception thrown: 'System.Net.Sockets.SocketException' in System.Net.Sockets.dll

Followed by a lot more cancels than actual exceptions and including this cancel which I cant see the matching exception for:

Exception thrown: 'System.OperationCanceledException' in System.Net.Http.dll

The browser launches. The layout is present but no data. I have relaunched many times over the day. I think I can exclude any network issues. The output is consistent each time.

I have done various searches and found no information regarding this error. Since I've come to a dead end, for now anyway, I thought I'd try here.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dave
  • 687
  • 7
  • 15
  • I should have said. Only 2 packages installed. Azure.Identity 1.5.0 & Microsoft.Azure.AppConfiguration.AspNetCore 4.5.0 – Dave Oct 24 '21 at 04:37
  • 1
    Have you linked the right article? It uses access keys and not azure identity. – YK1 Oct 24 '21 at 05:12
  • Have followed the tutorial exactly. The only mention of 'article' relates to the publication of the same Microsoft tutorial. User secret set in project file, Secret Manager stores ConnectionStrings:AppConfig, Program.cs & Views/Home/Index.cshtml are the other files. That's it. – Dave Oct 24 '21 at 06:04
  • Tutorial does not mention about Azure.Identity, why do you have it installed then? – YK1 Oct 24 '21 at 08:39
  • Just one of those changes made when trying to work out what could be wrong. I began testing with it set to off as I assumed it wasn't required. During the course of reading ref docs/debugging I set identity on. Just reporting the true state of my setup to be true to this post. When you say "article". What exactly do you mean? – Dave Oct 24 '21 at 17:27
  • By "Article", I meant the MSDN page you linked, what you call "tutorial", same thing. :) – YK1 Oct 25 '21 at 01:55

1 Answers1

0

I fixed this by stripping everything back until problems were eliminated.

If I was answering this question (with hindsight being a great thing) I would say:

  • only have the key values you need in App Config > Config Explorer
  • check connection string
  • ask yourself why you have added any additional packages installed (VS suggesting fixes suggests wrong code choice. So that's how Azure.Identity package was included along the way)

As far as my "setting identity on". I think I'm still confused between Identity and Authentication Type. On App Configuration > Access Keys page:

Azure AD and access keys can both be used for authentication in App Configuration. Azure AD is always enabled, while access keys are conditional and can be enabled/disabled with the toggle below.

Since Azure AD is always enabled I take it that it plays no part when I'm using access keys. Also I don't understand where the local app's secrets.json secret is used. As far as I can see the Azure App Configuration has no reference for this.

Thank you @YK1 for your input.

Dave
  • 687
  • 7
  • 15
  • Awesome, happy that its fixed. Yes, Identity is different than authentication, but related. When you set an Identity on an Azure resource (managed identity), that resource assumes that identity and has access to any other resources for which that Identity is given access to. For example, if you set on identity on a web app and give access to that identity to Key vault, then the web app can access the key vault without access keys. – YK1 Oct 25 '21 at 01:59