Skip to content

Commit

Permalink
Additional name changes migration -> pipeline
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-421
  • Loading branch information
btposey committed Jan 30, 2025
1 parent a6b00fb commit ff04e6d
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 87 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/reusable-backend-slot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:

- name: Create API Slot Resource
run: |
migrationSlotStorageAccountName=ustpslot${{ inputs.environmentHash }}
apiSlotStorageAccountName=migrationslot${{ inputs.environmentHash }}
pipelinesSlotStorageAccountName=ustpslot${{ inputs.environmentHash }}
apiSlotStorageAccountName=pipelinesslot${{ inputs.environmentHash }}
./ops/scripts/pipeline/slots/az-slot-api-resource-deploy.sh \
--resourceGroup ${{ steps.rgApp.outputs.out }} \
Expand All @@ -66,7 +66,7 @@ jobs:
--slotName ${{ inputs.slotName }} \
--kvIdName ${{ secrets.AZ_KV_APP_CONFIG_MANAGED_ID }} \
--sqlIdName ${{ secrets.AZ_SQL_IDENTITY_NAME }} \
--apiStorageAccName ${migrationSlotStorageAccountName:0:24} \
--migrationStorageAccName ${apiSlotStorageAccountName:0:24} \
--apiStorageAccName ${pipelinesSlotStorageAccountName:0:24} \
--pipelinesStorageAccName ${apiSlotStorageAccountName:0:24} \
--databaseName ${{ secrets.AZ_COSMOS_DATABASE_NAME }} \
--infoSha ${{ inputs.environmentHash || 'DOES_NOT_EXIST' }}
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
echo "Webapp Name: $webappName"
apiFunctionName="${stackName}-node-api"
echo "Api Function Name: $apiFunctionName"
pipelinesFunctionName="${stackName}-migration"
pipelinesFunctionName="${stackName}-pipelines"
echo "Migration Function Name: $pipelinesFunctionName"
# Deployment flags
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/sub-deploy-code-slot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
--src ./${{ inputs.apiFunctionName }}.zip \
--slotName ${{ inputs.slotName }}
deploy-migration-slot:
deploy-pipelines-slot:
runs-on: ubuntu-latest
environment: ${{ inputs.ghaEnvironment }}
steps:
Expand All @@ -137,7 +137,7 @@ jobs:
in: ${{ inputs.azResourceGrpAppEncrypted }}

- name: Deploy Azure Function Migration slot
id: deploy-migration-slot-step
id: deploy-pipelines-slot-step
run: |
az functionapp start -g ${{ steps.rgApp.outputs.out }} --name ${{ inputs.pipelinesFunctionName }} --slot ${{ inputs.slotName }}
Expand All @@ -148,7 +148,7 @@ jobs:
--slotName ${{ inputs.slotName }}
endpoint-test-application-slot:
needs: [deploy-webapp-slot, deploy-api-slot, deploy-migration-slot]
needs: [deploy-webapp-slot, deploy-api-slot, deploy-pipelines-slot]
uses: ./.github/workflows/reusable-endpoint-test.yml
with:
stackName: ${{ inputs.stackName }}
Expand All @@ -165,7 +165,7 @@ jobs:
[
deploy-webapp-slot,
deploy-api-slot,
deploy-migration-slot,
deploy-pipelines-slot,
endpoint-test-application-slot,
]
uses: ./.github/workflows/reusable-e2e.yml
Expand All @@ -187,7 +187,7 @@ jobs:
[
deploy-webapp-slot,
deploy-api-slot,
deploy-migration-slot,
deploy-pipelines-slot,
execute-e2e-test,
]
environment: ${{ inputs.ghaEnvironment }}
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
[
deploy-webapp-slot,
deploy-api-slot,
deploy-migration-slot,
deploy-pipelines-slot,
execute-e2e-test,
]
environment: ${{ inputs.ghaEnvironment }}
Expand All @@ -240,14 +240,14 @@ jobs:
az functionapp deployment slot swap --slot ${{ env.slotName }} --name ${{ env.apiFunctionName }} -g ${{ steps.rgApp.outputs.out }}
az webapp traffic-routing clear --name ${{ env.apiFunctionName }} -g ${{ steps.rgApp.outputs.out }}
swap-migration-app-deployment-slot:
swap-pipelines-app-deployment-slot:
if: ${{ inputs.initialDeployment != 'true' }}
runs-on: ubuntu-latest
needs:
[
deploy-webapp-slot,
deploy-api-slot,
deploy-migration-slot,
deploy-pipelines-slot,
execute-e2e-test,
]
environment: ${{ inputs.ghaEnvironment }}
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
[
swap-nodeapi-deployment-slot,
swap-webapp-deployment-slot,
swap-migration-app-deployment-slot,
swap-pipelines-app-deployment-slot,
]
uses: ./.github/workflows/reusable-endpoint-test.yml
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sub-deploy-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
-n ${{ inputs.apiFunctionName }} \
--src ./${{ inputs.apiFunctionName }}.zip
deploy-migration-app:
deploy-pipelines-app:
runs-on: ubuntu-latest
environment: ${{ inputs.ghaEnvironment }}
steps:
Expand All @@ -113,16 +113,16 @@ jobs:
in: ${{ inputs.azResourceGrpAppEncrypted }}

