How to access storage account (Blob storage) from Java-spring boot app deployed on app service securely?

奥田 章桂美 20 Reputation points
2024-06-15T16:15:14.23+00:00

I’m trying to look for the sample Java-spring app which is able to access blob storage in the secure way.

I also found that only Secret / connection string is acceptable to connect Java-spring app to storage blob in the below doc.

https://learn.microsoft.com/en-us/azure/service-connector/how-to-integrate-storage-blob?tabs=dotnet

I will deploy my app on app service so I’m wondering if I can make connection between app service and blob storage by System-assigned managed identity, User-assigned managed identity or SAS.

App service setting will be networking closed with private end point and vnet integration.

Could you please let me know if it’s possible to use managed IDs or SAS for connecting blob storage in Java-spring boot app? It will be gratitude if you can provide me sample Java-spring source code as well. Thank you for your support.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,941 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,635 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,403 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sreeju Nair 12,176 Reputation points
    2024-06-16T07:15:17.7466667+00:00

    Hi 奥田 章桂美,

    For Java Spring Boot applications, it only support Secret/Connection string as the only authentication method. You may refer it in the same link you shared.

    https://learn.microsoft.com/en-us/azure/service-connector/how-to-integrate-storage-blob?tabs=springBoot#supported-authentication-types-and-client-types

    Refer the below tutorial that helps you to understand how to upload a file from your Spring Boot application to Blob Storage.

    https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-storage?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json

    and Refer the below Github repository for further examples.

    https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/storage

    Hope this helps

    0 comments No comments