Skip to content

[AppConfig]: Error while reading Settings from Azure App Configuration #17424

@ThorstenHans

Description

@ThorstenHans

Bug Report

Environment

go 1.17

require (
	github.com/Azure/azure-sdk-for-go/sdk/appconfig/azappconfig v0.1.0
	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.22.0
	github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0
)

What happened?

Reading settings from Azure App Configuration (AppConfig) does not work. When using a connection string for authentication, requests fail with an HTTP 401 and HMAC-SHA256 error="invalid_token", error_description="Invalid Credential" provided as in the response header.

When authenticating with azidentity same underlying request fail with an HTTP 403. I had azidentity configured to re-use existing authentication token from Azure CLI (az).

Reading the same setting works perfectly fine via az appconfig kv show

What did you expect or want to happen?

I expect to retrieve the setting from AppConfig 😄

How can we reproduce it?

Here the fragment of the code used for authenticating with a connection string

func test(ctx context.Context, key string, label string, connectionString string) {
	client, err := azappconfig.NewClientFromConnectionString(connectionString, nil)
	// removed err handling because it does not matter for this conversation
	res, err := client.GetSetting(ctx, azappconfig.Setting{
		Key:   to.StringPtr(key),
		Label: to.StringPtr(label),
	}, nil)
	if err != nil {
		fmt.Printf("Error while reading setting: %s", err)
	}
}

Anything we should know about your environment.

local: I tested it on latest macOS (Intel)
cloud: see the following az script to spin up the required services:

appCfgName=foobar
rgName=rg-appcfg-sample
location=germanywestcentral

az group create -n $rgName -l $location
az appconfig create -n $appCfgName -g $rgName -l $location --sku Standard

Metadata

Metadata

Assignees

Labels

App ConfigurationAzure.ApplicationModel.ConfigurationClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions