The Backend Service provides the following APIs:
- Customer API: Retrieve customer data.
- Product API: Retrieve product details.
- Product Vector API: Retrieve a list of similar products using vector-based search.
The backend connects to Azure Blob Storage and Azure Cosmos MongoDB using Key Vault references with Managed Identity.
- Java 17
- Maven
- Azure Key Vault with necessary secrets
- Managed Identity configured in Azure
-
Clone the repository:
git clone https://github.com/Azure-Samples/Java-AI-Based-Content-Generator cd Java-AI-Based-Content-Generator/backend -
Key Vault Setup: Before adding or accessing secrets in Key Vault, follow the setup instructions in the Azure Key Vault Setup Guide, which include:
- Assigning the necessary Key Vault Administrator and Key Vault Reader roles.
- Adding the required secrets for the backend service.
-
Environment Variables for Local Development: Set the required Azure environment variables to access secrets from Key Vault:
export AZURE_KEYVAULT_URL=<your_keyvault_url>
-
Run the Application:
- Install dependencies:
./mvnw clean install
- Run the application:
./mvnw spring-boot:run
The service will now be running at
http://localhost:8080. - Install dependencies:
The middleware service requires the following secrets in Azure Key Vault:
MiddlewareServiceBaseUrl:http://localhost:8081(for local), or middleware APIM URL (for deployment)MiddlewareServiceProductEmbeddingEndpoint:/api/v1/generate/embedding(for local), or the middleware APIM endpointMiddlewareServiceAccessKey: The middleware APIM access key. For local development, this value does not need to be set.AzureCosmosConnectionStringMongoDBDatabaseNameStorageAccountNameStorageContainerName
- For Azure App Service deployment, see app_service.md.
- For AKS deployment, see aks.md.