From e2731b9fc9a71c13f9b0fc4586d3b295e9d6e442 Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Wed, 27 Aug 2025 11:24:05 -0600
Subject: [PATCH 1/4] Add README for Azure Infrastructure Terraform setup
Added a comprehensive README for Azure Terraform templates, detailing prerequisites, templates structure, and execution steps.
---
terraform-infrastructure/README.md | 139 +++++++++++++++++++++++++++++
1 file changed, 139 insertions(+)
create mode 100644 terraform-infrastructure/README.md
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
new file mode 100644
index 0000000..57e05ab
--- /dev/null
+++ b/terraform-infrastructure/README.md
@@ -0,0 +1,139 @@
+# Azure Infrastructure:
AI Agent - Terraform Templates
+
+Costa Rica
+
+[](https://github.com/)
+[brown9804](https://github.com/brown9804)
+
+Last updated: 2025-07-17
+
+----------
+
+> This approach focuses on `setting up the required infrastructure via Terraform`. It allows for source control of not only the solution code, connections, and setups `but also the infrastructure itself`.
+
+
+
![Centered Image]()
+
+
+## Prerequisites
+
+- An `Azure subscription is required`. All other resources, including instructions for creating a Resource Group, are provided in this workshop.
+- `Contributor role assigned or any custom role that allows`: access to manage all resources, and the ability to deploy resources within subscription.
+- Please ensure that:
+ - [Terraform is installed on your local machine](https://developer.hashicorp.com/terraform/tutorials/azure-get-started/install-cli#install-terraform).
+ - [Install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) to work with both Terraform and Azure commands.
+
+## Overview
+
+Templates structure:
+
+```
+.
+├── README.md
+├────── main.tf
+├────── variables.tf
+├────── provider.tf
+├────── terraform.tfvars
+├────── outputs.tf
+```
+
+- main.tf `(Main Terraform configuration file)`: This file contains the core infrastructure code. It defines the resources you want to create, such as virtual machines, networks, and storage. It's the primary file where you describe your infrastructure in a declarative manner.
+- variables.tf `(Variable definitions)`: This file is used to define variables that can be used throughout your Terraform configuration. By using variables, you can make your configuration more flexible and reusable. For example, you can define variables for resource names, sizes, and other parameters that might change between environments.
+- provider.tf `(Provider configurations)`: Providers are plugins that Terraform uses to interact with cloud providers, SaaS providers, and other APIs. This file specifies which providers (e.g., AWS, Azure, Google Cloud) you are using and any necessary configuration for them, such as authentication details.
+- terraform.tfvars `(Variable values)`: This file contains the actual values for the variables defined in `variables.tf`. By separating variable definitions and values, you can easily switch between different sets of values for different environments (e.g., development, staging, production) without changing the main configuration files.
+- outputs.tf `(Output values)`: This file defines the output values that Terraform should return after applying the configuration. Outputs are useful for displaying information about the resources created, such as IP addresses, resource IDs, and other important details. They can also be used as inputs for other Terraform configurations or scripts.
+
+## Finding `principal_id` Using Azure CLI
+
+> The `principal_id` is typically the Object ID of a user, group, or service principal in Azure Entra ID (former AAD). You can find this ID in the Azure portal or by using the Azure CLI.
+
+Get the Object ID of list of Users:
+
+```sh
+az ad user list --query "[].{Name:displayName, ObjectId:id, Email:userPrincipalName}" --output table
+```
+
+
+
+Here is an example value for `admin_principal_id` which is Object ID you retrieved.
+
+```hcl
+admin_principal_id = "12345678-1234-1234-1234-1234567890ab"
+```
+
+## How to execute it
+
+```mermaid
+graph TD;
+ A[az login] --> B(terraform init)
+ B --> C{Terraform provisioning stage}
+ C -->|Review| D[terraform plan]
+ C -->|Order Now| E[terraform apply]
+ C -->|Delete Resource if needed| F[terraform destroy]
+```
+
+> [!IMPORTANT]
+> Please modify `terraform.tfvars` with your information, then run the following flow. If you need more visual guidance, please check the video that illustrates the provisioning steps.
+
+1. **Login to Azure**: This command logs you into your Azure account. It opens a browser window where you can enter your Azure credentials. Once logged in, you can manage your Azure resources from the command line.
+
+ > Go to the path where Terraform files are located:
+
+ ```sh
+ cd terraform-infrastructure
+ ```
+
+ ```sh
+ az login
+ ```
+
+
+
+
+
+2. **Initialize Terraform**: Initializes the working directory containing the Terraform configuration files. It downloads the necessary provider plugins and sets up the backend for storing the state.
+
+ ``` sh
+ terraform init
+ ```
+
+
+
+3. **Terraform Provisioning Stage**:
+
+ - **Review**: Creates an execution plan, showing what actions Terraform will take to achieve the desired state defined in your configuration files. It uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform plan -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+ - **Order Now**: Applies the changes required to reach the desired state of the configuration. It prompts for confirmation before making any changes. It also uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform apply -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+ - **Remove**: Destroys the infrastructure managed by Terraform. It prompts for confirmation before deleting any resources. It also uses the variable values specified in `terraform.tfvars`.
+
+ ```sh
+ terraform destroy -var-file terraform.tfvars
+ ```
+
+ > At the end, you will see a message in green if everything was executed successfully:
+
+
+
+
+
+

+
Refresh Date: 2025-07-17
+
+
From 9f25b397dc61dea6fa88dac2bdf455302d4068b9 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 27 Aug 2025 17:24:21 +0000
Subject: [PATCH 2/4] Update last modified date in Markdown files
---
terraform-infrastructure/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 57e05ab..51cb8c7 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -5,7 +5,7 @@ Costa Rica
[](https://github.com/)
[brown9804](https://github.com/brown9804)
-Last updated: 2025-07-17
+Last updated: 2025-08-27
----------
From 53aab4776da2e8bfb10be956c693e4de9a384851 Mon Sep 17 00:00:00 2001
From: Timna Brown <24630902+brown9804@users.noreply.github.com>
Date: Wed, 27 Aug 2025 11:27:11 -0600
Subject: [PATCH 3/4] updated
From e542ee30351616a7f3377217a6fe9d9f83f9a742 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 27 Aug 2025 17:27:27 +0000
Subject: [PATCH 4/4] Update visitor count
---
AI-Search_Overview.md | 4 ++--
README.md | 4 ++--
metrics.json | 37 ++++++++++++++++++++++++++++++
terraform-infrastructure/README.md | 4 ++--
4 files changed, 43 insertions(+), 6 deletions(-)
create mode 100644 metrics.json
diff --git a/AI-Search_Overview.md b/AI-Search_Overview.md
index 0d6bdd8..176238a 100644
--- a/AI-Search_Overview.md
+++ b/AI-Search_Overview.md
@@ -376,7 +376,7 @@ Click [here](https://github.com/brown9804/MicrosoftCloudEssentialsHub/tree/main/
-

-
Refresh Date: 2025-08-04
+

+
Refresh Date: 2025-08-27
diff --git a/README.md b/README.md
index a660ca3..fa49d5a 100644
--- a/README.md
+++ b/README.md
@@ -161,7 +161,7 @@ Last updated: 2025-08-20
-

-
Refresh Date: 2025-08-21
+

+
Refresh Date: 2025-08-27
diff --git a/metrics.json b/metrics.json
new file mode 100644
index 0000000..8665541
--- /dev/null
+++ b/metrics.json
@@ -0,0 +1,37 @@
+[
+ {
+ "date": "2025-07-07",
+ "count": 330,
+ "uniques": 20
+ },
+ {
+ "date": "2025-07-08",
+ "count": 159,
+ "uniques": 6
+ },
+ {
+ "date": "2025-07-10",
+ "count": 482,
+ "uniques": 1
+ },
+ {
+ "date": "2025-07-11",
+ "count": 170,
+ "uniques": 4
+ },
+ {
+ "date": "2025-07-12",
+ "count": 7,
+ "uniques": 1
+ },
+ {
+ "date": "2025-07-14",
+ "count": 130,
+ "uniques": 2
+ },
+ {
+ "date": "2025-07-15",
+ "count": 2,
+ "uniques": 1
+ }
+]
\ No newline at end of file
diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md
index 51cb8c7..e21ff13 100644
--- a/terraform-infrastructure/README.md
+++ b/terraform-infrastructure/README.md
@@ -133,7 +133,7 @@ graph TD;
-

-
Refresh Date: 2025-07-17
+

+
Refresh Date: 2025-08-27