-
Notifications
You must be signed in to change notification settings - Fork 0
Azure SQL Database configuration parameters and module #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -406,9 +406,27 @@ var dbAccountName = !empty(azureDbAccountName) ? azureDbAccountName : 'dbgpt0-${ | |||||||||
| @description('Cosmos DB Database Name. Use your own name convention or leave as it is to generate a random name.') | ||||||||||
| param azureDbDatabaseName string = '' | ||||||||||
| var dbDatabaseName = !empty(azureDbDatabaseName) ? azureDbDatabaseName : 'db0-${resourceToken}' | ||||||||||
| @description('Azure SQL Server Name.') | ||||||||||
| param azureSqlServerName string = '' | ||||||||||
| var sqlServerName = !empty(azureSqlServerName) ? azureSqlServerName : 'sqlgpt0-${resourceToken}' | ||||||||||
| @description('Azure SQL Database Name.') | ||||||||||
| param azureSqlDatabaseName string = '' | ||||||||||
| var sqlDatabaseName = !empty(azureSqlDatabaseName) ? azureSqlDatabaseName : 'sqldb0-${resourceToken}' | ||||||||||
| @description('Azure SQL administrator login name.') | ||||||||||
| param azureSqlAdministratorLogin string = 'sqladmin' | ||||||||||
| @description('Azure SQL administrator password.') | ||||||||||
| @secure() | ||||||||||
| param azureSqlAdministratorPassword string | ||||||||||
| @description('Key Vault secret name to store the Azure SQL administrator password.') | ||||||||||
| param azureSqlAdminSecretName string = 'sqlAdminPassword' | ||||||||||
| @description('Public network access setting for Azure SQL Server.') | ||||||||||
| @allowed(['Enabled', 'Disabled']) | ||||||||||
| param azureSqlPublicNetworkAccess string = 'Enabled' | ||||||||||
| @description('Log Analytics Workspace Name. Use your own name convention or leave as it is to generate a random name.') | ||||||||||
| param azureLogAnalyticsWorkspaceName string = '' | ||||||||||
| var logAnalyticsWorkspaceName = !empty(azureLogAnalyticsWorkspaceName) ? azureLogAnalyticsWorkspaceName : 'law0-${resourceToken}' | ||||||||||
| var logAnalyticsWorkspaceName = !empty(azureLogAnalyticsWorkspaceName) | ||||||||||
| ? azureLogAnalyticsWorkspaceName | ||||||||||
| : 'law0-${resourceToken}' | ||||||||||
| @description('Enable PartitionKeyRUConsumption logs for multi-tenant billing') | ||||||||||
| param enablePartitionKeyRUConsumption bool = true | ||||||||||
| @description('Key Vault Name. Use your own name convention or leave as it is to generate a random name.') | ||||||||||
|
|
@@ -954,6 +972,22 @@ module keyVault './core/security/keyvault.bicep' = { | |||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| module sqlServer './core/db/sqlserver.bicep' = { | ||||||||||
| name: 'sqlserver' | ||||||||||
| scope: resourceGroup | ||||||||||
| params: { | ||||||||||
| name: sqlServerName | ||||||||||
| location: location | ||||||||||
| tags: tags | ||||||||||
| administratorLogin: azureSqlAdministratorLogin | ||||||||||
| administratorLoginPassword: azureSqlAdministratorPassword | ||||||||||
| databaseName: sqlDatabaseName | ||||||||||
| keyVaultName: keyVault.outputs.name | ||||||||||
| publicNetworkAccess: azureSqlPublicNetworkAccess | ||||||||||
|
||||||||||
| publicNetworkAccess: azureSqlPublicNetworkAccess | |
| publicNetworkAccess: networkIsolation ? 'Disabled' : azureSqlPublicNetworkAccess |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new sqlServer module invocation here deploys ./core/db/sqlserver.bicep, which defines a Microsoft.Sql/servers/firewallRules resource named AllowAllAzureServices with startIpAddress set to 0.0.0.0 and endIpAddress set to 255.255.255.255. Combined with publicNetworkAccess defaulting to Enabled both here (azureSqlPublicNetworkAccess) and in the module, this effectively exposes the Azure SQL Server to all IPv4 addresses on the public internet, significantly increasing the risk of unauthorized access or brute-force attacks against the administratorLogin. To mitigate this, tighten the SQL firewall to only trusted IP ranges or disable publicNetworkAccess and use private endpoints/network isolation, and remove or replace the "allow all" firewall rule in sqlserver.bicep with a more restrictive configuration.
| publicNetworkAccess: azureSqlPublicNetworkAccess | |
| publicNetworkAccess: 'Disabled' |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -50,6 +50,24 @@ | |||||||||||||||||
| "azureDbDatabaseName": { | ||||||||||||||||||
| "value": "${AZURE_DB_DATABASE_NAME}" | ||||||||||||||||||
| }, | ||||||||||||||||||
| "azureSqlServerName": { | ||||||||||||||||||
| "value": "" | ||||||||||||||||||
|
||||||||||||||||||
| "value": "" | |
| "value": "${AZURE_SQL_SERVER_NAME}" |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azureSqlDatabaseName is hard-coded to an empty string. Like azureSqlServerName, this should likely be mapped from an env var (e.g., AZURE_SQL_DATABASE_NAME) so the chosen/generated name is stable across refresh/redeploys.
| "value": "" | |
| }, | |
| "azureSqlDatabaseName": { | |
| "value": "" | |
| "value": "${AZURE_SQL_SERVER_NAME}" | |
| }, | |
| "azureSqlDatabaseName": { | |
| "value": "${AZURE_SQL_DATABASE_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description still contains placeholders (e.g., "[Describe your changes here]") and the checklist isn’t filled out. Please update the description with the intended behavior/rollout notes and confirm test/validation steps for the new Azure SQL deployment.