Skip to content
efssantosPublic

About

Azure documentation repository

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

☁️ Azure Infrastructure with Bicep

Microsoft Azure

Azure Bicep Infrastructure as Code Azure CLI


Enterprise-ready Azure infrastructure deployment using declarative Infrastructure as Code with Bicep.

📖 Overview

This repository provides a foundational setup for managing Azure infrastructure using Azure Bicep, Microsoft's domain-specific language for deploying Azure resources. It enables you to define your cloud resources in a clear, concise, and declarative manner, allowing for consistent and repeatable deployments across different environments (e.g., Development, Staging, Production).

The primary focus of this initial setup is the deployment of an Azure App Service Plan, configured with environment-specific parameters.

✨ Features

  • Declarative Infrastructure: Define your Azure resources using Bicep's intuitive syntax.
  • Environment-Specific Deployments: Utilize parameter files (.bicepparam) to manage different configurations for various environments (dev, hml, prd).
  • App Service Plan Deployment: Easily provision an Azure App Service Plan with customizable names and locations.
  • Modular Design (Planned): Structured with a modules directory, ready for implementing reusable Bicep components.

🛠️ Tech Stack

  • IaC Language: Azure Bicep
  • Cloud Platform: Microsoft Azure
  • CLI Tool: Azure CLI

🚀 Getting Started with Deployment

To deploy the infrastructure defined in this repository, you'll need the Azure CLI and the Bicep extension.

Prerequisites

  • An active Azure Subscription.
  • Azure CLI installed. You can download it from Azure CLI documentation.
  • Bicep CLI extension for Azure CLI. Install it using:
    az bicep install

Installation & Setup

  1. Clone the repository:

    git clone https://github.com/efssantos/azure.git
    cd azure
  2. Log in to Azure: Ensure you are logged into your Azure account via the CLI:

    az login

    Follow the browser-based authentication prompt.

  3. Create a Resource Group: Choose an existing resource group or create a new one to deploy your resources.

    az group create --name my-bicep-rg --location eastus

    Replace my-bicep-rg and eastus with your desired resource group name and Azure region.

Deployment Guide

The main.bicep file requires environment and location parameters. We use .bicepparam files for environment-specific configurations.

  1. Configure Environment Parameters: The .bicepparam files in this repository are currently empty. You will need to populate them with the appropriate values for each environment.

    For example, create/update main.dev.bicepparam:

    using 'main.bicep'
    
    param environment = 'dev'
    param location = 'eastus' // Or another desired location

    Repeat for main.hml.bicepparam (e.g., environment = 'hml') and main.prd.bicepparam (e.g., environment = 'prd'), adjusting location as needed.

  2. Deploy to Azure: Use the Azure CLI to deploy the main.bicep template with the corresponding parameter file to your resource group.

    For Development (dev) environment:

    az deployment group create \
      --resource-group my-bicep-rg \
      --template-file main.bicep \
      --parameters main.dev.bicepparam

    For Homologation (hml) environment:

    az deployment group create \
      --resource-group my-bicep-rg \
      --template-file main.bicep \
      --parameters main.hml.bicepparam

    For Production (prd) environment:

    az deployment group create \
      --resource-group my-bicep-rg \
      --template-file main.bicep \
      --parameters main.prd.bicepparam

    Upon successful deployment, an Azure App Service Plan named appserviceplan-[environment] (e.g., appserviceplan-dev) will be created in your specified resource group and location.

📁 Project Structure

azure/
├── main.bicep             # Main Bicep template defining infrastructure
├── main.dev.bicepparam    # Parameters for the development environment
├── main.hml.bicepparam    # Parameters for the homologation/staging environment
├── main.prd.bicepparam    # Parameters for the production environment
├── modules/               # Directory for reusable Bicep modules (currently empty)
└── README.md              # Project README file

⚙️ Configuration

main.bicep Parameters

The main.bicep template accepts the following parameters:

Parameter Type Description Default Value Required
environment string The environment name (e.g., dev, hml, prd). (None) Yes
location string The Azure region to deploy resources to. resourceGroup().location No

These parameters should be provided via .bicepparam files or directly in the CLI during deployment.

Parameter Files (.bicepparam)

These files (main.dev.bicepparam, main.hml.bicepparam, main.prd.bicepparam) are used to override default parameter values defined in main.bicep for specific environments. They allow you to manage unique settings (like environment name, resource location, or specific SKU details) without modifying the core Bicep template.

🤝 Contributing

We welcome contributions to enhance this Azure Bicep infrastructure. Please see our Contributing Guide for details on how to get started.

Development Setup for Contributors

  1. Ensure you have the Prerequisites installed.
  2. Clone the repository and set up your Azure CLI authentication.
  3. Familiarize yourself with the existing Bicep files and structure.
  4. If adding new modules, place them in the modules/ directory.

📄 License

This project is licensed under the LICENSE_NAME - see the LICENSE file for details.

🙏 Acknowledgments

  • Azure Bicep team for providing an excellent IaC language.
  • Microsoft Azure documentation for comprehensive guides.

📞 Support & Contact


⭐ Star this repo if you find it helpful!

Made with ❤️ by efssantos

About

Azure documentation repository

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages