Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TableServiceClientBuilder.buildAsyncClient() disobeyes azureNamedKeyCredential #22384

Closed
3 tasks done
ohl-nemeses opened this issue Jun 18, 2021 · 4 comments · Fixed by #22492
Closed
3 tasks done
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Tables

Comments

@ohl-nemeses
Copy link

ohl-nemeses commented Jun 18, 2021

Describe the bug
TableServiceClientBuilder does not obey azureNamedKeyCredential is no connection string is set.

IMHO https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClientBuilder.java#L112 should be:

AzureNamedKeyCredential namedKeyCredential = azureNamedKeyCredential;

Exception or Stack Trace

java.lang.IllegalStateException: A form of authentication is required to create a client. Use a builder's 'credential()', 'sasToken()' or 'connectionString()' methods to set a form of authentication.
        at com.azure.data.tables.BuilderHelper.buildPipeline(BuilderHelper.java:97)
        at com.azure.data.tables.TableServiceClientBuilder.buildAsyncClient(TableServiceClientBuilder.java:158)
        at com.hybris.cloud.automation.siemforwarder.inbound.AssignmentHandler.retrieveAll(AssignmentHandler.java:52)
        at com.hybris.cloud.automation.siemforwarder.inbound.StorageAccountSiemMessageSource.retrieveMessages(StorageAccountSiemMessageSource.java:34)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:386)
        at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:281)
        at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:860)
        at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:421)
        at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:686)
        at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.onNext(FluxFlattenIterable.java:250)
        at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:251)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

To Reproduce
Steps to reproduce the behavior:

new TableServiceClientBuilder()
            .credential(new AzureNamedKeyCredential(accountName, accountKey))
            .endpoint(tableEndpoint)
            .buildAsyncClient();

fails... while as

new TableServiceClientBuilder()
            .connectionString("AccountName="+accountName+";AccountKey="+accountKey)
            .endpoint(tableEndpoint)
            .buildAsyncClient();

works nicely.

Code Snippet
see above.

Expected behavior
TableServiceAsyncClient created. No exception thrown.

Screenshots
Not relevant.

Setup (please complete the following information):

  • OS: Windows 10.
  • IDE: eclipse
  • Library/Libraries: com.azure:azure-data-tables:12.0.0

Additional context
None.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 18, 2021
@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Tables labels Jun 18, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 18, 2021
@alzimmermsft alzimmermsft added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jun 18, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 18, 2021
@alzimmermsft alzimmermsft removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Jun 18, 2021
@alzimmermsft
Copy link
Member

@vcolin7 could you take a look at this

@vcolin7
Copy link
Member

vcolin7 commented Jun 22, 2021

Hi @ohl-nemeses, thank you for reporting this issue. I have an open pull request with a fix and will ship it with the next version of Azure Data Tables early next month.

@ohl-nemeses
Copy link
Author

Thx!

@ohl-nemeses
Copy link
Author

Fixed in 12.1.0

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Tables
Projects
None yet
3 participants