[QUERY] Anonymous requests to storage blobs
See original GitHub issueQuery/Question How do I make anonymous requests to Azure Storage? When I don’t provide any credentials to service client builder, it throws:
BlobServiceClient client = new BlobServiceClientBuilder()
.endpoint("https://<account_name>.blob.core.windows.net")
.buildClient();
Error:
java.lang.IllegalArgumentException: Authorization credentials must be set.
at com.azure.storage.blob.BlobServiceClientBuilder.lambda$buildAsyncClient$0(BlobServiceClientBuilder.java:98)
at com.azure.storage.blob.implementation.util.BuilderHelper.buildPipeline(BuilderHelper.java:61)
at com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(BlobServiceClientBuilder.java:90)
at com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobServiceClientBuilder.java:82)
The below code works with version 8 of the SDK:
CloudBlobClient client = new CloudBlobClient(<endpoint>, StorageCredentialsAnonymous.ANONYMOUS);
Why is this not a Bug or a feature Request? NA
Setup (please complete the following information if applicable):
- OS: Linux
- IDE : IntelliJ
- Version of the Library used: 12.0.0
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
- Query Added
- Setup information Added
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Remediate anonymous public read access to blob data (Azure ...
Learn how to analyze anonymous requests against a storage account and how ... To query logs, you can use an Azure Log Analytics...
Read more >With Azure blob storage, is a general level of privacy ...
Public read access for blobs only: Blob data within this container can be read via anonymous request, but container data is not available....
Read more >Disable Anonymous Access to Blob Containers - Trend Micro
Ensure that anonymous access to blob containers is disabled within your Azure Storage account.
Read more >Azure Blob Storage: detect and prevent public accesses
Blob : anonymous access but requires the attacker to know the full path of the file, not only the container name (URLs in...
Read more >Azure public storage blobs with anonymous access traffic
There are several steps that administrators take to make an Azure Storage Blob publicly accessible. This search identifies storage ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SukruthKS We should have a PR out for this by end of day and it should go out at latest with our February release.
@rickle-msft, you are right, the mentioned error is connected to Jackson (ackson-databind-2.3.1-sources.jar) library that was used with SDK v12.0.
The exception stack trace:
Exception in thread "main" java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;)V from class com.fasterxml.jackson.datatype.jsr310.JavaTimeModule at com.fasterxml.jackson.datatype.jsr310.JavaTimeModule.<init>(JavaTimeModule.java:144) at com.azure.core.implementation.serializer.jackson.JacksonAdapter.initializeObjectMapper(JacksonAdapter.java:258) at com.azure.core.implementation.serializer.jackson.JacksonAdapter.<init>(JacksonAdapter.java:74) at com.azure.core.implementation.serializer.jackson.JacksonAdapter.createDefaultSerializerAdapter(JacksonAdapter.java:108) at com.azure.core.implementation.RestProxy.createDefaultSerializer(RestProxy.java:629) at com.azure.core.implementation.RestProxy.create(RestProxy.java:691) at com.azure.storage.blob.implementation.ServicesImpl.<init>(ServicesImpl.java:58) at com.azure.storage.blob.implementation.AzureBlobStorageImpl.<init>(AzureBlobStorageImpl.java:213) at com.azure.storage.blob.implementation.AzureBlobStorageBuilder.build(AzureBlobStorageBuilder.java:90) at com.azure.storage.blob.specialized.BlobAsyncClientBase.<init>(BlobAsyncClientBase.java:113) at com.azure.storage.blob.BlobAsyncClient.<init>(BlobAsyncClient.java:102) at com.azure.storage.blob.BlobClientBuilder.buildAsyncClient(BlobClientBuilder.java:137) at com.azure.storage.blob.BlobClientBuilder.buildClient(BlobClientBuilder.java:96) at com.azure.storage.blob.BlobClientBuilder$buildClient$0.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
After some experiments, I’ve found out that I used v12.0 instead of the last one and finally realized that my code works perfectly with v12.1 . As far as I understand the issue is already fixed by specifying Jackson dependencies explicitly (https://github.com/Azure/azure-sdk-for-java/commit/0ad7b6c2c32ef23fdd16ee9a19181ec2b9aa477d#diff-79be8518bf311112368782f9251d7480).