From 40c45b0f0a70db30e8783c7fad1b44cda55b4db4 Mon Sep 17 00:00:00 2001 From: EwanNoble Date: Tue, 7 Jan 2020 11:21:32 +0000 Subject: [PATCH] Restructure ARM templates, remove ASE references, add certificate deployments --- .../azuredeploy.json => azure/template.json | 165 ++++++++++++--- src/Employer/Employer.sln | 17 +- .../Esfa.Recruit.Azure.Resources.deployproj | 37 ---- .../azuredeploy.parameters.json | 200 ------------------ 4 files changed, 134 insertions(+), 285 deletions(-) rename src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.json => azure/template.json (89%) delete mode 100644 src/Employer/Esfa.Recruit.Azure.Resources/Esfa.Recruit.Azure.Resources.deployproj delete mode 100644 src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.parameters.json diff --git a/src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.json b/azure/template.json similarity index 89% rename from src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.json rename to azure/template.json index dddd9ee5fc..2dca93523a 100644 --- a/src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.json +++ b/azure/template.json @@ -1,5 +1,5 @@ { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "EnvironmentName": { @@ -13,14 +13,6 @@ ], "defaultValue": "West Europe" }, - "aseHostingEnvironmentName": { - "type": "string", - "defaultValue": "" - }, - "aseResourceGroup": { - "type": "string", - "defaultValue": "" - }, "webJobAspSize": { "type": "string", "allowedValues": [ @@ -39,7 +31,7 @@ "Standard", "Premium" ], - "defaultValue": "Standard" + "defaultValue": "Basic" }, "EnvironmentFullName": { "type": "string" @@ -94,7 +86,7 @@ "ProviderCommitmentsSiteUrl": "", "SignProviderAgreementUrl": "", "ReservationsSiteUrl": "", - "EmployerFavouritesUrl": "" + "EmployerFavouritesUrl": "" } }, "Features": { @@ -127,7 +119,7 @@ "type": "bool", "defaultValue": false }, - "SharedAppServicePlanName": { + "SharedFrontendAppServicePlanName": { "type": "string" }, "SharedAppServicePlanResourceGroup": { @@ -250,6 +242,17 @@ }, "containerArray": { "type": "array" + }, + "sharedKeyvaultName": { + "type": "string" + }, + "sharedKeyvaultResourceGroup": { + "type": "string" + }, + "appServiceAllowedIps": { + "type": "array", + "defaultValue": [ + ] } }, "variables": { @@ -282,7 +285,8 @@ } } }, - "dependsOn": [] + "dependsOn": [ + ] }, { "apiVersion": "2017-05-10", @@ -303,7 +307,8 @@ } } }, - "dependsOn": [] + "dependsOn": [ + ] }, { "apiVersion": "2017-05-10", @@ -324,7 +329,8 @@ } } }, - "dependsOn": [] + "dependsOn": [ + ] }, { "apiVersion": "2017-05-10", @@ -351,7 +357,8 @@ } } }, - "dependsOn": [] + "dependsOn": [ + ] }, { "apiVersion": "2017-05-10", @@ -456,6 +463,34 @@ "count": "[length(parameters('containerArray'))]" } }, + { + "condition": "[greater(length(parameters('EmployerCustomHostname')), 0)]", + "apiVersion": "2017-05-10", + "name": "Employer-Recruit-AppService-Certificate", + "resourceGroup": "[parameters('sharedAppServicePlanResourceGroup')]", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "templateLink": { + "uri": "[concat(variables('deploymentUrlBase'),'app-service-certificate.json')]", + "contentVersion": "1.0.0.0" + }, + "parameters": { + "keyVaultCertificateName": { + "value": "[parameters('EmployerKeyvaultCertificateName')]" + }, + "keyVaultName": { + "value": "[parameters('sharedKeyvaultName')]" + }, + "keyVaultResourceGroup": { + "value": "[parameters('sharedKeyvaultResourceGroup')]" + }, + "serverFarmId": { + "value": "[resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/serverfarms', parameters('sharedFrontendAppServicePlanName'))]" + } + } + } + }, { "apiVersion": "2017-05-10", "name": "Employer-Recruit-AppService", @@ -471,7 +506,7 @@ "value": "[variables('EmployerRecruitAppServiceName')]" }, "appServicePlanName": { - "value": "[parameters('SharedAppServicePlanName')]" + "value": "[parameters('SharedFrontendAppServicePlanName')]" }, "appServicePlanResourceGroup": { "value": "[parameters('SharedAppServicePlanResourceGroup')]" @@ -537,11 +572,11 @@ { "name": "ExternalLinks:CommitmentsSiteUrl", "value": "[parameters('ExternalLinks').CommitmentsSiteUrl]" - }, - { + }, + { "name": "ExternalLinks:EmployerFavouritesUrl", "value": "[parameters('ExternalLinks').EmployerFavouritesUrl]" - }, + }, { "name": "Features:AllowLevyPayingEmployersOnly", "value": "[parameters('Features').AllowLevyPayingEmployersOnly]" @@ -605,15 +640,47 @@ "value": "[parameters('EmployerCustomHostname')]" }, "certificateThumbprint": { - "value": "[reference(resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/certificates', parameters('EmployerKeyvaultCertificateName')), '2016-03-01').Thumbprint]" + "value": "[if(greater(length(parameters('EmployerCustomHostname')), 0), reference('Employer-Recruit-AppService-Certificate', '2018-11-01').outputs.certificateThumbprint.value, '')]" + }, + "ipSecurityRestrictions": { + "value": "[parameters('appServiceAllowedIps')]" } } }, "dependsOn": [ "[variables('EmployerRecruitAppServiceName')]", - "[variables('CosmosDbName')]" + "[variables('CosmosDbName')]", + "Employer-Recruit-AppService-Certificate" ] }, + { + "condition": "[greater(length(parameters('QAAppCustomHostname')), 0)]", + "apiVersion": "2017-05-10", + "name": "QA-App-AppService-Certificate", + "resourceGroup": "[parameters('sharedAppServicePlanResourceGroup')]", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "templateLink": { + "uri": "[concat(variables('deploymentUrlBase'),'app-service-certificate.json')]", + "contentVersion": "1.0.0.0" + }, + "parameters": { + "keyVaultCertificateName": { + "value": "[parameters('QAAppKeyvaultCertificateName')]" + }, + "keyVaultName": { + "value": "[parameters('sharedKeyvaultName')]" + }, + "keyVaultResourceGroup": { + "value": "[parameters('sharedKeyvaultResourceGroup')]" + }, + "serverFarmId": { + "value": "[resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/serverfarms', parameters('sharedFrontendAppServicePlanName'))]" + } + } + } + }, { "apiVersion": "2017-05-10", "name": "QA-App-AppService", @@ -629,7 +696,7 @@ "value": "[variables('QAAppServiceName')]" }, "appServicePlanName": { - "value": "[parameters('SharedAppServicePlanName')]" + "value": "[parameters('SharedFrontendAppServicePlanName')]" }, "appServicePlanResourceGroup": { "value": "[parameters('SharedAppServicePlanResourceGroup')]" @@ -744,14 +811,46 @@ "value": "[parameters('QAAppCustomHostname')]" }, "certificateThumbprint": { - "value": "[reference(resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/certificates', parameters('QAAppKeyvaultCertificateName')), '2016-03-01').Thumbprint]" + "value": "[if(greater(length(parameters('EmployerCustomHostname')), 0), reference('QA-App-AppService-Certificate', '2018-11-01').outputs.certificateThumbprint.value, '')]" + }, + "ipSecurityRestrictions": { + "value": "[parameters('appServiceAllowedIps')]" } } }, "dependsOn": [ - "[variables('QAAppServiceName')]" + "[variables('QAAppServiceName')]", + "QA-App-AppService-Certificate" ] }, + { + "condition": "[greater(length(parameters('ProviderKeyvaultCertificateName')), 0)]", + "apiVersion": "2017-05-10", + "name": "Provider-Recruit-AppService-Certificate", + "resourceGroup": "[parameters('sharedAppServicePlanResourceGroup')]", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "templateLink": { + "uri": "[concat(variables('deploymentUrlBase'),'app-service-certificate.json')]", + "contentVersion": "1.0.0.0" + }, + "parameters": { + "keyVaultCertificateName": { + "value": "[parameters('ProviderKeyvaultCertificateName')]" + }, + "keyVaultName": { + "value": "[parameters('sharedKeyvaultName')]" + }, + "keyVaultResourceGroup": { + "value": "[parameters('sharedKeyvaultResourceGroup')]" + }, + "serverFarmId": { + "value": "[resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/serverfarms', parameters('sharedFrontendAppServicePlanName'))]" + } + } + } + }, { "apiVersion": "2017-05-10", "name": "Provider-Recruit-AppService", @@ -767,7 +866,7 @@ "value": "[variables('ProviderRecruitAppServiceName')]" }, "appServicePlanName": { - "value": "[parameters('SharedAppServicePlanName')]" + "value": "[parameters('SharedFrontendAppServicePlanName')]" }, "appServicePlanResourceGroup": { "value": "[parameters('SharedAppServicePlanResourceGroup')]" @@ -925,12 +1024,16 @@ "value": "[parameters('ProviderCustomHostname')]" }, "certificateThumbprint": { - "value": "[reference(resourceId(parameters('sharedAppServicePlanResourceGroup'), 'Microsoft.Web/certificates', parameters('ProviderKeyvaultCertificateName')), '2016-03-01').Thumbprint]" + "value": "[if(greater(length(parameters('EmployerCustomHostname')), 0), reference('Provider-Recruit-AppService-Certificate', '2018-11-01').outputs.certificateThumbprint.value, '')]" + }, + "ipSecurityRestrictions": { + "value": "[parameters('appServiceAllowedIps')]" } } }, "dependsOn": [ - "[variables('CosmosDbName')]" + "[variables('CosmosDbName')]", + "Provider-Recruit-AppService-Certificate" ] }, { @@ -969,12 +1072,6 @@ "aspLocation": { "value": "[parameters('webJobAspLocation')]" }, - "aseHostingEnvironmentName": { - "value": "[parameters('aseHostingEnvironmentName')]" - }, - "aseResourceGroup": { - "value": "[parameters('aseResourceGroup')]" - }, "aspSize": { "value": "[parameters('webJobAspSize')]" }, diff --git a/src/Employer/Employer.sln b/src/Employer/Employer.sln index a47b38d45e..85a93db3d9 100644 --- a/src/Employer/Employer.sln +++ b/src/Employer/Employer.sln @@ -1,18 +1,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2036 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29613.14 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Employer.Web", "Employer.Web\Employer.Web.csproj", "{9C9261F7-B779-4BAC-BFC0-EA63375F718B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests", "UnitTests\UnitTests.csproj", "{6B9BE737-38C8-46FB-AB78-FF43B4044EF2}" EndProject -Project("{151D2E53-A2C4-4D7D-83FE-D05416EBD58E}") = "Esfa.Recruit.Azure.Resources", "Esfa.Recruit.Azure.Resources\Esfa.Recruit.Azure.Resources.deployproj", "{D39E21A9-E8C6-461E-87AE-74180559F2A5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests", "IntegrationTests\IntegrationTests.csproj", "{723ADF83-C33B-49A4-BADC-E0EC1D94CD68}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{784BB04D-CF2D-4160-BC59-657FCB87464E}" ProjectSection(SolutionItems) = preProject ..\README.md = ..\README.md + ..\..\azure\template.json = ..\..\azure\template.json EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recruit.Vacancies.Client", "..\Shared\Recruit.Vacancies.Client\Recruit.Vacancies.Client.csproj", "{A7DE9840-CA1D-4B8C-BDFB-D67B9AB8B6C0}" @@ -55,16 +54,6 @@ Global {6B9BE737-38C8-46FB-AB78-FF43B4044EF2}.Release|x64.Build.0 = Release|Any CPU {6B9BE737-38C8-46FB-AB78-FF43B4044EF2}.Release|x86.ActiveCfg = Release|Any CPU {6B9BE737-38C8-46FB-AB78-FF43B4044EF2}.Release|x86.Build.0 = Release|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Debug|x64.ActiveCfg = Debug|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Debug|x64.Build.0 = Debug|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Debug|x86.ActiveCfg = Debug|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Debug|x86.Build.0 = Debug|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Release|x64.ActiveCfg = Release|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Release|x64.Build.0 = Release|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Release|x86.ActiveCfg = Release|Any CPU - {D39E21A9-E8C6-461E-87AE-74180559F2A5}.Release|x86.Build.0 = Release|Any CPU {723ADF83-C33B-49A4-BADC-E0EC1D94CD68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {723ADF83-C33B-49A4-BADC-E0EC1D94CD68}.Debug|Any CPU.Build.0 = Debug|Any CPU {723ADF83-C33B-49A4-BADC-E0EC1D94CD68}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/src/Employer/Esfa.Recruit.Azure.Resources/Esfa.Recruit.Azure.Resources.deployproj b/src/Employer/Esfa.Recruit.Azure.Resources/Esfa.Recruit.Azure.Resources.deployproj deleted file mode 100644 index e2b52107d4..0000000000 --- a/src/Employer/Esfa.Recruit.Azure.Resources/Esfa.Recruit.Azure.Resources.deployproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Debug - AnyCPU - - - Release - AnyCPU - - - - d39e21a9-e8c6-461e-87ae-74180559f2a5 - - - Deployment - 1.0 - - - - - - - - - - - - - False - - - - - - \ No newline at end of file diff --git a/src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.parameters.json b/src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.parameters.json deleted file mode 100644 index d485b1c72e..0000000000 --- a/src/Employer/Esfa.Recruit.Azure.Resources/azuredeploy.parameters.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "EnvironmentName": { - "value": "dev" - }, - "webJobAspLocation": { - "value": "" - }, - "aseHostingEnvironmentName": { - "value": "" - }, - "aseResourceGroup": { - "value": "" - }, - "webJobAspSize": { - "value": "" - }, - "webJobAspInstances": { - "value": "" - }, - "webJobNonASETier": { - "value": "" - }, - "EnvironmentFullName": { - "value": "dev" - }, - "Authentication": { - "value": { - "Authority": "", - "MetaDataAddress": "", - "ClientId": "", - "ClientSecret": "" - } - }, - "AccountApiConfiguration": { - "value": { - "ApiBaseUrl": "", - "ClientId": "", - "ClientSecret": "", - "IdentifierUri": "", - "Tenant": "" - } - }, - "ProviderRelationshipsApiConfiguration": { - "value": { - "ApiBaseUrl": "", - "ClientId": "", - "ClientSecret": "", - "IdentifierUri": "", - "Tenant": "" - } - }, - "PasAccountApiConfiguration": { - "value": { - "ApiBaseUrl": "", - "ClientId": "", - "ClientSecret": "", - "IdentifierUri": "", - "Tenant": "" - } - }, - "ExternalLinks": { - "value": { - "ManageApprenticeshipSiteUrl": "", - "EmployerIdamsSiteUrl": "", - "StaffIdamsUrl": "", - "ProviderApprenticeshipSiteUrl": "", - "CommitmentsSiteUrl": "", - "SignProviderAgreementUrl": "", - "ReservationsSiteUrl": "", - "EmployerFavouritesUrl": "" - - } - }, - "Features": { - "value": { - "AllowLevyPayingEmployersOnly" : true, - "SetNotificationPreferences": false - } - }, - "ConfigurationStorageConnectionString": { - "value": "" - }, - "LoggingRedisConnectionString": { - "value": "" - }, - "StorageRedisConnectionString": { - "value": "" - }, - "ApprenticeshipProgrammesApiBaseUrl": { - "value": "" - }, - "SharedAppServicePlanName": { - "value": "" - }, - "SharedAppServicePlanResourceGroup": { - "value": "" - }, - "EmployerCustomHostname": { - "value": "" - }, - "ProviderCustomHostname": { - "value": "" - }, - "EmployerKeyvaultCertificateName": { - "value": "" - }, - "QAAppCustomHostname": { - "value": "" - }, - "QAAppKeyvaultCertificateName": { - "value": "" - }, - "ProviderKeyvaultCertificateName": { - "value": "" - }, - "QAAuthentication": { - "value": { - "Wtrealm": "", - "MetaDataAddress": "" - } - }, - "QALegacyAuthorization": { - "value": { - "ClaimType": "", - "UserClaimValue": "", - "TeamLeadClaimValue": "" - } - }, - "QAAuthorization": { - "value": { - "ClaimType": "", - "UserClaimValue": "", - "TeamLeadClaimValue": "" - } - }, - "SlackWebhook": { - "value": "" - }, - "GeocodePostcodeAnywhereKey": { - "value": "" - }, - "PostcodeAnywhereKey": { - "value": "" - }, - "FaaConfiguration": { - "value": { - "StorageConnectionString": "" - } - }, - "VacancyApiConfiguration": { - "value": { - "ApiReadSubscriptionKey": "", - "ApiSearchBaseUrl": "" - } - }, - "VacancyReviewAssignationTimeoutMinutes": { - "value": "" - }, - "EmployerAccountsSqlDbConnectionString": { - "value": "" - }, - "EmployerFinanceSqlDbConnectionString": { - "value": "" - }, - "VacancyAnalyticEventsSqlDbConnectionString": { - "value": "" - }, - "ProviderAuthentication": { - "value": { - "Wtrealm": "", - "MetaDataAddress": "" - } - }, - "DasSharedNServiceBusConfiguration": { - "value": { - "ConnectionString": "", - "NServiceBusLicense": "" - } - }, - "CommunicationsConfiguration": { - "value": { - "EmployersApprenticeshipServiceUrl": "", - "ProvidersApprenticeshipServiceUrl": "" - } - }, - "NotificationsApiClientConfiguration": { - "value": { - "ApiBaseUrl": "", - "ClientToken": "" - } - }, - "DasEncodings": { - "value": [ - ] - } - } -}