- name: Deploy Azure Function Migration App
id: deploy-migration-app-step
id: deploy-pipelines-app-step
run: |
sleep 30 &&
./ops/scripts/pipeline/az-func-deploy.sh \
-g ${{ steps.rgApp.outputs.out }} \
-n ${{ inputs.pipelinesFunctionName }} \
--src ./${{ inputs.pipelinesFunctionName }}.zip
endpoint-test-application: # TODO: healthcheck/endpoint test on new migration function app?
needs: [deploy-webapp, deploy-api, deploy-migration-app]
endpoint-test-application: # TODO: healthcheck/endpoint test on new pipelines function app?
needs: [deploy-webapp, deploy-api, deploy-pipelines-app]
uses: ./.github/workflows/reusable-endpoint-test.yml
with:
stackName: ${{ inputs.stackName }}
Expand Down
2 changes: 1 addition & 1 deletion backend/function-apps/pipelines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"prestart": "npm run build && cp ../../.env .",
"start": "func start --javascript",
"build": "tsc --build tsconfig.build.json",
"pack": "../../pack.sh migration"
"pack": "../../pack.sh pipelines"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
import migrateConsolidation from '../../../function-apps/migration/queueTrigger/migrateConsolidation';
import { createMockAzureFunctionContext } from '../../../function-apps/azure/testing-helpers';
import migrateConsolidation from '../../../function-apps/pipelines/migration/queueTrigger/migrateConsolidation';

dotenv.config({ path: '../../../.env' });

Expand Down
10 changes: 5 additions & 5 deletions docs/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ installed.
##### Local Settings File

You must have a file named `local.settings.json` placed in each of the `backend/function-apps/api`
and `backend/function-apps/migration` directories.
and `backend/function-apps/pipelines` directories.

The contents of these files must be:

