minimalistic application.yml:
spring:
application:
name: your-microservice-name
profiles:
active: ${SPRING_PROFILE}
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI}
instance:
hostname: ${HOST_NAME}
management.endpoints.web.exposure.include: health,info
---
server:
port: 80
spring:
config:
activate:
on-profile: azure
- Create or use a docker hub account to generate an Access Token for azure and cli login.
- Build a docker image with parameter
--platform linux/amd64
and set a tag with following pattern: ?username/image_name:image_version
eg.:docker build --platform linux/amd64 -t querslider/lending-service:latest-amd64 .
- Login to docker hub via
docker login
with your created Access Token for your cli. - Push the docker container to your docker hub account eg.:
docker push username/lending-service:latest-amd64
- Create a Azure Web App
- Choose
Docker Container
- Click
Next
, notReview + Create
- Go into the tab Docker
- Set Options as Single Container
- Set Image Source as
Docker Hub
- Set Access Type as
Private
- Set your username and set your generate Access Token as password
- Set the image tag as username/image_name:image_version
- Finish by creating the Web App
- Choose
- Go to the created Web App into the Configuration and set the following environments variables
- Set
HOST_NAME
to theDefault Domain
found at theOverview
page of the Web App - Set
WEBSITES_PORT
to80
- Set all left variables used inside the
application.yml