Skip to content

Commit dcb71a0

Browse files
ianjensenismeCopilotdevorekristenphongcaomindlessroman
authored
138: Add Azure Deployment Script Functionality (#168)
* Net new azure deployment script resources and related updates --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: devorekristen <[email protected]> Co-authored-by: Phong Cao <[email protected]> Co-authored-by: Hannah K <[email protected]> Co-authored-by: Matt Dotson <[email protected]> Co-authored-by: mattdot <[email protected]> Co-authored-by: Eduardo Sanchez <[email protected]> Co-authored-by: mawasile <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 2d06672 commit dcb71a0

36 files changed

+2145
-590
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Azure Developer CLI",
3-
"image": "mcr.microsoft.com/devcontainers/go:1.4.1-bullseye",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.4.1-bullseye",
44
"features": {
55
// terraform and az (required for auth) are installed by default
66
// See https://containers.dev/features for list of features
@@ -11,7 +11,6 @@
1111
"ghcr.io/devcontainers/features/terraform:1": {
1212
"installTFsec": true
1313
},
14-
"ghcr.io/azure/azure-dev/azd:latest": {},
1514
"ghcr.io/devcontainers/features/dotnet:2": {
1615
"version": "8.0"
1716
},
@@ -36,7 +35,8 @@
3635
"ms-azuretools.vscode-azureterraform",
3736
"terraform-linters.tflint-vscode",
3837
"microsoft-IsvExpTools.powerplatform-vscode",
39-
"ms-vscode.azurecli"
38+
"ms-vscode.azurecli",
39+
"bierner.markdown-mermaid"
4040
// Include other VSCode extensions if needed
4141
// Right click on an extension inside VSCode to add directly to devcontainer.json, or copy the extension ID
4242
],

.github/instructions/copilot-instructions.md renamed to .github/copilot-instructions.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copilot Instructions
2+
3+
## Project Overview
4+
15
This repository implements an enterprise-grade integration between Microsoft Copilot Studio and Azure AI Search using Terraform infrastructure as code and Azure Developer CLI for deployment.
26

37
We use Terraform with the Azure Provider for all infrastructure provisioning, following a modular structure with separate files for different service types (main.ai.tf, main.search.tf, main.network.tf, etc.).
@@ -32,7 +36,11 @@ We implement retry logic and exponential backoff for transient failures in Power
3236

3337
We use GitHub Actions workflows with federated identity credentials for CI/CD, avoiding long-lived secrets.
3438

35-
## Terraform Best Practices
39+
We name our feature branches using the following format: mcs/<github user name>/<issue number>-<short-description>
40+
41+
## Coding Guidelines
42+
43+
### Terraform Best Practices
3644

3745
- Use `snake_case` for all variable, resource, and module names.
3846
- Use double quotes (`"`) for strings, not single quotes.
@@ -66,6 +74,7 @@ We use GitHub Actions workflows with federated identity credentials for CI/CD, a
6674
- Use lifecycle rules like `create_before_destroy` with caution.
6775
- Never store secrets in plain text in `.tf` files.
6876
- Do not commit `.tfstate`, `.tfvars`, or `.terraform/` folders.
77+
- Every .tf file should end with a single blank after the last non-blank line.
6978

7079
## Testing
7180

@@ -132,4 +141,3 @@ azd down # Destroy all provisioned resources
132141
- Use remote state (e.g., Azure Storage backend) to avoid local state file conflicts.
133142
- Use `outputs.tf` to export values required by `azd` to deploy and configure services.
134143
- Reference service-level variables via `${azurerm_...}` resources in outputs for app service bindings.
135-
- We name our feature branches using the following format: mcs/<github user name>/<issue number>-<short-description>

.github/workflows/azure-dev.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
AZURE_ENV_NAME: ${{ github.event.inputs.azd_environment_name || 'CICD' }}
3535
AZURE_LOCATION: ${{ github.event.inputs.azure_location || 'eastus' }}
3636

37+
3738
steps:
3839
- name: Checkout the branch ${{ github.ref_name }}
3940
uses: actions/checkout@v4
@@ -50,6 +51,7 @@ jobs:
5051
with:
5152
terraform_version: 1.9.0
5253

54+
5355
- name: Install TFLint
5456
uses: terraform-linters/setup-tflint@v4
5557
with:
@@ -83,17 +85,14 @@ jobs:
8385
- name: Install Checkov
8486
run: pip install checkov
8587

88+
8689
- name: Login to Azure with Federated Identity
8790
uses: azure/login@v2
8891
with:
8992
client-id: ${{ vars.AZURE_CLIENT_ID }}
9093
tenant-id: ${{ vars.AZURE_TENANT_ID }}
9194
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
9295

93-
- name: Authenticate with Azure Developer CLI
94-
run: |
95-
azd auth login --client-id ${{ vars.AZURE_CLIENT_ID }} --tenant-id ${{ vars.AZURE_TENANT_ID }} --federated-credential-provider "github"
96-
9796
- name: Provision Infrastructure
9897
env:
9998
POWER_PLATFORM_USE_CLI: false
@@ -128,6 +127,14 @@ jobs:
128127
azd env set RS_CONTAINER_NAME $env:RS_CONTAINER_NAME
129128
azd env set RS_RESOURCE_GROUP $env:RS_RESOURCE_GROUP
130129
130+
azd env set GITHUB_PAT $env:GITHUB_PAT
131+
azd env set GITHUB_REPO_OWNER $env:GITHUB_REPO_OWNER
132+
azd env set GITHUB_REPO_NAME $env:GITHUB_REPO_NAME
133+
azd env set GITHUB_RUNNER_IMAGE_NAME $env:GITHUB_RUNNER_IMAGE_NAME
134+
azd env set GITHUB_RUNNER_IMAGE_TAG $env:GITHUB_RUNNER_IMAGE_TAG
135+
azd env set GITHUB_RUNNER_IMAGE_BRANCH $env:GITHUB_RUNNER_IMAGE_BRANCH
136+
137+
131138
azd env set GITHUB_PAT $env:GITHUB_PAT
132139
azd env set GITHUB_REPO_OWNER $env:GITHUB_REPO_OWNER
133140
azd env set GITHUB_REPO_NAME $env:GITHUB_REPO_NAME
@@ -137,6 +144,7 @@ jobs:
137144
138145
azd provision --no-prompt
139146
147+
140148
- uses: actions/upload-artifact@v4
141149
if: success() || failure()
142150
with:
@@ -150,11 +158,13 @@ jobs:
150158
with:
151159
sarif_file: ./gitleaks-report.sarif
152160

161+
153162
- name: Upload Checkov SARIF Report to GitHub
154163
uses: github/codeql-action/upload-sarif@v3
155164
with:
156165
sarif_file: ./checkov-results.sarif/results_sarif.sarif
157166

167+
158168
- name: Azd down
159169
if: ${{ github.event.inputs.run_azd_down == true }}
160170
env:

.github/workflows/test-runner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
echo "Create a new virtual environment"
4949
python3 -m venv .copilot_venv
5050
51-
- name: Run `data/upload_data.py` script
51+
- name: Run `search/upload_data.py` script
5252
run: |
5353
echo "Activate the virtual environment"
5454
source .copilot_venv/bin/activate

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ terraform.rc
445445
# Checkov & Gitleaks reports
446446
*.sarif
447447

448+
# Lint results
448449
# Lint results
449450
infra_lint_res.xml
450451

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ The steps below will provision Azure and Power Platform resources and will deplo
159159
1. Login to your Power Platform:
160160

161161
```shell
162-
pac auth create --name az-cli-auth --applicationId <SP_CLIENT_ID> --clientSecret <SP_SECRET> --tenant <TENANT_ID>
162+
pac auth create --name az-cli-auth --applicationId <SP_CLIENT_ID> --clientSecret <SP_SECRET> --tenant <TENANT_ID> --accept-cleartext-caching
163163
export POWER_PLATFORM_USE_CLI="true"
164164
```
165165

data/Benefit_Options.pdf

-532 KB
Binary file not shown.
-569 KB
Binary file not shown.
-554 KB
Binary file not shown.

data/PerksPlus.pdf

-113 KB
Binary file not shown.

0 commit comments

Comments
 (0)