This is a simple implementation of a Blob Storage Service. It is a RESTful service that allows you to upload file in Blob and get its URL back. It also provide to generate a SAS token URL with Read permission.
To run the Blob Storage Service locally, you need first to build the common module and then start the service. Follow the instructions below in the order they are presented:
-
Ensure that the Eurka Server is running. If not, start the Eureka Server
-
Start the Blob Storage Service in folder
src/blob-storage-service/using thelocalprofile. Thelocalprofile uses the local file system instead of Azure Blob Storage, so no Azure storage environment variables are needed:./mvnw spring-boot:run -Dspring-boot.run.profiles=local -DskipTests
Alternative: connect to real Azure Blob Storage
If you want to connect to an actual Azure Storage account instead of using the local file system, skip the local profile and set the following environment variables:
export STORAGE_ACCOUNT_NAME=<your-storage-account-name>
export STORAGE_ACCOUNT_ENDPOINT=<your-storage-account-endpoint>
export STORAGE_ACCOUNT_CONTAINER_NAME=<your-storage-account-container-name>Then start the service without the local profile:
./mvnw spring-boot:run -DskipTests-
Set the following environment variables:
CONTAINER_REGISTRY_NAME=<your-acr-name> TAG=1.1.0
-
Login to Azure Container Registry
az acr login --name $CONTAINER_REGISTRY_NAME -
Build the image
docker build -t $CONTAINER_REGISTRY_NAME.azurecr.io/blob-storage-service:$TAG .
-
Push the image
docker push $CONTAINER_REGISTRY_NAME.azurecr.io/blob-storage-service:$TAG