Skip to content

Commit a3cdbcb

Browse files
fix: deployment script issue for postgres in private network
1 parent ea7e2bb commit a3cdbcb

File tree

4 files changed

+606
-82
lines changed

4 files changed

+606
-82
lines changed

infra/main.bicep

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,19 +1407,32 @@ module machineLearning 'modules/app/machinelearning.bicep' = if (orchestrationSt
14071407
}
14081408
}
14091409

1410-
module createIndex 'modules/core/database/deploy_create_table_script.bicep' = if (databaseType == 'PostgreSQL') {
1411-
name: 'deploy_create_table_script'
1410+
//========== Deployment script to upload data ========== //
1411+
module createIndex 'br/public:avm/res/resources/deployment-script:0.5.1' = if (databaseType == 'PostgreSQL') {
1412+
name: take('avm.res.resources.deployment-script.createIndex', 64)
14121413
params: {
1413-
solutionLocation: location
1414-
identity: managedIdentityModule.outputs.managedIdentityOutput.id
1415-
baseUrl: baseUrl
1416-
postgresSqlServerName: postgresDBModule!.outputs.postgresDbOutput.postgreSQLServerName
1417-
managedIdentityName: managedIdentityModule.outputs.managedIdentityOutput.name
1414+
kind: 'AzureCLI'
1415+
name: 'copy_demo_Data'
1416+
azCliVersion: '2.52.0'
1417+
cleanupPreference: 'Always'
1418+
location: location
1419+
managedIdentities: {
1420+
userAssignedResourceIds: [
1421+
managedIdentityModule.outputs.managedIdentityOutput.id
1422+
]
1423+
}
1424+
retentionInterval: 'PT1H'
1425+
runOnce: true
1426+
primaryScriptUri: '${baseUrl}scripts/run_create_table_script.sh'
1427+
arguments: '${baseUrl} ${resourceGroup().name} ${postgresDBModule!.outputs.postgresDbOutput.postgreSQLServerName} ${managedIdentityModule.outputs.managedIdentityOutput.name}'
1428+
storageAccountResourceId: storage.outputs.id
1429+
subnetResourceIds: enablePrivateNetworking ? [
1430+
network!.outputs.subnetDeploymentScriptsResourceId
1431+
] : null
1432+
tags: tags
1433+
timeout: 'PT1H'
14181434
}
1419-
scope: resourceGroup()
1420-
dependsOn: hostingModel == 'code'
1421-
? [postgresDBModule, web, adminweb]
1422-
: [postgresDBModule, web, adminweb, function]
1435+
dependsOn: [web, adminweb, function]
14231436
}
14241437

14251438
var azureOpenAIModelInfo = string({

0 commit comments

Comments
 (0)