Skip to content

Commit 3de1cfd

Browse files
authored
Merge pull request #366 from NHSDigital/faq-private-link
Infrastructure documentation
2 parents d1e4d53 + 7fccf5d commit 3de1cfd

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

docs/infrastructure/deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ When a pull request is raised, add a "deploy" label to deploy a _review app_ (co
4343

4444
To make this process faster and less costly, most of the infrastructure is reused for all review apps: networking, key vaults, container app environments... The base infrastructure is only updated by the pipeline on the main branch.
4545

46-
When the pull request is closed or merged, and if it has the "deploy" label, the [Delete review app](https://github.com/NHSDigital/dtos-manage-breast-screening/actions/workflows/cicd-1-pull-request-closed.yaml) workflow is triggered, followed by the [Delete review app](https://dev.azure.com/nhse-dtos/dtos-manage-breast-screening/_build?definitionId=103) Azure devops pipeline. It runs _terraform destroy_ to delete the resources.
46+
Also, by default a container version of postgres is deployed, as opposed to a full Azure postgres server. This behaviour can be changed by setting `deploy_database_as_container` to false. Note: each postgres container exposes a unique port, based on the PR number.
4747

48-
Note: terraform currently deploys a postgres server with a locked database. It must be deleted manually from the Azure portal before the pipeline runs.
48+
When the pull request is closed or merged, and if it has the "deploy" label, the [Delete review app](https://github.com/NHSDigital/dtos-manage-breast-screening/actions/workflows/cicd-1-pull-request-closed.yaml) workflow is triggered, followed by the [Delete review app](https://dev.azure.com/nhse-dtos/dtos-manage-breast-screening/_build?definitionId=103) Azure devops pipeline. It runs _terraform destroy_ to delete the resources.
4949

5050
### Main branch
5151

docs/infrastructure/infra-faq.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- [Terraform](#terraform)
44
- [Github action triggering Azure devops pipeline](#github-action-triggering-azure-devops-pipeline)
55
- [Bicep errors](#bicep-errors)
6+
- [Front door](#front-door)
67

78
## Terraform
89

@@ -171,3 +172,28 @@ Race condition: the managed identity is not created in time for the resources th
171172
```
172173

173174
Request Owner role on subscriptions via PIM.
175+
176+
## Front door
177+
178+
### Error 504
179+
180+
When an environment is freshly created, accessing the app via fornt door may result in a blank page and 504 HTTP error.
181+
182+
This is because the private link between front door and the container app environment must be manually approved:
183+
184+
- Navigate to the container app environment, Settings, Networking, Private Endpoints
185+
- It should show "1 Private Endpoint". Click on it.
186+
- You should see a connection with Connection State = "Pending"
187+
- Click on the connection name (a long ID in black, not the blue private endpoint link)
188+
- Click "✔️ Approve" at the top
189+
- Wait a few minutes until Connection State shows Approved
190+
191+
### Private link not created
192+
193+
When an origin is created, it must create a unique private link between front door and the container app environment. The private link automatically creates a private endpoint associated with the container app environment. When more origins are added, the same link is used.
194+
195+
If the private endpoint is deleted, for example if container app environment is deleted, the private link is gone and the origins are silently orphans. When the container app environment is recreated, even if the apps and origins are redeployed, azure will not recreate the private link.
196+
197+
All the deployed apps show a blank page and 504 HTTP error.
198+
199+
The solution is to delete all the origins to this particular container app environment. Then when the first origin is readded, the private link will be created. Recreate the other origins and they will use the same link.

0 commit comments

Comments
 (0)