Skip to content

Commit 54efaf5

Browse files
committedApr 7, 2025·
Fix azd provision issue
1 parent 93ed98b commit 54efaf5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed
 

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,12 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
190190
azd env set POSTGRES_PASSWORD [password]
191191
azd env set POSTGRES_DATABASE [dbname]
192192
azd env set POSTGRES_SSL require
193+
azd env set DEPLOY_NEON_SERVERLESS_POSTGRES false
193194
```
194195
195196
After this, redeploy your app, and it will be connected to the Neon database.
196197
197-
3. Run `azd deploy` to update these values in the Azure Container App
198+
3. Run `azd provision` to update these values in the Azure Container App
198199
199200
200201
6. Connect to NeonDB and populate sample data.

‎infra/core/database/neon/serverlessPostgres.bicep

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

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

‎infra/main.bicep

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ param openAIResourceGroupName string = ''
5656
@description('Whether to deploy Azure OpenAI resources')
5757
param deployAzureOpenAI bool = true
5858

59+
@description('Whether to deploy Neon Serverless Postgres resource')
60+
param deployNeonServerlessPostgres bool = true
61+
5962
@allowed([
6063
'azure'
6164
'openaicom'
@@ -173,7 +176,7 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
173176

174177
var neonServerlessPostgresName = '${prefix}-db'
175178

176-
module neonPostgres 'core/database/neon/serverlessPostgres.bicep' = {
179+
module neonPostgres 'core/database/neon/serverlessPostgres.bicep' = if (deployNeonServerlessPostgres) {
177180
name: 'neon-serverless-postgres'
178181
scope: resourceGroup
179182
params: {

‎infra/main.parameters.json

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"deployAzureOpenAI": {
2424
"value": "${DEPLOY_AZURE_OPENAI=true}"
2525
},
26+
"deployNeonServerlessPostgres": {
27+
"value": "${DEPLOY_NEON_SERVERLESS_POSTGRES=true}"
28+
},
2629
"azureOpenAIKey": {
2730
"value": "${AZURE_OPENAI_KEY}"
2831
},

0 commit comments

Comments
 (0)
Please sign in to comment.