Skip to content

Commit 751bae2

Browse files
Update project metadata
1 parent e617913 commit 751bae2

File tree

4 files changed

+67
-44
lines changed

4 files changed

+67
-44
lines changed

.github/copilot-instructions.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copilot Instructions
2+
3+
- **Purpose**: Catalog of reusable Azure Bicep modules published to ACR `acrty7og2i6qpv3s` under `bicep/modules/{module}`; registry is provisioned by the platform-strategic-services project.
4+
- **Layout**: Each module lives in `modules/<name>/` with `main.bicep` plus `metadata.json` carrying `version.major|minor|revision`. Publishing fails if either file is missing.
5+
- **Versioning behavior**: Non-main builds publish `V{major}.{minor}.{revision}-preview` only. Main builds also push `V{major}.x`, `V{major}.{minor}.x`, and `latest` when the full version tag is new.
6+
- **Publish script**: [Publish-BicepModuleToAcr.ps1](../.azure-pipelines/scripts/Publish-BicepModuleToAcr.ps1) drives tagging; it skips publishing when the `V{major}.{minor}.{revision}` tag already exists. Repository prefix defaults to `bicep/modules`.
7+
- **Pipelines**: [devops-secure-scanning](../.azure-pipelines/devops-secure-scanning.yml) runs weekly and on PRs to main using `jobs/devops-secure-scanning.yml` from the `ado-pipeline-templates` repo. [release-to-production](../.azure-pipelines/release-to-production.yml) builds with `bicep-lint-code` then loops modules to publish via service connection `spn-bicep-modules-production`; scheduled weekly and on main.
8+
- **Local workflow**: Update `metadata.json` when changing `main.bicep`; validate with `az bicep build --file modules/<name>/main.bicep`. Manual publish example:
9+
```powershell
10+
pwsh ./.azure-pipelines/scripts/Publish-BicepModuleToAcr.ps1 `
11+
-moduleName keyvault `
12+
-modulesRootPath ./modules `
13+
-acrName acrty7og2i6qpv3s `
14+
-previewRelease $true
15+
```
16+
Requires `az login` and rights to the registry.
17+
- **Module catalogue**: modules include `apiManagementLogger`, `apiManagementSubscription`, `appConfigurationStore`, `appInsights`, `frontDoorCNAME`, `frontDoorEndpoint`, `keyVault`, `keyVaultAccessPolicy`, `keyVaultRoleAssignment`, `keyVaultSecret`, `sqlDatabase`, `storageAccount`, `webTest`.
18+
- **Dependencies**: Pipelines consume templates from the `ado-pipeline-templates` GitHub repo and require Azure CLI with Bicep installed.
19+
- **Docs**: See [docs/overview.md](../docs/overview.md) and [docs/development-workflows.md](../docs/development-workflows.md) for module layout and pipeline details.

README.md

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,20 @@
11
# Bicep Modules
22

