Centric's FastForge platform is our opionated framework for starting certain classes of cloud-hosted web and mobile applications based on a mainstream framework. The projects in this repository are based on the dotnet framework with a React user interface and Microsoft SQL Server.
- Root - contains files useable or using data from the varous projects. There are four projects (outlined below) that contain the source for the major components of this software, API, Testing, Infrastructure, and DevOps
- api - dotnet core API consumed by the webapp
- webapp - React single-page web application
- e2e - contains the end-to-end functional testing framework and a starter set of tests.
- tf-infrastructure - Terraform scripts to build the various cloud-based environments.
- pipelines-azure-devops - Azure DevOps build-pipeline YAML files
- github/workflows - GitHub Actions workflows YAML files
- Complete the FastForge Foundation Steps
Visit the Centric Consulting FastForge-Foundation GitHub Repository to complete the appropriate steps. < NOTE: The prerequisites and steps outlined in the FastForge Foundation Steps must be completed prior to these deployment steps.
- Docker (Desktop)
- dotnet core
If enhanced Azure Infrastructure management is desired:
- Code Editor installed
- Terraform package installed
- GIT installed
- Azure PowerShell Modules installed
Once the steps outlined in the FastForge Foundation Repository have been followed, the following tasks can be performed to deploy FastForge:
- This repository should already be generated within your Organization’s GitHub
- Navigate to the
Settings
tab within your Organization’s GitHub main page and createSecrets
needed in order to connect to the previously provisionedAzure Container Registry
. The variable information can be found under theAccess Keys
section of theAzure Container Registry
- REGISTRY_LOGIN_SERVER: Name of Container Registry created in FastForge Foundation Repository steps.azurecr.io. (Example: exampleCR123.azurecr.io)
- REGISTRY_USERNAME: Chosen Username
- REGISTRY_PASSWORD: Chosen Password (Be sure to adjust this variable if the password is refreshed on the Container Registry)
- Once the above
Secrets
values are created, the first workflow can run:- Navigate to the
Actions
tab within your Organization’s GitHub main page and select theBuildTestStage-apiWebApp (run 1st)
workflow, and select “Run workflow” on the right-hand side
- Navigate to the
After the Public GitHub Repository is created and the workflow associated to the YAML file (BuildTestStage-apiWebApp.yml
) successfully runs, the following steps can occur to deploy the needed Azure Infrastructure for a specified cloud environment:
- Five additional secrets need to be created:
- AZURE_CREDENTIALS: Process of creation
- CLIENT_ID: Client ID of Azure crednetials in the AZURE_CREDENTIALS
- CLIENT_SECRET: Client Secret of Azure crednetials in the AZURE_CREDENTIALS
- SUBSCRIPTION_ID: Subscription ID associated to the Azure Subscription
- TENANT_ID: Tenant ID of Azure crednetials in the AZURE_CREDENTIALS
- [OPTIONAL] Within GitHub Public Repositories,
Environments
(Settings > Environments > New environment) can be created to place manual approvals for infrastructure changes when the terraform workflow runs. The name of theEnvironment
should reflect the environment being built. Line #70 - #71 in theInfrastructure.yml
file can be uncommented to reflect the name of theEnvironment
created. (NOTE: this step is available for Public repositories by default, but requires a GitHub Enterprise license for Private repositories- If the
Environment
is created, select to add up to 6 resources that will approve infrastructure deployments. This step will force manual intervention to occur between the “Terraform Plan” and “Terraform Apply” stages within the workflow.
- If the
- Update the
terraform.tfvars
file for the appropriate environment (/tf-infrastructure/dev-env
) with the required values for deployment - Open the
Infrastructure.yml
file and adjust the “env” variables to reflect where the tfstate file will be located for the Terraform managed resources:- resourceGroup: Name of the
Resource Group
created in the Prerequisites step #5 - storageAccountName: Name of the
Storage Account
created in the Prerequisites step #5 - storageContainerName: Name of the
Container
created in the Prerequisites step #5 - storageKey: Name of the
.tfstate
file. Must be in<name>.tfstate
format. It is best practice to have the name reflect the environment
- resourceGroup: Name of the
- Save/commit all changes and follow the process outlined in the previous section, but select the second workflow
Infrastructure (run 2nd)
to run
The last step in the build of FastForge is the deployment of each environment’s API and WebApp. The following steps are required to complete the deployment:
- Use the
env
section within the YAML file (Deploy-apiWebApp.yml
) to store the following variable:- apiAppName: Name of app service created in the previous section step #3 (defined in the
terraform.tfvars
file)
- apiAppName: Name of app service created in the previous section step #3 (defined in the
- Save/commit all changes in the YAML file
- Navigate to the
Settings
tab within your Organization’s GitHub main page and create the lastsecret
needed in order to connect to the storage account that was provisioned in the previous section- AZURE_STORAGE_ACCOUNT_CS: Connection String for the created Storage Account
- Set the Service Principal created in the previous section to have the following permissions at the subscription level:
- Storage Blob Data Contributor
- Storage Blob Data Owner
- Navigate to the
Actions
tab within your Organization’s GitHub main page and select the third workflowDeploy-apiWebApp.yml
to run- After running the workflow, the API/WebApp will be built for the designated environment
- When needed, repeat the above steps to deploy the API/WebApp for each subsequent environment. The previous section must occur first for each environment in order to have the resources required to deploy the API/WebApp associated with this section
The last step in the build of FastForge is the changing of triggers within the 3 YAML files. Editing the YAML files to implement triggers creates a different workflow when code changes are pushed to the repository. The Workflows will now automatically trigger upon code changes to the repo and will follow the order in which they were initially deployed.
- Edit the YAML files used in steps 2-4 and follow the commented instructions defined in each file:
buildteststage-apiWebApp-pipeline.yml
-BuildTestStage-apiWebApp (run 1st)
:- Step 5: Replace lines 2-3. Uncomment lines 4 - 10
infrastructure.yml
-Infrastructure (run 2nd)
:- Step 5: Replace lines 2-3. Uncomment lines 4 – 7
deploy-apiWebApp-pipeline.yml
-Deploy-apiWebApp-pipeline (run 3rd)
:- Step 5: Replace lines 2-3. Uncomment lines 4 – 7