Expand All @@ -209,7 +209,7 @@ The contents of these files must be:
}
```

`backend/function-apps/migration`
`backend/function-apps/pipelines`

```
{
Expand All @@ -230,7 +230,7 @@ The contents of these files must be:
###### AzureWebJobsStorage

A sufficiently privileged user can retrieve the `AzureWebJobsStorage` connection string for the
`api` and `migration` function apps with the following Azure CLI command:
`api` and `pipelines` function apps with the following Azure CLI command:

```sh
az functionapp config appsettings list -g {resource-group-name} -n {function-app-name} --query "[?name=='AzureWebJobsStorage']"
Expand All @@ -254,10 +254,10 @@ curl -d "{}" -H "Content-Type: application/json" -X POST http://localhost:7071/a
curl -d "{\"apiKey\": \"{the admin key}\"}" -X DELETE http://localhost:7071/api/dev-tools/deleteMigrations

# Data Migration
curl -d "(see below)" -H "Content-Type: application/json" -X POST http://localhost:7071/migration/consolidation
curl -d "(see below)" -H "Content-Type: application/json" -X POST http://localhost:7071/pipelines/consolidation
```

Possible data for migration (example):
Possible data for pipelines (example):

```json
{
Expand Down
48 changes: 24 additions & 24 deletions ops/cloud-deployment/backend-api-deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ param apiFunctionStorageName string = 'ustpfunc${uniqueString(resourceGroup().id
@description('Storage account name. Default creates unique name from resource group id and stack name')
@minLength(3)
@maxLength(24)
param migrationFunctionStorageName string = 'ustpmigr${uniqueString(resourceGroup().id, apiFunctionName)}'
param pipelinesFunctionStorageName string = 'ustpmigr${uniqueString(resourceGroup().id, apiFunctionName)}'

param apiFunctionName string

param apiFunctionSubnetId string

param pipelinesFunctionName string

param migrationFunctionSubnetId string
param pipelinesFunctionSubnetId string

param virtualNetworkResourceGroupName string

Expand Down Expand Up @@ -91,7 +91,7 @@ param isUstpDeployment bool
param apiCorsAllowOrigins array = []

@description('List of origins to allow. Need to include protocol')
param migrationCorsAllowOrigins array = []
param pipelinesCorsAllowOrigins array = []

param sqlServerResourceGroupName string = ''

Expand Down Expand Up @@ -179,8 +179,8 @@ resource apiFunctionStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01
}
}

resource migrationFunctonStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: migrationFunctionStorageName
resource pipelinesFunctonStorageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: pipelinesFunctionStorageName
location: location
tags: {
'Stack Name': apiFunctionName
Expand All @@ -195,10 +195,10 @@ resource migrationFunctonStorageAccount 'Microsoft.Storage/storageAccounts@2022-
}
}

module migrationQueues './lib/storage/storage-queues.bicep' = {
name: 'migration-queues-module'
module pipelinesQueues './lib/storage/storage-queues.bicep' = {
name: 'pipelines-queues-module'
params: {
storageAccountName: migrationFunctionStorageName
storageAccountName: pipelinesFunctionStorageName
}
}

Expand Down Expand Up @@ -232,7 +232,7 @@ resource apiFunctionApp 'Microsoft.Web/sites@2023-12-01' = {
}


resource migrationFunctionApp 'Microsoft.Web/sites@2023-12-01' = {
resource pipelinesFunctionApp 'Microsoft.Web/sites@2023-12-01' = {
name: pipelinesFunctionName
location: location
kind: 'functionapp,linux'
Expand All @@ -244,7 +244,7 @@ resource migrationFunctionApp 'Microsoft.Web/sites@2023-12-01' = {
serverFarmId: servicePlan.id
enabled: true
httpsOnly: true
virtualNetworkSubnetId: migrationFunctionSubnetId
virtualNetworkSubnetId: pipelinesFunctionSubnetId
keyVaultReferenceIdentity: appConfigIdentity.id
}
dependsOn: [
Expand All @@ -270,7 +270,7 @@ module apiFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = {
]
}

module migrationFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = {
module pipelinesFunctionAppInsights 'lib/app-insights/function-app-insights.bicep' = {
name:'appi-${pipelinesFunctionName}-module'
scope: resourceGroup()
params: {
Expand All @@ -282,7 +282,7 @@ module migrationFunctionAppInsights 'lib/app-insights/function-app-insights.bice
functionAppName: pipelinesFunctionName
}
dependsOn: [
migrationFunctionApp
pipelinesFunctionApp
]
}

Expand Down Expand Up @@ -409,16 +409,16 @@ var baseApplicationSettings = concat(
)

//Migration Function Application Settings
var migrationApplicationSettings = concat(
var pipelinesApplicationSettings = concat(
[
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${migrationFunctonStorageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${migrationFunctonStorageAccount.listKeys().keys[0].value}'
value: 'DefaultEndpointsProtocol=https;AccountName=${pipelinesFunctonStorageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${pipelinesFunctonStorageAccount.listKeys().keys[0].value}'
}
],
baseApplicationSettings,
createApplicationInsights
? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: migrationFunctionAppInsights.outputs.connectionString }]
? [{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: pipelinesFunctionAppInsights.outputs.connectionString }]
: []
)

Expand Down Expand Up @@ -490,7 +490,7 @@ var middlewareIpSecurityRestrictionsRules = [
}
]

var migrationIpSecurityRestrictionsRules = concat(ipSecurityRestrictionsRules, middlewareIpSecurityRestrictionsRules)
var pipelinesIpSecurityRestrictionsRules = concat(ipSecurityRestrictionsRules, middlewareIpSecurityRestrictionsRules)

resource apiFunctionConfig 'Microsoft.Web/sites/config@2023-12-01' = {
parent: apiFunctionApp
Expand Down Expand Up @@ -524,20 +524,20 @@ resource apiFunctionConfig 'Microsoft.Web/sites/config@2023-12-01' = {
}
}

resource migrationFunctionConfig 'Microsoft.Web/sites/config@2023-12-01' = {
parent: migrationFunctionApp
resource pipelinesFunctionConfig 'Microsoft.Web/sites/config@2023-12-01' = {
parent: pipelinesFunctionApp
name: 'web'
properties: {
cors: {
allowedOrigins: migrationCorsAllowOrigins
allowedOrigins: pipelinesCorsAllowOrigins
}
numberOfWorkers: 1
alwaysOn: true
http20Enabled: true
functionAppScaleLimit: 0
minimumElasticInstanceCount: 0
publicNetworkAccess: 'Enabled'
ipSecurityRestrictions: migrationIpSecurityRestrictionsRules
ipSecurityRestrictions: pipelinesIpSecurityRestrictionsRules
ipSecurityRestrictionsDefaultAction: 'Deny'
scmIpSecurityRestrictions: concat([
{
Expand All @@ -551,7 +551,7 @@ resource migrationFunctionConfig 'Microsoft.Web/sites/config@2023-12-01' = {
scmIpSecurityRestrictionsDefaultAction: 'Deny'
scmIpSecurityRestrictionsUseMain: false
linuxFxVersion: linuxFxVersionMap['${functionsRuntime}']
appSettings: migrationApplicationSettings
appSettings: pipelinesApplicationSettings
ftpsState: 'Disabled'
}
}
Expand All @@ -572,14 +572,14 @@ module apiPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = {
}
}

module migrationFunctionPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = {
module pipelinesFunctionPrivateEndpoint './lib/network/subnet-private-endpoint.bicep' = {
name: '${pipelinesFunctionName}-pep-module'
scope: resourceGroup(virtualNetworkResourceGroupName)
params: {
privateLinkGroup: 'sites'
stackName: pipelinesFunctionName
location: location
privateLinkServiceId: migrationFunctionApp.id
privateLinkServiceId: pipelinesFunctionApp.id
privateEndpointSubnetId: privateEndpointSubnetId
privateDnsZoneName: privateDnsZoneName
privateDnsZoneResourceGroup: privateDnsZoneResourceGroup
Expand All @@ -595,7 +595,7 @@ module setMigrationFunctionSqlServerVnetRule './lib/network/sql-vnet-rule.bicep'
params: {
stackName: pipelinesFunctionName
sqlServerName: sqlServerName
subnetId: migrationFunctionSubnetId
subnetId: pipelinesFunctionSubnetId
}
}

Expand Down
Loading

0 comments on commit ff04e6d

Please sign in to comment.