I have uploaded the files on azure blob container but how can I get the url of a that uploaded file using java. I have connectionString of the azure portal.
Can anyone help me?
Here I use the Azure Blob storage v12, you could refer to the below code. Further more information about this SDK you could check this source code:Azure Storage Blob client library for Java.
String connectStr = "storage account connection";
// Create a BlobServiceClient object which will be used to create a container client
BlobServiceClient blobServiceClient = new BlobServiceClientBuilder().connectionString(connectStr).buildClient();
BlobContainerClient containerClient = blobServiceClient.getBlobContainerClient("container name");
BlobClient blobClient=containerClient.getBlobClient("blob name");
System.out.println(blobClient.getBlobUrl());
You can try
String blobKey = <key to your blob>
// Create a blob service client
CloudBlobClient blobClient = account.createCloudBlobClient();
CloudBlobContainer container = blobClient.getContainerReference(name);
// get reference to the Blob you want to generate the SAS for:
CloudBlockBlob blob = container.getBlockBlobReference(blobKey);
and call
blob.getUri();