Spring Boot .WAR file based CRUD applications using different database providers that are deployed and tested on Azure.
Below is a list of accessible endpoints for CRUD operations.
Create an Azure Database for MySQL instance and set the following environment variables in the application.yml
file to the below:
-
${MYSQL_HOST}
: The host name of your MySQL server -
${MYSQL_DATABASE_NAME}
: The name of your MySQL database. Themysql
example uses 'springbootwarfiletasks'. Refer to themysql/database
folder. -
${MYSQL_USER}
: The MySQL username -
${MYSQL_PASSWORD}
: Your MySQL password -
Routes:
/
- Root path/api/mysql/task/find
-GET
request to retrieve all todos/api/mysql/task/find/{id}
-GET
request to retrieve a todo by ID/api/mysql/task/delete/{id}
-DELETE
request to remove a todo by ID/api/mysql/task/update/{id}
-PUT
request to update a todo by ID/api/mysql/task/add
-POST
request to add a new todo
Create an Azure Database for PostgreSQL instance and set the following environment variables in the application.yml
file to the below:
-
${POSTGRES_HOST}
: The host name of your Postgres server -
${POSTGRES_DATABASE_NAME}
: The name of your Postgres database. Thepostgres
example uses 'springbootwarfiletasks'. Refer to thepostgres/database
folder. -
${POSTGRES_USER}
: The Postgres username -
${POSTGRESL_PASSWORD}
: Your Postgres password -
Routes
/
- Root path/api/postgres/task/find
-GET
request to retrieve all todos/api/postgres/task/find/{id}
-GET
request to retrieve a todo by ID/api/postgres/task/delete/{id}
-DELETE
request to remove a todo by ID/api/postgres/task/update/{id}
-PUT
request to update a todo by ID/api/postgres/task/add
-POST
request to add a new todo
Create an Azure CosmosDB API for MongoDB instance and set the following environment variables in the application.yml
file to the below:
-
${COSMOS_HOST}
: The name of your CosmosDB host. Thecosmosdb
example uses 'cities' as the database name and 'Cities' as the Collection name. -
${COSMOS_PASSWORD}
: Your Azure CosmosDB password -
Routes:
/
- Root path/api/cosmosdb/cty/find
-GET
request to retrieve all cities./api/cosmosdb/city/find/{id}
-GET
request to retrieve a city by ID (Note: doing any operation byid
is done by the random ID generated by CosmosDB - ex: '61661a0a09ea36345866f67c'/api/cosmosdb/city/delete/{id}
-DELETE
request to remove a city by ID/api/cosmosdb/city/add
-POST
request to add a new city