question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Unable to get the keys of App Configuration

See original GitHub issue

Library name and version

Azure.ResourceManager.AppConfiguration 1.0.0

Describe the bug

Hello,

I am evaluating Azure.ResourceManager.AppConfiguration to see if I can use it manage a few instances of Azure App Configuration using C#. Basically I need to get the access keys and create/update/delete/get/list key-values.

I was able to create/update/get/delete a key-value without issues however I am unable to get the list of every key-values: calling GetAll returns a 404.

I tried calling the ‘list endpoint’ manually using the Try it out button from this page and I also get a 404 error so perhaps the issue is not with the library but with Azure itself.

Expected behavior

The expected behavior is getting the list of key-values.

Actual behavior

A 404 exception is thrown.

Reproduction Steps

You can use the code below to reproduce the issue:

I created a .Net 6 console app (LinqPad) with the Azure.ResourceManager.AppConfiguration@1.0.0 and Azure.Identity@1.7.0 Nuget packages.

	var creds2 = ...; // fill in with your usual way to get an identity in a console app, I'm using UsernamePasswordCredential for my tests
	var subscriptionName = "...";
	var rgName = "...";
	var appCfgName = "...";

	ArmClient armClient = new ArmClient(creds2);
	var subscriptions = armClient.GetSubscriptions();
	var subscription = subscriptions.First(x => String.Equals(x.Data.DisplayName, subscriptionName, StringComparison.OrdinalIgnoreCase));
	
	var rg = subscription.GetResourceGroup(rgName).Value;
	var store = rg.GetAppConfigurationStore(appCfgName).Value;
	
	var allKeyValues = store.GetAppConfigurationKeyValues().GetAll();
	
	foreach(var kv in allKeyValues) // an exception is thrown with a 404
	{
		Console.WriteLine(kv.Data.Key);
	}

Environment

I’m using LinqPad 7 and I’m targeting .Net 6 on Windows 10.

Output of dotnet --info:

.NET SDK (reflecting any global.json):
 Version:   6.0.401
 Commit:    0906eae6f8                                                                                                                                                                                                                          Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.401\

global.json file:
  Not found

Host:
  Version:      6.0.10
  Architecture: x64
  Commit:       5a400c212a

.NET SDKs installed:
  3.1.424 [C:\Program Files\dotnet\sdk]
  5.0.203 [C:\Program Files\dotnet\sdk]
  5.0.214 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]
  6.0.110 [C:\Program Files\dotnet\sdk]
  6.0.305 [C:\Program Files\dotnet\sdk]
  6.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
navba-MSFTcommented, Dec 29, 2022

@orck-adrouin Thanks for getting back. I am glad that the above workaround has unblocked you for the time being. After I did some research on this, I found that the Azure Portal was using the below REST API call underneath to fetch the keys:

/subscriptions/XXXXX-XXX-XXXX-XXXXX/resourceGroups/Compute-Resources/providers/Microsoft.App/containerApps/MySampleApp/listSecrets?api-version=2022-06-01-preview

I am checking this internally with the product group and I will keep you posted.

0reactions
msftbot[bot]commented, Dec 30, 2022

Hi @orck-adrouin. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to read the keys in app.config
My program is not able to read the keys that are in the app.config file which looks like this:
Read more >
app config not able to read in visual studio
I made app.config file in Unit Test Folder and I wrote connection string and key value pairs in that file.
Read more >
Unable to create a new key-value using the Configuration ...
I'm trying to create the config values by clicking the 'Create' button in the Configuration explorer. The create blade opens up.
Read more >
How to Fix Steam "app configuration unavailable" Error
Try activating the key again and see if that fixes the error. The DLC has not been released. Sometimes, users get the “Steam...
Read more >
Error Messages | Maps JavaScript API
Need help from a human? Go to the Google Maps Platform Support page. This error messages page is for reference only. It's here...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found