[ 
https://issues.apache.org/jira/browse/CAMEL-27749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152258#comment-18152258
 ] 

Claus Ibsen commented on CAMEL-27749:
-------------------------------------

Merged in https://github.com/apache/camel/pull/31053 as 
https://github.com/apache/camel/commit/a2e39ecb53292ec2b24fb16e84a365877ef0bbbc,
 fixed in 4.24.0.

_Claude Code on behalf of Claus Ibsen_

> camel-azure-eventgrid, camel-azure-servicebus, camel-azure-eventhubs: a 
> DefaultAzureCredential set as tokenCredential is not used
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27749
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27749
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-azure, camel-azure-eventhubs, 
> camel-azure-servicebus
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.24.0
>
>
> When the {{tokenCredential}} option is a {{DefaultAzureCredential}}, the 
> components set {{credentialType}} to {{AZURE_IDENTITY}} 
> ({{EventGridComponent.createEndpoint()}}, {{ServiceBusComponent}}, 
> {{EventHubsComponent}}). For {{AZURE_IDENTITY}}, the clients are then built 
> with a new {{new DefaultAzureCredentialBuilder().build()}} 
> ({{EventGridProducer.createEventGridPublisherClient()}}, 
> {{ServiceBusClientFactory}}, {{EventHubsClientFactory}}). So a credential 
> that the user built with {{.managedIdentityClientId(...)}}, 
> {{.tenantId(...)}} or other settings is not used.
> In camel-azure-eventgrid this also happens with an explicit 
> {{credentialType=TOKEN_CREDENTIAL}}, as the component replaces it with 
> {{AZURE_IDENTITY}} for a {{DefaultAzureCredential}}.
> Fix: with {{AZURE_IDENTITY}}, use the {{tokenCredential}} instance when it is 
> set, and build a new DefaultAzureCredential only when it is not. In 
> eventgrid, keep an explicit {{TOKEN_CREDENTIAL}} or {{AZURE_IDENTITY}}.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to