How to mount spring boot log to azure blob storage

Viewed 46

I have a spring boot app, which I want to run in azure container instance and mound the log dir to the azure blob storage, so that when container is redeployed logs are retained.

Error I am getting : Failed to mount azure file volume what is missing can you please point out?

Spring boot app log config

logging.level.root = info
logging.file.name=/var/log/app.log

Docker file

FROM openjdk:17
ARG JAR_FILE=target/api-1.0.0.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
EXPOSE 80

Create azure container instance with the following command

az container create --resource-group rg-westeurope-mycomp-dev  --name ci-mycomp-ingestion-api-dev --image crmycomp.azurecr.io/ingestion-api:latest --cpu 1 --memory 1 --os-type Linux --port 80 --subnet sn-westeurope-mycomp-dev --vnet vnet-westeurope-mycomp-dev --azure-file-volume-account-name scwesteuropemycompdev --azure-file-volume-account-key xxxxxx --azure-file-volume-share-name app-logs/ingestion-api-dev   --azure-file-volume-mount-path   /var/log/

Azure Blob is created enter image description here

0 Answers
Related