Skip to content

Commit ce7122f

Browse files
committed
Merge branch 'main' of https://github.com/Azure-Samples/Copilot-Studio-with-Azure-AI-Search into sbaidachni/azddown
2 parents a2a53d6 + 55366b0 commit ce7122f

File tree

16 files changed

+187
-113
lines changed

16 files changed

+187
-113
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ updates:
77
commit-message:
88
prefix: "chore(deps):"
99
groups:
10-
all-dependencies:
10+
devcontainer:
1111
patterns:
1212
- "*"
1313
- package-ecosystem: "terraform"
@@ -19,7 +19,7 @@ updates:
1919
commit-message:
2020
prefix: "chore(deps):"
2121
groups:
22-
all-dependencies:
22+
terraform-providers:
2323
patterns:
2424
- "*"
2525
- package-ecosystem: "github-actions"
@@ -29,6 +29,6 @@ updates:
2929
commit-message:
3030
prefix: "chore(deps):"
3131
groups:
32-
all-dependencies:
32+
github-actions:
3333
patterns:
3434
- "*"

.github/workflows/azure-dev.yml

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ on:
2323
# GitHub Actions workflow to deploy to Azure using azd
2424

2525
permissions:
26+
actions: read # Needed for uploading SARIF reports
27+
security-events: write # Needed for uploading SARIF reports
2628
id-token: write
2729
contents: read
2830

@@ -37,23 +39,23 @@ jobs:
3739

3840
steps:
3941
- name: Checkout the branch ${{ github.ref_name }}
40-
uses: actions/checkout@v4
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4143
with:
4244
ref: ${{ github.ref_name }}
4345

4446
- name: Install azd
45-
uses: Azure/setup-azd@v2
47+
uses: Azure/setup-azd@ae0f8b5482eeac61e940f447327d84c73beb8b1e # v2.1.0
4648
with:
4749
version: '1.17.2' # Specify your desired azd version here
4850

4951
- name: Install Terraform
50-
uses: hashicorp/setup-terraform@v3
52+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
5153
with:
5254
terraform_version: 1.9.0
5355

5456

5557
- name: Install TFLint
56-
uses: terraform-linters/setup-tflint@v4
58+
uses: terraform-linters/setup-tflint@90f302c255ef959cbfb4bd10581afecdb7ece3e6 # v4.1.1
5759
with:
5860
tflint_version: v0.49.0
5961
github_token: ${{ secrets.GITHUB_TOKEN }} # Used to avoid rate
@@ -68,84 +70,80 @@ jobs:
6870
gitleaks version
6971
7072
- name: Setup .NET SDK
71-
uses: actions/setup-dotnet@v4
73+
uses: actions/setup-dotnet@55ec9447dda3d1cf6bd587150f3262f30ee10815 # v3.4.2
7274
with:
7375
dotnet-version: '8.0.x'
7476

77+
- name: Install Power Platform Tools
78+
uses: microsoft/powerplatform-actions/actions-install@51f663ea104eb227c3712215ceb2f82827d81c27 # v1.9.0
79+
7580
- name: Install Power Platform CLI
7681
run: |
77-
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
82+
dotnet tool install --global Microsoft.PowerApps.CLI.Tool --version 1.44.2
7883
pac help
7984
85+
8086
- name: Set Up Python
81-
uses: actions/setup-python@v5
87+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
8288
with:
8389
python-version: "3.x"
8490

8591
- name: Install Checkov
8692
run: pip install checkov
8793

88-
8994
- name: Login to Azure with Federated Identity
90-
uses: azure/login@v2
95+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
9196
with:
9297
client-id: ${{ vars.AZURE_CLIENT_ID }}
9398
tenant-id: ${{ vars.AZURE_TENANT_ID }}
9499
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
95100

