...
A “Service Connection” is required for each resource group and environment. This needs to be requested from TC Cloud Team.
Requires Document Service URL from Team Ninja Turtles
Azure ObjectID of the team who has to access the keyvault’s
Deployment DevOps Pipelines | Descriptions |
---|---|
Azure Resources Deployment 1 (Initial) | Will deploy keyvault, appserviceplan for Safsecsur & Eregistry and container registry for Safsecsur |
Azure Resources Deployment 2 (Safsecsur) | Will deploy app service (for work management, LOV and service bus processing service), redisCache, appInsights(for work management, LOV and service bus processing service), postgreSQL, cosmosDB, serviceBus, storageAccount resources for Safsecsur |
Azure Resources Deployment 3 (Eregistry) | Will deploy app service and appinsights (for Vessel Registry internal and external website) resources for Eregistry |
Review bicep deployment files (azuredeploy. *) under project repository folder AzureDeployment
Review
sku
values for resources and update as necessary. The sku values are inside of bicep templates in repository: Infrastructure/AzureDeployment/azuredeploy.*.bicepIn the same bicep files optionally set
deployment
flag to false if the associated resource did not need to be deployed. It is set to true by default.
Configure the variables for each azure resource deployment DevOps pipelines
Edit DevOps pipelines under Pipelines → All → Azure Deployment folder
Configure variables listed for each deployment pipeline in Appendix section 1. For secured variables, need to re-create the value and check “Keep this value secret” checkbox after adding the value
Run the first deployment pipeline Azure Resources Deployment 1 (Initial). This will create container registry, keyvault and app service plan resources
Create a folder by environment name in DevOps pipeline and clone/create DevOps CI/CD pipelines for Vessel Registry and Shared (Dsd Marine) app servicesin TK and TNT DevOps project.
Configure new cloned/created DevOps CI/CD pipelines for specified resource groups, container image name and container image tag. Then build the pipelines. Please refer to the Appendix section 2 for the container name, image name and image tag.
Update the deployment pipeline variables and run the remaining two: Azure Resources Deployment 2 (Safsecsur) and Azure Resources Deployment 3 (Eregistry). Verify the resources has been deployed successfully in Azure Portal → Resource Group → Deployments
Add keyvault secrets used for applications from created resources. Please refer to the Appendix section 3 for the required application secrets (Optional: Configure Access Policies in the KeyVault)
Create a Variable group in DevOps → Pipelines → Library. Toggle “Link Secrets” option, select appropriate Azure subscription → KeyVault name, add all the necessary keys and save the variable group
Repeat above step in TNT project
Add workmanagementservice appservice outbound IP addresses to Postgresql server connection security (Optional: Have to do this for documentmanagement service too)
Run Vesselregistry and document service database script
On all appservices, need to turn off & on continuous integration, save it. This should be done in order to create a webhook in container registry
Disable public access to blob on storageaccount
Add/Create a “Diagnostics Settings” to all the appservices on Azure portalTurn-on Identity in document api appservice and add the object id to safsecsur keyvault access policy
Link and save the new variable group in all the DevOps CI/CD pipelines
Make sure to use the correct branch(Develop/Master) on all the DevOps CI/CD pipelines
Migrate LOV Azure Cosmos DB data using Microsoft tool or Console App
Create Application Registration for Vessel Registration internal and external websites. Please refer to below Application Registration section.
Run DevOps CI/CD pipelines of TK and TNT again and verify the applications runs as expected.
Configure the App Configuration Resource [Applicable only for the NCD / PCP Environments] after completing the deployment of Azure Resources Deployment 1 (Initial) and Azure Resources Deployment 2 (Safsecsur).
In the [nprd/prod]-vrappconfig App Configuration / Settings / Identity / System assigned → Copy the Object (principal) ID
In the [environment]eregistrykv / Settings / Keys → Click the Generate/Import button, and use the following configuration:
Options: Generate
Name: [nprd / prod]-vr-appconfiguration-key
Key type: RSA
RSA key size 4096
Enabled: Yes
Under [environment]eregistrykv / Settings / Access policies → Click the Add Access Policy and apply the following settings
Key permissions → Get, Unwrap, Wrap
Select principal → Search for the Object (principal) ID you copied from step a
In the [nprd/prod]-vrappconfig App Configuration / Settings / Encryption → Check the “Customer Managed Key“ and apply the following settings:
Identity: System assigned
Encryption Key: Select from Key Vault
Key Vault:
Subscription: NPRD / PROD
Key vault: [environment]eregistrykv
Key: [nprd / prod]-vr-appconfiguration-key
Ensure you save the encryption settings
Application Registration
Script execution prerequisite
...
Section1: Variables for Azure resource deployment
Environment Name | Descriptions | Location |
---|---|---|
ncd | Non-Production DEV | Canada Central |
nct | Non-Production TEST | Canada Central |
nca | Non-Production ACC | Canada Central |
pcp | Production | Canada Central |
Pipeline Name | Variable Name | IsSecured | Associated Resource |
---|---|---|---|
Deployment 1 (Initial) | EnvironmentName | ||
TargetEnvironment | |||
ContainerRegistrySKU | |||
TeamKrakenAzureAdObjectId | Yes | KeyVault | |
TeamNinjaTurtlesAzureAdObjectId | Yes | KeyVault | |
AzureAdTenantId | Yes | KeyVault | |
EregistryResourceGroupName | Azure Portal | ||
EregistryServiceConnectionName | Name of the service connection for the resource group and environment. DevOps->Project Settings->Service connections | ||
SafsecsurResourceGroupName | Azure Portal | ||
SafsecsurServiceConnectionName | Name of the service connection for the resource group and environment. DevOps->Project Settings->Service connections | ||
Deployment 2 (Safsecsur) | EnvironmentName | ||
TargetEnvironment | |||
ServiceConnection | Name of the service connection for the resource group and environment. DevOps->Project Settings->Service connections | ||
ResourceGroupName | Azure Portal | ||
ContainerRegistryPassword | Yes | ||
PsqlAdminName | Yes | PostreSQL Database | |
PsqlAdminPassword | Yes | PostreSQL Database | |
PsqlFirewallIpAddress | PostreSQL Database | ||
Deployment 3 (Eregistry) | EnvironmentName | ||
TargetEnvironment | |||
ServiceConnection | Name of the service connection for the resource group and environment. DevOps->Project Settings->Service connections | ||
ResourceGroupName | Azure Portal | ||
ContainerRegistryPassword | Yes |
Section2: Container Registry related name for app servicesncd|nct|nca|pcp
Container Registry Name:
'{environmentName}safsecsurcr'
e.g 'ncdsafsecsurcr'Container Registry Image Name:
'{environmentName}safsecsur-{servicename}'
Container Registry Image Tag:
'safsecsur-{servicename}'
EnvironmentName:
Environment Name | Descriptions | Location |
---|---|---|
ncd | Non-Production DEV | Canada Central |
nct | Non-Production TEST | Canada Central |
nca | Non-Production ACC | Canada Central |
pcp | Production | Canada Central |
TargetEnvironment:
Target Environment | Descriptions | Location |
---|---|---|
Development | Non-Production DEV | Canada Central |
Testing | Non-Production TEST | Canada Central |
Acceptance | Non-Production ACC | Canada Central |
Production | Production | Canada Central |
ApplicationGroup:
Application Group | Descriptions | Shared Applications |
---|---|---|
| Marine safety and security | Yes |
| Vessel Registry | No |
ApplicationName:
Application Name | Descriptions |
---|---|
| Work Management Service |
| List Of Value Service |
| VR Internal Website |
| VR External Website |
| Queue Message Processing Service |
| Microservice which manages the vessel owner information. This will be replaced once the Stakeholder Management Service is ready for consumption. |
| Microservice which manages (creates/updates/soft delete) the details about a vessel. |
| Microservice which manages the history surrounding a vessel. It stores amendments and a snapshot of a vessel at a particular point of time. |
| Microservice which manages the registration of a vessel, and holds information about Certificate Expiry Date, and vessel ownership (Contains a cross reference table linking owners to vessels). |
| A Backends for Frontend application. Uses the BFF pattern Backends for Frontends pattern - Cloud Design Patterns | Microsoft Docs |
Section 3: Application Secrets
Key Name | Value or Derived from | Required for | ResourceGroup to be updated |
---|---|---|---|
| Deployment Environment Resource Group → Application Insights → {Application Insight Name} → Overview → Instrumentation Key |
|
|
| Deployment Environment Resource Group → Application Insights → {Application Insight Name} → Overview → Instrumentation Key |
|
|
| Deployment Environment Resource Group → Application Insights → {Application Insight Name} → Overview → Instrumentation Key |
|
|
| Deployment Environment Resource Group → Application Insights → {Application Insight Name} → Overview → Instrumentation Key |
|
|
| Deployment Environment Resource Group → Service Bus → {Service Bus Name} → Settings → Shared access policies → Policy → Primary Connection String |
|
|
| Deployment Environment Resource Group → Azure Cosmos DB → { Cosmos DB Name } → Settings → Connection String → Primary Connection String |
|
|
| Deployment Environment Resource Group → Azure Cache For Redis → { Azure Cache Redis Name } → Settings → Access Keys → Primary Connection String (StackExchange.Redis) |
|
|
| Deployment Environment Resource Group → Azure Database for PostgreSQL servers → { PostreSQL Server Name } → Settings → Connection Strings → ADO.NET After obtaining the ADO.NET connectionstring, replace {your_database} and {your_password} values with database name and database/server password respectively |
|
|
| Deployment Environment Resource Group → Azure Database for PostgreSQL servers → { PostreSQL Server Name } → Settings → Connection Strings → ADO.NET After obtaining the ADO.NET connectionstring, replace {your_database} and {your_password} values with database name and database/server password respectively |
|
|
| Deployment Environment Resource Group → Storage accounts → Access keys → Click on “Show keys” → Connection string |
|
|
ListOfValueApiUrl
Deployment Environment Resource Group → App Services → { List Of Value Service Name } → Overview → URL
After obtaining the URL append “/ListOfValue“ to it, excluding the quotation marks.
{URL}/ListOfValue
| The API key can be obtained by checking with Walter Hoban, or Team Kraken. |
|
|
ListOfValueTypeApiUrl
Deployment Environment Resource Group → App Services → { List Of Value Service Name } → Overview → URL
After obtaining the URL append “/ListOfValueType“ to it, excluding the quotation marks.
{URL}/ListOfValueType
VR Internal Website
EREGISTRY
DocumentStorageApiUrl
Deployment Environment Resource Group → App Services → { Document Service Name } → Overview → URL
Service is developed by Team Ninja Turtles, and will be located in their resource group.
VR Internal Website
EREGISTRY
WorkManagementServiceApiUrl
Deployment Environment Resource Group → API Management services → { APIM Name } → Overview → Gateway URL
After obtaining the Gateway URL append “/wms/api/v1“ to it, excluding the quotation marks.
{URL}/wms/api/v1
VR Internal Website
EREGISTRY
CanadaPostAddressCompleteAPIKey
The API key can be obtained by checking with Walter Hoban, or Team Kraken.
VR Internal Website
| Add the postgresql server admin password. This is passed as a variable in Deployment pipeline 2 |
| ||||||
| Add the postgresql server admin name. This is passed as a variable in Deployment pipeline 2 |
| ||||||
| Manually generated by developers using powershell.
|
|
| |||||
| [nprd/prod]-vrappconfig App Configuration → Settings → Access keys → Read-only keys → Connection string |
|
|
App Registration Flowchart
...