https://github.com/ljtill/bicep-scaffold
Ready to use Bicep templates for building, validating, and deploying Azure resources with GitHub Actions
https://github.com/ljtill/bicep-scaffold
azure bicep github template
Last synced: 10 months ago
JSON representation
Ready to use Bicep templates for building, validating, and deploying Azure resources with GitHub Actions
- Host: GitHub
- URL: https://github.com/ljtill/bicep-scaffold
- Owner: ljtill
- License: mit
- Created: 2021-04-04T11:38:20.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T17:17:11.000Z (12 months ago)
- Last Synced: 2025-03-20T17:23:05.804Z (11 months ago)
- Topics: azure, bicep, github, template
- Language: Bicep
- Homepage:
- Size: 66.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scaffold
Use this template to quickly set up a new repository with pre-configured automation for deploying Azure services.
The workflow consists of three main stages: build, test, and deploy. These stages are flexible and can be adjusted to suit various deployment scenarios.
In the `src/` directory, you'll find the following components:
- `main.bicep`: This Bicep file orchestrates the deployment of resource groups and resources.
- `functions/`: This directory contains a set of reusable functions, such as resource name generation.
- `modules/`: In this directory, you'll find reusable scope and resource modules.
- `parameters/`: This directory holds parameter files for environment-specific configurations.
- `types/`: Contains type definitions for both templates and parameter files.
---
## Getting Started
### Deployment
#### Azure CLI
```bash
az stack sub create \
--name 'Scaffold' \
--template-file './src/main.bicep' \
--parameters './src/parameters/main.bicepparam' \
--action-on-unmanage 'deleteAll' \
--deny-settings-mode 'denyWriteAndDelete' \
--yes
```
```bash
az stack sub delete \
--name 'Scaffold' \
--delete-all \
--yes
```
#### GitHub Actions
Entra ID - Application
- Browse to the Entra admin center
- Navigate to the 'Identity', 'Applications', 'App registrations' blade
- Select 'New registration' and provide a Name for the application
- Select the newly created application and select 'Certificates & secrets'
- Select 'Federated credentials' and 'Add credential'
- Choose 'GitHub Actions deploying Azure resources'
- Provide the 'Organization (username)' and Repository for the credential
- Select 'Entity type' - Branch and provide 'main'
- Repeat process for 'Entity type' - Pull Request
Azure Resource Manager - Role Assignment
- Navigate to the Subscription in the Azure portal
- Select 'Access control (IAM)' and 'Add' - 'Add role assignment'
- Select Role - Contributor and select 'Members'
- Provide the 'Name' of the application from the previous steps
GitHub Actions - Secrets
- Navigate to 'Settings' on the repository
- Select 'Secrets' and 'Actions' link
- Select 'New repository secret' and create secrets for the following:
- AZURE_TENANT_ID
- AZURE_SUBSCRIPTION_ID
- AZURE_CLIENT_ID
---
### Links
- [Bicep](https://github.com/Azure/bicep)
- [Templates](https://docs.microsoft.com/azure/templates)