96101
- name: Provision Infrastructure
97102
env:
98-
POWER_PLATFORM_USE_CLI: false
99-
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
100-
RS_STORAGE_ACCOUNT: ${{ vars.RS_STORAGE_ACCOUNT }}
101-
RS_CONTAINER_NAME: ${{ vars.RS_CONTAINER_NAME }}
102-
RS_RESOURCE_GROUP: ${{ vars.RS_RESOURCE_GROUP }}
103-
RESOURCE_SHARE_USER: ${{ vars.RESOURCE_SHARE_USER }}
103+
POWER_PLATFORM_USE_OIDC: "true"
104+
POWER_PLATFORM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
105+
POWER_PLATFORM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
106+
104107
ARM_USE_AZUREAD: "true"
105108
ARM_STORAGE_USE_AZUREAD: "true"
106109
ARM_USE_OIDC: "true"
107110
ARM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
108111
ARM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
109112
ARM_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
110-
POWER_PLATFORM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
111-
POWER_PLATFORM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
112-
POWER_PLATFORM_USE_OIDC: "true"
113+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
114+
115+
RS_STORAGE_ACCOUNT: ${{ vars.RS_STORAGE_ACCOUNT }}
116+
RS_CONTAINER_NAME: ${{ vars.RS_CONTAINER_NAME }}
117+
RS_RESOURCE_GROUP: ${{ vars.RS_RESOURCE_GROUP }}
118+
119+
RESOURCE_SHARE_USER: ${{ vars.RESOURCE_SHARE_USER }}
120+
113121
GITHUB_PAT: ${{ secrets.MCS_RUNNER }}
114122
GITHUB_REPO_OWNER: ${{ github.repository_owner }}
115123
GITHUB_REPO_NAME: ${{ github.event.repository.name }}
116124
GITHUB_RUNNER_IMAGE_NAME: "github-runner"
117125
GITHUB_RUNNER_IMAGE_TAG: "latest"
118126
GITHUB_RUNNER_IMAGE_BRANCH: ${{ github.ref_name }}
119-
shell: pwsh
127+
shell: bash
120128
run: |
121129
azd config set auth.useAzCliAuth "true"
122-
azd env new $env:AZURE_ENV_NAME --location $env:AZURE_LOCATION --no-prompt
123-
azd env set RESOURCE_SHARE_USER "$env:RESOURCE_SHARE_USER"
124-
azd env set POWER_PLATFORM_USE_CLI "false"
125-
126-
azd env set RS_STORAGE_ACCOUNT $env:RS_STORAGE_ACCOUNT
127-
azd env set RS_CONTAINER_NAME $env:RS_CONTAINER_NAME
128-
azd env set RS_RESOURCE_GROUP $env:RS_RESOURCE_GROUP
129-
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
130+
azd env new "$AZURE_ENV_NAME" --location "$AZURE_LOCATION" --no-prompt
131+
azd env set RESOURCE_SHARE_USER "$RESOURCE_SHARE_USER"
136132
133+
azd env set RS_STORAGE_ACCOUNT "$RS_STORAGE_ACCOUNT"
134+
azd env set RS_CONTAINER_NAME "$RS_CONTAINER_NAME"
135+
azd env set RS_RESOURCE_GROUP "$RS_RESOURCE_GROUP"
137136
138-
azd env set GITHUB_PAT $env:GITHUB_PAT
139-
azd env set GITHUB_REPO_OWNER $env:GITHUB_REPO_OWNER
140-
azd env set GITHUB_REPO_NAME $env:GITHUB_REPO_NAME
141-
azd env set GITHUB_RUNNER_IMAGE_NAME $env:GITHUB_RUNNER_IMAGE_NAME
142-
azd env set GITHUB_RUNNER_IMAGE_TAG $env:GITHUB_RUNNER_IMAGE_TAG
143-
azd env set GITHUB_RUNNER_IMAGE_BRANCH $env:GITHUB_RUNNER_IMAGE_BRANCH
137+
azd env set GITHUB_PAT "$GITHUB_PAT"
138+
azd env set GITHUB_REPO_OWNER "$GITHUB_REPO_OWNER"
139+
azd env set GITHUB_REPO_NAME "$GITHUB_REPO_NAME"
140+
azd env set GITHUB_RUNNER_IMAGE_NAME "$GITHUB_RUNNER_IMAGE_NAME"
141+
azd env set GITHUB_RUNNER_IMAGE_TAG "$GITHUB_RUNNER_IMAGE_TAG"
142+
azd env set GITHUB_RUNNER_IMAGE_BRANCH "$GITHUB_RUNNER_IMAGE_BRANCH"
144143
145144
azd provision --no-prompt
146145
147-
148-
- uses: actions/upload-artifact@v4
146+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
149147
if: success() || failure()
150148
with:
151149
name: sarif-reports
@@ -154,42 +152,42 @@ jobs:
154152
./checkov-results.sarif/results_sarif.sarif
155153
156154
- name: Upload Gitleaks SARIF report to Github
157-
uses: github/codeql-action/upload-sarif@v3
155+
uses: github/codeql-action/upload-sarif@9b02dc2f60288b463e7a66e39c78829b62780db7 # v2.22.1
158156
with:
159157
sarif_file: ./gitleaks-report.sarif
160158

161159

