-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor main.bicep: Update default values for acrName and location p…
…arameters
- Loading branch information
Showing
6 changed files
with
129 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
on: | ||
push: | ||
branches: | ||
# - main | ||
- 'feature/**' | ||
# paths: | ||
# - 'infra/**' | ||
|
||
name: Deploy to Azure Resource Group | ||
|
||
env: | ||
SQL_SERVER_PASSWORD: ${{ secrets.SQL_SERVER_PASSWORD_TEST }} | ||
|
||
jobs: | ||
deploy-azure-resources-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log into Azure | ||
uses: azure/login@v2 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS_TEST }} | ||
|
||
- name: Deploy Azure Resources test | ||
uses: azure/arm-deploy@v2 | ||
with: | ||
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} | ||
resourceGroupName: ${{ secrets.AZURE_RG_TEST }} | ||
template: infra/main.bicep | ||
parameters: "sqlServerPassword=${{env.SQL_SERVER_PASSWORD}}" | ||
failOnStdErr: false | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
@description('The name of the Azure Container Registry.') | ||
param acrName string = 'bouvetcontainerregistrytest' | ||
param acrName string = 'bds-test-acr' | ||
|
||
@description('Key Vault module name') | ||
param keyVaultName string = 'bds-test-kv' | ||
|
||
@description('The location for the registry.') | ||
param location string = 'norwayeast' | ||
|
||
@description('The name of the SQL Server.') | ||
param serverName string = 'bds-test-sqlserver' | ||
|
||
@description('The name of the SQL Database.') | ||
param sqlDBName string = 'bds-test-sqldb' | ||
|
||
@description('The username for the SQL Server.') | ||
param sqlServerUsername string = 'bdsadmin' | ||
|
||
@secure() | ||
@description('The administrator password used for the sql server instance created.') | ||
param sqlServerPassword string | ||
|
||
|
||
|
||
module containerRegistry 'modules/containerRegistry.bicep' = { | ||
name: acrName | ||
params: { | ||
acrName: acrName | ||
location: location | ||
} | ||
} | ||
|
||
module keyVault 'modules/keyVault.bicep' = { | ||
name: keyVaultName | ||
params: { | ||
resourceName: keyVaultName | ||
location: location | ||
} | ||
} | ||
|
||
module sqlServer 'modules/sqlServer.bicep' = { | ||
name: serverName | ||
params: { | ||
serverName: serverName | ||
sqlDBName: sqlDBName | ||
location: location | ||
administratorLogin: sqlServerUsername | ||
administratorLoginPassword: sqlServerPassword | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@description('Key Vault module name') | ||
param resourceName string | ||
|
||
@description('The location for the Key Vault.') | ||
param location string | ||
|
||
|
||
resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' = { | ||
name: resourceName | ||
location: location | ||
sku: { | ||
family: 'A' | ||
name: 'string' | ||
} | ||
enableSoftDelete: true | ||
softDeleteRetentionInDays: 90 | ||
accessPolicies:[] | ||
} | ||
|
||
output keyVaultId string = keyVault.id |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@description('The name of the SQL Server.') | ||
param serverName string | ||
|
||
@description('The name of the SQL Database.') | ||
param sqlDBName string | ||
|
||
@description('The location for the SQL Server.') | ||
param location string | ||
|
||
@description('The administrator login for the SQL Server.') | ||
param administratorLogin string | ||
|
||
@description('The administrator login password for the SQL Server.') | ||
param administratorLoginPassword string | ||
|
||
resource sqlServer 'Microsoft.Sql/servers@2022-05-01-preview' = { | ||
name: serverName | ||
location: location | ||
properties: { | ||
administratorLogin: administratorLogin | ||
administratorLoginPassword: administratorLoginPassword | ||
} | ||
} | ||
|
||
resource sqlDB 'Microsoft.Sql/servers/databases@2022-05-01-preview' = { | ||
parent: sqlServer | ||
name: sqlDBName | ||
location: location | ||
sku: { | ||
name: 'S0' | ||
tier: 'Standard' | ||
} | ||
} | ||
|
||
output connectionString string = 'Server=tcp:${serverName}${environment().suffixes.sqlServerHostname},1433; Initial Catalog=${sqlDBName}; Persist Security Info=False; User ID=${administratorLoginPassword}; Password=${administratorLoginPassword}; MultipleActiveResultSets=False; Encrypt=True; TrustServerCertificate=False; Connection Timeout=300;' |