Skip to content

Commit 2468c7e

Browse files
committed
fix minor issues
1 parent c875060 commit 2468c7e

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
163163
164164
You will be asked to enter your `userPrincipalName` like your email address (e.g. [email protected]), select two locations, first a region for most of the resources, then a region specifically for the Azure OpenAI models. This project uses the gpt-4o-mini and text-embedding-ada-002 models which may not be available in all Azure regions. Check for [up-to-date region availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability) and select a region accordingly.
165165
166-
5. Set Neon database credentials to Azure environment and redeploy
166+
5. Obtain Neon database credentials and set
167167
168168
Currently, Neon does not support managed identity and automatically assigning database credentials during the deployment. After the first deployment, you need to retrieve credentials manually from the Neon Console and set environment variable values
169169
@@ -196,6 +196,24 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
196196
197197
3. Run `azd deploy` to update these values in the Azure Container App
198198
199+
200+
6. Connect to NeonDB and populate sample data.
201+
202+
1. Create `.env` file in the root directory and update:
203+
204+
```ini
205+
POSTGRES_HOST=[neon_hostname]
206+
POSTGRES_USERNAME=[user]
207+
POSTGRES_PASSWORD=[password]
208+
POSTGRES_DATABASE=[dbname]
209+
POSTGRES_SSL=require
210+
```
211+
2. Run the commands below from the root directory to create a sample database schema and insert some example data. This will help you get started with something ready to test
212+
```ini
213+
python ./src/backend/fastapi_app/setup_postgres_database.py
214+
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
215+
```
216+
199217
## Local Development
200218
201219
### Setting up the environment file

azure.yaml

+1-12
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@ services:
2424
run: cd ../frontend;npm install;npm run build
2525
interactive: false
2626
continueOnError: false
27-
# hooks:
28-
# postprovision:
29-
# windows:
30-
# shell: pwsh
31-
# run: .\scripts\setup_postgres_database.ps1;.\scripts\setup_postgres_azurerole.ps1;.\scripts\setup_postgres_seeddata.ps1
32-
# interactive: true
33-
# continueOnError: false
34-
# posix:
35-
# shell: sh
36-
# run: ./scripts/setup_postgres_database.sh;./scripts/setup_postgres_azurerole.sh;./scripts/setup_postgres_seeddata.sh
37-
# interactive: true
38-
# continueOnError: false
27+
3928
pipeline:
4029
variables:
4130
- DEPLOY_AZURE_OPENAI

infra/core/database/neon/serverlessPostgres.bicep

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ param location string = resourceGroup().location
33
param tags object = {}
44
param userPrincipalName string
55

6-
resource neonOrganization 'Neon.Postgres/organizations@2024-08-01-preview' = {
6+
var neonDatabaseName = 'neon-${name}'
7+
var shouldCreateNeon = empty(neonDatabaseName)
8+
9+
resource neonOrganization 'Neon.Postgres/organizations@2024-08-01-preview' = if (shouldCreateNeon) {
710
location: location
8-
name: 'neon-${name}'
11+
name: neonDatabaseName
912
tags: tags
1013
properties: {
1114
companyDetails: {

0 commit comments

Comments
 (0)