162160
- name: Upload Checkov SARIF Report to GitHub
163-
uses: github/codeql-action/upload-sarif@v3
161+
uses: github/codeql-action/upload-sarif@9b02dc2f60288b463e7a66e39c78829b62780db7 # v2.22.1
164162
with:
165163
sarif_file: ./checkov-results.sarif/results_sarif.sarif
166164

167-
168165
- name: Azd down
169-
if: ${{ github.event.inputs.run_azd_down == true }}
166+
if: ${{ github.event.inputs.run_azd_down == 'true' }}
170167
env:
171-
POWER_PLATFORM_USE_CLI: false
172-
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
173-
RS_STORAGE_ACCOUNT: ${{ vars.RS_STORAGE_ACCOUNT }}
174-
RS_CONTAINER_NAME: ${{ vars.RS_CONTAINER_NAME }}
175-
RS_RESOURCE_GROUP: ${{ vars.RS_RESOURCE_GROUP }}
176-
RESOURCE_SHARE_USER: ${{ vars.RESOURCE_SHARE_USER }}
168+
POWER_PLATFORM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
169+
POWER_PLATFORM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
170+
POWER_PLATFORM_USE_OIDC: "true"
171+
177172
ARM_USE_AZUREAD: "true"
178173
ARM_STORAGE_USE_AZUREAD: "true"
179174
ARM_USE_OIDC: "true"
180175
ARM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
181176
ARM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
182177
ARM_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
183-
POWER_PLATFORM_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
184-
POWER_PLATFORM_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
185-
POWER_PLATFORM_USE_OIDC: "true"
186-
shell: pwsh
187-
run: |
178+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
188179

189-
azd env set RS_STORAGE_ACCOUNT $env:RS_STORAGE_ACCOUNT
190-
azd env set RS_CONTAINER_NAME $env:RS_CONTAINER_NAME
191-
azd env set RS_RESOURCE_GROUP $env:RS_RESOURCE_GROUP
192-
azd env set RESOURCE_SHARE_USER "$env:RESOURCE_SHARE_USER"
180+
RS_STORAGE_ACCOUNT: ${{ vars.RS_STORAGE_ACCOUNT }}
181+
RS_CONTAINER_NAME: ${{ vars.RS_CONTAINER_NAME }}
182+
RS_RESOURCE_GROUP: ${{ vars.RS_RESOURCE_GROUP }}
183+
RESOURCE_SHARE_USER: ${{ vars.RESOURCE_SHARE_USER }}
184+
185+
shell: bash
186+
run: |
187+
azd env set RS_STORAGE_ACCOUNT "$RS_STORAGE_ACCOUNT"
188+
azd env set RS_CONTAINER_NAME "$RS_CONTAINER_NAME"
189+
azd env set RS_RESOURCE_GROUP "$RS_RESOURCE_GROUP"
190+
azd env set RESOURCE_SHARE_USER "$RESOURCE_SHARE_USER"
193191
194-
azd env select $env:AZURE_ENV_NAME
192+
azd env select "$AZURE_ENV_NAME"
195193
azd down --no-prompt --force --purge

.github/workflows/terraform-validate.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Setup Terraform
5353
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
5454
with:
55-
terraform_version: "1.12.2" # Pinning specific version is recommended
55+
terraform_version: "1.9.0" # Pinning specific version
5656

5757
- name: Terraform Init
5858
id: tf-init
@@ -89,7 +89,7 @@ jobs:
8989
working-directory: ./infra
9090

9191
- name: Setup TFLint
92-
uses: terraform-linters/setup-tflint@v4
92+
uses: terraform-linters/setup-tflint@90f302c255ef959cbfb4bd10581afecdb7ece3e6 # v4.1.1
9393
with:
9494
tflint_version: v0.49.0 # Specify a version (recommended)
9595
github_token: ${{ secrets.GITHUB_TOKEN }} # Used to avoid rate limiting
@@ -121,7 +121,7 @@ jobs:
121121

122122
- name: GitLeaks Scan
123123
id: gitleaks
124-
uses: gitleaks/gitleaks-action@v2
124+
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
125125
env:
126126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127127
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
@@ -132,7 +132,7 @@ jobs:
132132

133133
- name: Upload GitLeaks SARIF report
134134
if: success() || failure() # Upload even if GitLeaks finds issues
135-
uses: github/codeql-action/upload-sarif@v3
135+
uses: github/codeql-action/upload-sarif@9b02dc2f60288b463e7a66e39c78829b62780db7 # v2.22.1
136136
with:
137137
directory: ./ # Ensure the report path is correct
138138
sarif_file: results.sarif
@@ -151,7 +151,7 @@ jobs:
151151

