Skip to content

Commit

Permalink
Update sqldatabases.bicep
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Crawfis <[email protected]>
  • Loading branch information
AaronCrawfis authored Nov 8, 2023
1 parent 6e7de4b commit 8132c09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion local-dev/sqldatabases.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ param memoryRequest string = '512Mi'
@description('Memory limit for the azure-sql-edge deployment')
param memoryLimit string = '1024Mi'

@description('Initial catalog to connect to. Defaults to empty string (no initial catalog).')
param initialCatalog string = ''

import kubernetes as kubernetes {
kubeConfig: ''
namespace: context.runtime.kubernetes.namespace
}

var uniqueName = 'sql-${uniqueString(context.resource.id)}'
var port = 1433
var initialCatalogString = initialCatalog == '' ? '' : 'Initial Catalog=${initialCatalog};'

resource sql 'apps/Deployment@v1' = {
metadata: {
Expand Down Expand Up @@ -141,6 +145,6 @@ output result object = {
#disable-next-line outputs-should-not-contain-secrets
password: adminPassword
#disable-next-line outputs-should-not-contain-secrets
connectionString: 'Server=tcp:${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local,${port};Initial Catalog=${database};User Id=${adminLogin};Password=${adminPassword};Encrypt=false'
connectionString: 'Server=tcp:${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local,${port};${initialCatalogString}User Id=${adminLogin};Password=${adminPassword};Encrypt=false'
}
}

0 comments on commit 8132c09

Please sign in to comment.