3-
[![Build Status](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.DevOpsSecureScanning?branchName=main)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=209&branchName=main)
4-
[![Build Status](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.OnePipeline?repoName=frasermolyneux%2fbicep-modules&branchName=main&stageName=Build)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=175&repoName=frasermolyneux%2fbicep-modules&branchName=main)
5-
[![Build Status](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.OnePipeline?repoName=frasermolyneux%2fbicep-modules&branchName=main&stageName=Deploy)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=175&repoName=frasermolyneux%2fbicep-modules&branchName=main)
3+
[![DevOps Secure Scanning](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.DevOpsSecureScanning?branchName=main)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=209&branchName=main)
4+
[![Pipeline Build](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.OnePipeline?repoName=frasermolyneux%2fbicep-modules&branchName=main&stageName=Build)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=175&repoName=frasermolyneux%2fbicep-modules&branchName=main)
5+
[![Pipeline Deploy](https://dev.azure.com/frasermolyneux/Personal-Public/_apis/build/status%2fbicep-modules.OnePipeline?repoName=frasermolyneux%2fbicep-modules&branchName=main&stageName=Deploy)](https://dev.azure.com/frasermolyneux/Personal-Public/_build/latest?definitionId=175&repoName=frasermolyneux%2fbicep-modules&branchName=main)
66

7-
---
7+
## Documentation
8+
- [Overview](docs/overview.md) - Module layout, catalogue, and registry dependencies
9+
- [Development Workflows](docs/development-workflows.md) - Pipelines, local validation, and publish guidance
810

911
## Overview
10-
11-
This repository contains common Bicep modules and associated Azure DevOps pipelines for the validation and deployment of them to an Azure Container Registry.
12-
13-
The Azure Container Registry is deployed by the `platform-strategic-services` project and therefore a dependency.
14-
15-
---
16-
17-
## Related Projects
18-
19-
* [frasermolyneux/platform-strategic-services](https://github.com/frasermolyneux/platform-strategic-services) - The Azure Container Registry is deployed by this project.
20-
* [frasermolyneux/azure-landing-zones](https://github.com/frasermolyneux/azure-landing-zones) - The deploy service principal is managed by this project.
21-
22-
---
23-
24-
## Solution
25-
26-
The included Bicep modules have been extracted out of a series of projects that I have worked on through my learning and development. They are largely focused on Azure Integration Services such as API Management, Azure Functions, App Services and Key Vault.
27-
28-
### Versioning
29-
30-
Each module within the solution has a metadata `.json` file that is within the `metadata` folder. Currently this contains a JSON payload that simply has a version object containing `major`, `minor` and `revision` properties - there is the future potential to add additional metadata here such as tagging, author and description. For each module file there *must* be a metadata file and for a new version to be pushed the metadata file must be updated.
31-
32-
If the build is running from any branch other than `main` then a *-preview* suffix is added to the tag and the `.x` and `latest` tags will not be pushed.
33-
34-
As such, for a new version to be pushed the metadata file is required to be updated. There is no automation at present as it is not warranted.
35-
36-
---
37-
38-
## Pipelines
39-
40-
The `one-pipeline` is within the `.azure-pipelines` folder and output is visible on the [frasermolyneux/Personal-Public](https://dev.azure.com/frasermolyneux/Personal-Public/_build?definitionId=175) Azure DevOps project.
41-
42-
The [Publish-BicepModuleToAcr.ps1](/.azure-pipelines/scripts/Publish-BicepModuleToAcr.ps1) script is executed per module and uses the following rules to publish:
43-
44-
* Will only push a new version if the `major.minor.revision` tag does not already exist
45-
* When pushing a new version will also push that version using the a `.x` and `latest` tag
46-
47-
---
12+
Reusable Azure Bicep modules for Integration Services workloads, published to `acrty7og2i6qpv3s` under `bicep/modules/{module}`. Modules ship with per-folder metadata for versioning and are linted/published through Azure DevOps using templates from `ado-pipeline-templates`. The registry itself is deployed by the `platform-strategic-services` project.
4813

4914
## Contributing
5015

5116
Please read the [contributing](CONTRIBUTING.md) guidance; this is a learning and development project.
5217

53-
---
54-
5518
## Security
5619

5720
Please read the [security](SECURITY.md) guidance; I am always open to security feedback through email or opening an issue.

docs/development-workflows.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Development Workflows
2+
3+
## Pipelines
4+
- `devops-secure-scanning` runs weekly (Thu 02:00 UTC) and on PRs to main using the `ado-pipeline-templates` security scanning job.
5+
- `release-to-production` runs on main and weekly (Thu 03:00 UTC). Stage `Build` runs `bicep-lint-code` against `modules/`. Stage `Deploy` loops through each module folder and calls `Publish-BicepModuleToAcr.ps1` against ACR `acrty7og2i6qpv3s` using service connection `spn-bicep-modules-production`.
6+
7+
## Local changes
8+
- Edit `modules/<name>/main.bicep` and bump `modules/<name>/metadata.json` version before publishing.
9+
- Validate locally with `az bicep build --file modules/<name>/main.bicep` (or `bicep build`).
10+
- Optional manual publish (requires `az login` and rights to the registry):
11+
```powershell
12+
pwsh ./.azure-pipelines/scripts/Publish-BicepModuleToAcr.ps1 `
13+
-moduleName keyvault `
14+
-modulesRootPath ./modules `
15+
-acrName acrty7og2i6qpv3s `
16+
-previewRelease $true
17+
```
18+
Set `-previewRelease $false` to mirror main-branch behavior, which also pushes `V{major}.x`, `V{major}.{minor}.x`, and `latest` tags when creating a new version.
19+
- The publish script only pushes a new version when the tag does not already exist; reruns skip existing tags with a warning.

docs/overview.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Overview
2+
3+
This repository collects reusable Bicep modules for Azure resources and publishes them to the `acrty7og2i6qpv3s` container registry under the `bicep/modules/{module}` repositories. Modules were extracted from practical projects and focus on Integration Services workloads such as API Management, App Service, Functions, Key Vault, Storage, and Front Door.
4+
5+
## Module layout
6+
- Each module lives in `modules/<name>/` with `main.bicep` and a `metadata.json` containing `version.major`, `version.minor`, and `version.revision`.
7+
- When the release pipeline runs on non-main branches, tags get a `-preview` suffix and no `.x` or `latest` tags are pushed.
8+
- On main, the `Publish-BicepModuleToAcr.ps1` script also pushes `V{major}.x`, `V{major}.{minor}.x`, and `latest` tags when a new full version is published.
9+
10+
## Module catalogue
11+
- `apiManagementLogger` / `apiManagementSubscription` for APIM logging and subscription setup
12+
- `appConfigurationStore` for App Configuration instances
13+
- `appInsights` for Application Insights instances
14+
- `frontDoorCNAME` and `frontDoorEndpoint` for Front Door DNS and endpoint plumbing
15+
- `keyVault`, `keyVaultAccessPolicy`, `keyVaultRoleAssignment`, `keyVaultSecret` for Key Vault primitives
16+
- `sqlDatabase` for SQL Database
17+
- `storageAccount` for Storage Accounts
18+
- `webTest` for Application Insights availability tests
19+
20+
## Dependencies
21+
- The container registry used for publish lives in the `platform-strategic-services` project.
22+
- Azure CLI with Bicep CLI installed is required locally; pipelines run via Azure DevOps using the `ado-pipeline-templates` repository.

0 commit comments

Comments
 (0)