152152
- name: Upload Checkov SARIF report
153153
if: success() || failure() # Upload even if Checkov finds issues
154-
uses: github/codeql-action/upload-sarif@v3
154+
uses: github/codeql-action/upload-sarif@9b02dc2f60288b463e7a66e39c78829b62780db7 # v2.22.1
155155
env:
156156
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157157
with:

.github/workflows/test-runner.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout the branch ${{ github.ref_name }}
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4343
with:
4444
ref: ${{ github.ref_name }}
4545

@@ -110,7 +110,7 @@ jobs:
110110
continue-on-error: true # Continue even if tests fail to ensure artifacts are uploaded
111111

112112
- name: Upload test results as workflow artifact
113-
uses: actions/upload-artifact@v4
113+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
114114
if: (!cancelled()) # Upload artifacts even if tests fail
115115
with:
116116
name: pytest-test-results
@@ -120,7 +120,7 @@ jobs:
120120
retention-days: 30
121121

122122
- name: Publish pytest test results
123-
uses: dorny/test-reporter@v2
123+
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
124124
if: (!cancelled()) # Run even if tests fail
125125
with:
126126
name: Azure AI Search E2E Tests

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,17 @@ This architecture ensures that sensitive enterprise data never traverses public
7575
- [**Copilot in Power Apps**](https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/ai-overview?WT.mc_id=ppac_inproduct_settings): Enable this setting to allow AI-powered assistance within Power Apps development
7676
- [**Publish Copilots with AI features**](https://learn.microsoft.com/en-us/microsoft-copilot-studio/security-and-governance): Allow Copilot authors to publish from Copilot Studio when AI features are enabled
7777
- **Power Platform licenses**. The designated user must have the following Power Platform licenses assigned:
78-
- Microsoft Power Apps
79-
- Power Automate
80-
- Copilot Studio
78+
- **Microsoft Power Apps**
79+
- **Power Automate**
80+
- **Copilot Studio**
81+
82+
To simplify license management, you can use an Azure subscription with a Billing Policy instead of assigning licenses directly. Configure this by using the following flag:
83+
84+
```shell
85+
azd env set USE_BILLING_POLICY "true"
86+
```
87+
88+
**Note:** After creating the Billing Policy, navigate to the [Power Platform Admin Center](https://aka.ms/ppac) and ensure that the *Copilot Studio* product is selected. This is a known issue that will be addressed in future updates.
8189

8290
### User Configuration
8391

@@ -125,6 +133,7 @@ A related option is VS Code Dev Containers, which will open the project in your
125133
126134
1. Install the required tools:
127135
136+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest&pivots=winget) - Required for managing Azure resources and authentication
128137
- [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd) - Platform-specific installers available via package managers or direct download
129138
- [PowerShell 7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) - Required for non-Windows systems; Windows users may use built-in PowerShell
130139
- [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) - Includes .NET CLI, runtime, and development tools
@@ -149,7 +158,7 @@ A related option is VS Code Dev Containers, which will open the project in your
149158
150159
The steps below will provision Azure and Power Platform resources and will deploy Copilot Studio bot.
151160
152-
1. Login to you Azure and config azd to use Az CLI authentication:
161+
1. Login to your Azure account and config azd to use Az CLI authentication:
153162
154163
```shell
155164
az login --service-principal --username <SP_CLIENT_ID> --password <SP_SECRET> --tenant <TENANT_ID>
@@ -160,7 +169,6 @@ The steps below will provision Azure and Power Platform resources and will deplo
160169
161170
```shell
162171
pac auth create --name az-cli-auth --applicationId <SP_CLIENT_ID> --clientSecret <SP_SECRET> --tenant <TENANT_ID> --accept-cleartext-caching
163-
export POWER_PLATFORM_USE_CLI="true"
164172
```
165173
166174
*Note: the `pac auth create` command may return a warning about being unable to connect to a Dataverse organization. This is expected, and will not impact the deployment.*

azd-hooks/scripts/hooks/postprovision/deploy_power_platform_solution.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ID of the Power Platform environment to deploy to
2727
2828
.PARAMETER RunSolutionChecker
29-
Whether to run solution checker after deployment (default: true)
29+
Whether to run solution checker after deployment (default: false)
3030
3131
.PARAMETER AISearchConnectionId
3232
Direct connection ID for the Azure AI Search connector (highest priority)

0 commit comments

Comments
 (0)