Skip to content

Commit

Permalink
Updated Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ADO DevOps committed Apr 8, 2024
1 parent 5fb0191 commit 6b073a7
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions docs/Developer-Reference/Infrastructure/ADP Portal.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
# Azure Developer Portal

Welcome to the Azure Devoper Portal (ADP) repository. The portal is built using [Backstage](https://backstage.io/).

## Getting started

### Prerequisites

* Access to a UNIX based operating system. If on Windows it is recommended that you use [WSL](https://learn.microsoft.com/en-us/windows/wsl/)
* A GNU-like build environment available at the command line. For example, on Debian/Ubuntu you will want to have the `make` and `build-essential` packages installed
* `curl` or `wget` installed
* [Node.js Active LTS release](https://nodejs.org/en/blog/release)
* [Yarn](https://classic.yarnpkg.com/en/docs/install#windows-stable)
* [Docker](https://docs.docker.com/engine/install/)
* [Git](https://github.com/git-guides/install-git)
- Access to a UNIX based operating system. If on Windows it is recommended that you use [WSL](https://learn.microsoft.com/en-us/windows/wsl/)
- A GNU-like build environment available at the command line. For example, on Debian/Ubuntu you will want to have the `make` and `build-essential` packages installed
- `curl` or `wget` installed
- [Node.js Active LTS release](https://nodejs.org/en/blog/release)
- [Yarn](https://classic.yarnpkg.com/en/docs/install#windows-stable)
- [Docker](https://docs.docker.com/engine/install/)
- [Git](https://github.com/git-guides/install-git)

See the [Backstage Getting Started documentation](https://backstage.io/docs/getting-started/#prerequisites) for the full list of prerequisites.

### Integrations

The portal is integrated with various 3rd party services. Connections to these services are managed through the environment variables below:

* GitHub (via a GitHub app)
* Entra ID/Azure/ADO/Microsoft Graph (via an App Registration). ADO also uses a PAT token in some (very limited) scenarios.
* Azure Managed Grafana
* Azure Blob Storage (for TechDocs)
* AKS
- GitHub (via a GitHub app)
- Entra ID/Azure/ADO/Microsoft Graph (via an App Registration). ADO also uses a PAT token in some (very limited) scenarios.
- Azure Managed Grafana
- Azure Blob Storage (for TechDocs)
- AKS

### DevContainers

Development can be done within a devcontainer if you wish. Once the devcontainer is set up, simply fill out the `.env` file at the root and rebuild the container. Once rebuilt, you will need to log into the az cli to the tenant you wish to connect to using `az login --tenant <TenantId>`

If you are using VSCode, the steps are as follows:

1. Install the [DevContainers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. Open the command pallet and run the `Dev Containers: Clone Repository in Container Volume` command
3. Either select the github option and locate the repo, or enter `https://github.com/DEFRA/adp-portal.git`
4. Once the dev container is ready, open the `.env` file at the root, and fill it out with the variables described below
5. Open the command pallet and run the `Dev Containers: Rebuild Container` command
6. Once the dev container is rebuilt, run `az login --tenant <YOUR_TENANT_ID>`
7. To start the application, run `cd app && yarn dev`

To sign commits using GPG from within the devcontainer, please follow [the steps here](https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials#_sharing-gpg-keys)

### Environment Variables
The application requires the following environment variables to be set. We recommend creating an *env.sh* file in the root of your repo (this is ignored by Git) and pasting the variables in to this file. Before running the application, run `. ./env.sh` from the root of your repo.

The application requires the following environment variables to be set. We recommend creating an _env.sh_ file in the root of your repo (this is ignored by Git) and pasting the variables in to this file. Before running the application, run `. ./env.sh` from the root of your repo.

```sh
export GITHUB_APP_ID=""
Expand Down Expand Up @@ -63,22 +82,26 @@ export SND3_CLUSTER_API_SERVER_ADDRESS=""
To convert a GitHub private key into a format that can be used in the `GITHUB_PRIVATE_KEY` environment variable use one of the following scripts:

**Powershell**

```powershell
$rsaprivkey = (Get-Content "private-key.pem" | Out-String) -replace "`r`n", "\n"
```

**Shell**

```sh
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' private-key.pem > rsaprivkey.txt
```

### Techdocs
A hybrid strategy is implemented for techdocs which means documentation can be generated on the fly by out of the box generator or using an external pipeline.

A hybrid strategy is implemented for techdocs which means documentation can be generated on the fly by out of the box generator or using an external pipeline.
All generated documentation are stored in Azure blob storage.

For more info please refer : [Ref](./app/packages/backend/src/plugins/techdocs/Techdocs.md)

### Running locally

Run the following commands from the `/app` directory:

```sh
Expand All @@ -87,9 +110,11 @@ yarn dev
```

### Configuration

If you want to override any settings in `./app/app-config.yaml`, create a local configuration file named `app-config.local.yaml` and define your overrides here.

### Mac
### Mac

You need to have the [azure cli](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-macos) installed and the [azure development](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-mac) client installed

Login into both az, and azd before running the server.
Expand All @@ -98,6 +123,7 @@ Login into both az, and azd before running the server.
az login --tenant XXXXX.azure.com
az auth login --tenant-id <your tenant id>
```

You must run the application in the same browser session, that the authentication ran in. If you use a "private window", new session, it will not have access to the required cookies to complete authentication, and you will get a 'user not found' error message

## Feature Requests
Expand Down

0 comments on commit 6b073a7

Please sign in to comment.