Azure / Azure/apiops

[BUG]EventHub logger with managed identity connection failing to publish

Open
#638 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
448
Forks
247
PR merge metrics
No merged PRs in 30d

Description

### Release version

v6.0.1

### Describe the bug

When you extract an event hub logger that has a managed identity connection, the JSON is slightly different than using a connection string. It appears that the actual Named Value name is saved with it instead of the Named Value display name as it is with the connection string. Here is an example of the difference in the credentials property:

EH MI:
```json
"credentials": {
"endpointAddress": "",
"identityClientId": "{{XXXXXXXXXXXXXXXXXXXXXXXX}}",
"name": "myeventhub"
}
```

EH ConnectionString:
```json
"credentials": {
"instrumentationKey": "{{Logger-Credentials--XXXXXXXXXXXXXXXXXXXXXXXX}}"
}
```

### Expected behavior

The publisher would lookup the Named Value name instead of the display name if the credentials property contains the identityClientId and use that when it creates/updates the resource.

### Actual behavior

I get a 400 as a response code to the PUT request. Here is an example error:

```bash
Content: {"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"One or more Properties ['{0}'] specified are missing.","message":"XXXXXXXXXXXXXXXXXXXXXXX"}]}}
crit: publisher[0]
```

### Reproduction Steps

- Create an event hub logger with a managed identity connection
- extract the configuration
- run the publisher

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.