|
| 1 | +# Infrastructure as Code (IaC) - Bicep Files |
| 2 | + |
| 3 | +This folder contains Bicep templates for deploying and managing Azure resources. Below is an overview of each file and its purpose. |
| 4 | + |
| 5 | +## Files Overview |
| 6 | + |
| 7 | +### 1. `aks.bicep` |
| 8 | +Deploys an Azure Kubernetes Service (AKS) cluster with the following configurable parameters: |
| 9 | +- **clusterName**: Name of the AKS cluster. |
| 10 | +- **location**: Azure region for the cluster. |
| 11 | +- **dnsPrefix**: DNS prefix for the Kubernetes API server. |
| 12 | +- **osDiskSizeGB**: Disk size for agent nodes. |
| 13 | +- **agentCount**: Number of agent nodes. |
| 14 | +- **agentVMSize**: VM size for agent nodes. |
| 15 | +- **logwsid**: Log Analytics workspace ID for monitoring. |
| 16 | + |
| 17 | +### 2. `app-configuration.bicep` |
| 18 | +Creates an Azure App Configuration resource with key-value pairs. Key features: |
| 19 | +- **configStoreName**: Name of the App Configuration store. |
| 20 | +- **keyValueNames**: Array of key names. |
| 21 | +- **keyValueValues**: Array of corresponding values. |
| 22 | +- **contentTypes**: Content types for the key-value pairs. |
| 23 | +- **tagsArray**: Optional tags for the key-value pairs. |
| 24 | + |
| 25 | +### 3. `app-service.bicep` |
| 26 | +Deploys an Azure App Service with an associated App Service Plan and Application Insights. Key parameters: |
| 27 | +- **webAppName**: Name of the web app. |
| 28 | +- **sku**: SKU for the App Service Plan. |
| 29 | +- **linuxFxVersion**: Runtime stack (e.g., Node.js). |
| 30 | +- **logwsid**: Log Analytics workspace ID for diagnostics. |
| 31 | + |
| 32 | +### 4. `container-app.bicep` |
| 33 | +Sets up an Azure Container App environment with logging to a Log Analytics workspace. Key parameters: |
| 34 | +- **envName**: Name of the container app environment. |
| 35 | +- **lawCustomerId**: Log Analytics workspace customer ID. |
| 36 | +- **lawSharedKey**: Log Analytics workspace shared key. |
| 37 | + |
| 38 | +### 5. `container-registry.bicep` |
| 39 | +Creates an Azure Container Registry (ACR) with role assignments for pulling images. Key parameters: |
| 40 | +- **acrName**: Name of the ACR. |
| 41 | +- **acrSku**: SKU for the ACR (e.g., Basic). |
| 42 | +- **resourcePrincipalId**: Principal ID for role assignment. |
| 43 | + |
| 44 | +### 6. `log-analytics-ws.bicep` |
| 45 | +Deploys a Log Analytics workspace for monitoring and diagnostics. Key parameters: |
| 46 | +- **prefix**: Prefix for the workspace name. |
| 47 | +- **name**: Name of the workspace. |
| 48 | +- **location**: Azure region for the workspace. |
| 49 | + |
| 50 | +### 7. `main-deploy-aca.bicep` |
| 51 | +Main deployment file for Azure Container Apps. Integrates the following modules: |
| 52 | +- Log Analytics workspace (`log-analytics-ws.bicep`) |
| 53 | +- Azure Container Registry (`container-registry.bicep`) |
| 54 | +- Azure App Configuration (`app-configuration.bicep`) |
| 55 | +- Azure Container App environment (`container-app.bicep`) |
| 56 | + |
| 57 | +This is the main Bicep file for deploying Azure Container Apps (ACA). |
| 58 | + |
| 59 | +### 8. `main-deploy-aca.dev.bicepparam` |
| 60 | +Parameter file for `main-deploy-aca.bicep`, providing values for development environments. |
| 61 | + |
| 62 | +### 9. `main-deploy-aks.bicep` |
| 63 | +Main deployment file for AKS. Integrates the following modules: |
| 64 | +- Log Analytics workspace (`log-analytics-ws.bicep`) |
| 65 | +- Azure Container Registry (`container-registry.bicep`) |
| 66 | +- AKS cluster (`aks.bicep`) |
| 67 | + |
| 68 | +This is the main Bicep file for deploying Azure Kubernetes Service (AKS). |
| 69 | + |
| 70 | +### 10. `main-deploy-app-service.bicep` |
| 71 | +Main deployment file for App Service. Integrates the following modules: |
| 72 | +- Log Analytics workspace (`log-analytics-ws.bicep`) |
| 73 | +- Azure Container Registry (`container-registry.bicep`) |
| 74 | +- App Service (`app-service.bicep`) |
| 75 | + |
| 76 | +This is the main Bicep file for deploying Azure App Service. |
| 77 | + |
| 78 | +## Usage |
| 79 | + |
| 80 | +1. Ensure you have the Azure CLI and Bicep CLI installed. |
| 81 | +2. Customize the parameter files (e.g., `main-deploy-aca.dev.bicepparam`) as needed. |
| 82 | +3. Deploy the templates using the Azure CLI: |
| 83 | + ```bash |
| 84 | + az deployment group create --resource-group <resource-group-name> --template-file <template-file> --parameters <parameter-file> |
| 85 | + ``` |
| 86 | + |
| 87 | +## Notes |
| 88 | +- Each Bicep file is modular and can be used independently or as part of a main deployment file. |
| 89 | +- Ensure proper role assignments and permissions are in place for successful deployments. |
0 commit comments