From 1afa873943b7948bdb8499644fae66223a5278d2 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 1 Dec 2021 07:24:23 +0100 Subject: [PATCH 1/3] Add CDN & VNET Signed-off-by: Tom Kerkhove --- deploy/us.bicep | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/deploy/us.bicep b/deploy/us.bicep index 541d0fc..62adc6e 100644 --- a/deploy/us.bicep +++ b/deploy/us.bicep @@ -28,6 +28,10 @@ resource workflow 'Microsoft.Logic/workflows@2019-05-01' = [for i in range(1, 3) resource serverlessAppPlan 'Microsoft.Web/serverfarms@2021-01-15' = { name: '${resourceNamePrefix}-serverless-app-plan' location: location + tags: { + region: region + app: 'promitor-resource-discovery-tests' + } sku: { name: 'Y1' tier: 'Dynamic' @@ -44,9 +48,54 @@ resource functionApp 'Microsoft.Web/sites@2021-01-15' = { name: '${resourceNamePrefix}-serverless-functions' location: location kind: 'functionapp' + tags: { + region: region + app: 'promitor-resource-discovery-tests' + } properties: { serverFarmId: serverlessAppPlan.id reserved: true keyVaultReferenceIdentity: 'SystemAssigned' } } + +resource vnet 'Microsoft.Network/virtualNetworks@2021-03-01' = { + name: '${resourceNamePrefix}-vnet' + location: location + tags: { + region: region + app: 'promitor-resource-discovery-tests' + } + properties: { + addressSpace: { + addressPrefixes: [ '10.0.0.0/16' ] + } + subnets: [ + { + name: 'subnet-1' + properties: { + addressPrefix: '10.0.0.0/24' + } + } + { + name: 'subnet-2' + properties: { + addressPrefix: '10.0.1.0/24' + } + } + ] + } +} + +resource cdn 'Microsoft.Cdn/profiles@2019-04-15' = { + name: '${resourceNamePrefix}-cdn' + location: location + tags: { + region: region + app: 'promitor-resource-discovery-tests' + } + sku: { + name: 'Standard_Microsoft' + } + properties: {} +} From dfe656493917a826f1053db7cd62a0666b8e05c5 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 1 Dec 2021 07:43:41 +0100 Subject: [PATCH 2/3] Add MariaDB Signed-off-by: Tom Kerkhove --- .../deploy-test-resources-to-azure.yml | 3 +- deploy/us.bicep | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-test-resources-to-azure.yml b/.github/workflows/deploy-test-resources-to-azure.yml index c411d23..4abef2e 100644 --- a/.github/workflows/deploy-test-resources-to-azure.yml +++ b/.github/workflows/deploy-test-resources-to-azure.yml @@ -35,6 +35,7 @@ jobs: subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }} template: ./deploy/us.bicep + parameters: mariaDbServerPassword=${{ secrets.AZURE_MARIADB_SERVER_PASSWORD }} deploymentName: us-run-${{ github.run_number }} deploymentMode: Complete failOnStdErr: false @@ -63,8 +64,8 @@ jobs: with: subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} resourceGroupName: ${{ env.AZURE_RESOURCEGROUP_NAME }} - parameters: sqlServerPassword=${{ secrets.SQL_PASSWORD }} template: ./deploy/europe.bicep + parameters: sqlServerPassword=${{ secrets.SQL_PASSWORD }} deploymentName: europe-run-${{ github.run_number }} deploymentMode: Complete failOnStdErr: false \ No newline at end of file diff --git a/deploy/us.bicep b/deploy/us.bicep index 62adc6e..47e1564 100644 --- a/deploy/us.bicep +++ b/deploy/us.bicep @@ -1,3 +1,6 @@ +@secure() +param mariaDbServerPassword string + param location string = resourceGroup().location param resourceNamePrefix string = 'promitor-testing-resource-${geo}' param region string = 'USA' @@ -99,3 +102,39 @@ resource cdn 'Microsoft.Cdn/profiles@2019-04-15' = { } properties: {} } + +resource mariaDbServer 'Microsoft.DBforMariaDB/servers@2018-06-01' = { + name: '${resourceNamePrefix}-mariadb-server' + location: location + tags: { + region: region + app: 'promitor-resource-discovery-tests' + } + sku: { + capacity: 1 + family: 'Gen5' + name: 'B_Gen5_1' + size: '51200' + tier: 'Basic' + } + properties: { + storageProfile: { + backupRetentionDays: 7 + geoRedundantBackup: 'Disabled' + storageAutogrow: 'Enabled' + } + version: '10.3' + createMode: 'Default' + administratorLogin: 'tom' + administratorLoginPassword: mariaDbServerPassword + } +} + +resource mariaDbDatabase 'Microsoft.DBforMariaDB/servers/databases@2018-06-01' = { + name: 'example-db-1' + parent: mariaDbServer + properties: { + charset: 'utf8' + collation: 'utf8_general_ci' + } +} From 97837c7f03b6612fa9530db4abfc180ac010da72 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 1 Dec 2021 08:38:46 +0100 Subject: [PATCH 3/3] Fix VNET formatting Signed-off-by: Tom Kerkhove --- deploy/us.bicep | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/us.bicep b/deploy/us.bicep index 47e1564..a887cb6 100644 --- a/deploy/us.bicep +++ b/deploy/us.bicep @@ -71,7 +71,9 @@ resource vnet 'Microsoft.Network/virtualNetworks@2021-03-01' = { } properties: { addressSpace: { - addressPrefixes: [ '10.0.0.0/16' ] + addressPrefixes: [ + '10.0.0.0/16' + ] } subnets: [ {