How to allow blob public access when creating storage account via java sdk

Sashin Sahasra 21 Reputation points
2021-07-14T05:16:17.18+00:00

Currently, I'm writing an script to create storage account in azure cloud by using azure java sdk. I need to enable 'allow blob public access' property when creating the storage account. Is there any approach I can take by for this using java sdk?

114359-capture03.png

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 47,466 Reputation points Microsoft Employee Moderator
    2021-07-14T14:14:22.183+00:00

    @ Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Public read access to blob data is an optional setting that can be enabled on a container. While convenient for sharing data, public read access carries security risks. For enhanced security, you can now choose to disallow public access to blob data in a storage account. After you disallow public access for a storage account, all requests for blob data must be authorized regardless of the container’s public access setting. Any subsequent anonymous requests to that account will fail.

    By default, a storage account allows public access to be configured for containers in the account, but does not enable public access to your data. Public access to blob data is never permitted unless you take the additional step to explicitly configure the public access setting for a container.

    Microsoft recommends that you disallow public access to a storage account unless your scenario requires it. Disallowing public access helps to prevent data breaches caused by undesired anonymous access. Learn more

    A container's permissions are configured for private access by default, but you can easily configure a container's permissions to allow public, read-only access for all users on the Internet: Configure a container for public access

    In this article, you learn to manage blobs by using Java. Blobs are objects that can hold large amounts of text or binary data, including images, documents, streaming media, and archive data. You'll upload, download, and list blobs, and you'll create and delete containers. Manage blobs with Java v12 SDK

    Azure Storage SDK Client library for Java

    The Azure Storage libraries for Java provide classes for working with data in your your Azure storage account, and with the storage account itself. For more information about Azure Storage libraries for Java

    The article provide several code snippets covering some of the most common Azure Storage Blob tasks, including: Examples

    If you still find any difficulties, please let me know I would like to work closer on this issue

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.

    ------------------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.