0

I have a simple microservice to read json and save it in a local postgresdb but now i want to use azure postgres and i have already created a database in azure. How can i migrate from local db to azure cloud db ?

Application property file looks like this

spring.datasource.url=jdbc:postgresql://localhost:5432/MyDB
spring.datasource.username=postgres
spring.datasource.password=1234
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.platform=postgres

Azure database properties

Server name : myapp.postgres.database.azure.com
Admin username: adminmyapp@myappdb
password: 123456

I'm new to programming so i need to know how to connect azure cloud db from my microservice

Jordan Mong
  • 55
  • 1
  • 7
  • 1
    use the azure connection information in `application.properties`. Or even better: externalize those configurations by making them overrideable through environment variables. – Turing85 Apr 01 '21 at 13:43
  • Thanks! But how can i make them override environment variables ? – Jordan Mong Apr 01 '21 at 13:48
  • See, e.g., [this question](https://stackoverflow.com/questions/35531661/using-env-variable-in-spring-boots-application-properties) – Turing85 Apr 01 '21 at 13:54

0 Answers0