Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

POC `todo-java-postgresql-aca` AZD template #32027

Closed fangjian0423 closed 1 year ago

fangjian0423 commented 2 years ago

Context

ADZ have 2 templates about Java language.

All of them store the todo data in mongodb.

Goal

We want to changed the mongodb to postgresql, and also using passwordless.

Solution

fangjian0423 commented 1 year ago

PostgreSQL Flexible Server Passwordless can't created by terraform and bicep now.

PostgreSQL Single Server Passwordless support creating by terraform and bicep now.

So we may don't support passwordless this sprint, just use username and password on postgresql flexible server.

fangjian0423 commented 1 year ago

Now the todo-java-postgresql-aca template can work.

Architecture:

image

Next is make the template production ready.

Here is a step list:

  1. Remove Key Vault, and use passwordless, but as the comment mentioned, only postgresql single server support passwordless now. I think single server and flexible server are mostly same for bicep, we can have a step list to describe what we should do to support passwordless
  2. Move out where cosmos appears in repository, like readme, architecture diagram, java code
  3. Github repository move to Azure-Samples org, not on personal account
  4. Code review
  5. Publish to Awesome AZD Templates
fangjian0423 commented 1 year ago

We can avoid using deploymentscripts if we could use Service Connector to do the passwordless connection.

Unfortunately, Service Connector didn't support ARM tempalte/bicep now.

fangjian0423 commented 1 year ago

Notice that terraform azurerm now support PostgreSQL Flexible Server Passwordless.

Maybe terraform is more fit for us to do the infrastructure provisioning 😅

fangjian0423 commented 1 year ago

Close the issue because todo-java-postgresql-aca-terraform and todo-java-postgresql-terraform template run successfully.