I am new to Azure security and wanted to know how to access resources like Key vault or Storage account container without connection string.
Model 1 – connection string
azure:
storage:
connection-string: efau;AccountName=sprin..ge;AccpointSuffix=core.windows.net
container-name: files
Code:
//service
new BlobServiceClientBuilder().connectionString(azureStorageConnectionString).buildAsyncClient();
// client
return blobServiceClient().getBlobContainerAsyncClient(azureStorageContainerName);
//download
BlobAsyncClient blobAsyncClient = blobContainerAsyncClient.getBlobAsyncClient(fileName);
return blobAsyncClient.downloadContent().block().toBytes();
This is ok.(conn String model)
I want to use Entra ID. Application -> Entra -> Storage account
I made these modifications ( configuration on portal is done)
spring:
cloud:
azure:
active-directory:
enabled: true
profile:
tenant-id: fa33eae07d908b94f0
credential:
client-id: 41c1b67-078d9e3822be
client-secret: Tuw8Q~4VuXt0q0VsLegtlc7L
I don’t know what beans to create.
return new DefaultAzureCredentialBuilder().build();
But I am getting challenged for credentials. Is this correct?
How to avoid getting challenged and connect using the supplied properties , and download the blob?