Skip to content

Commit debb961

Browse files
Enhance precheck scripts with tenant and role validation
- Added checks for Azure tenant match and user type in precheck.ps1 and precheck.sh to prevent cross-tenant deployment issues. - Implemented role assignment checks in both scripts to ensure necessary permissions are granted for deployment. - Updated Docker checks to clarify requirements based on environment (Local vs. Codespace/DevContainer). - Introduced resource provider registration checks to ensure all required providers are registered before deployment. - Enhanced model quota checks to utilize a centralized quota check script, allowing for better management of Azure OpenAI model quotas.
1 parent e7157db commit debb961

8 files changed

Lines changed: 1112 additions & 257 deletions

File tree

azure.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ requiredVersions:
66
azd: '>= 1.18.0 != 1.23.9'
77
bicep: '>= 0.33.0'
88
hooks:
9-
preprovision:
10-
windows:
11-
shell: pwsh
12-
run: ./scripts/precheck.ps1
13-
interactive: true
14-
continueOnError: false
15-
posix:
16-
shell: sh
17-
run: bash ./scripts/precheck.sh
18-
interactive: true
19-
continueOnError: false
209
postdeploy:
2110
windows:
2211
run: |

azure_custom.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ services:
4545
continueOnError: false
4646

4747
hooks:
48-
preprovision:
49-
windows:
50-
shell: pwsh
51-
run: ./scripts/precheck.ps1
52-
interactive: true
53-
continueOnError: false
54-
posix:
55-
shell: sh
56-
run: bash ./scripts/precheck.sh
57-
interactive: true
58-
continueOnError: false
5948
postdeploy:
6049
windows:
6150
run: |

docs/DeploymentGuide.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,40 @@ To optimize costs and integrate with your existing Azure infrastructure, you can
277277

278278
</details>
279279

280-
## Step 4: Deploy the Solution
280+
## Step 4: Run the Deployment Pre-Check (Recommended)
281+
282+
Before kicking off `azd up`, run the standalone pre-check script to validate your environment, identity, regions, RBAC roles, resource providers, and Azure OpenAI quota in one shot. The script is **not** wired into `azd up` — it is a manual, read-only diagnostic you can run as many times as you like.
283+
284+
Run the script that matches your shell, from the repository root:
285+
286+
```bash
287+
# Linux / macOS / Codespaces / WSL
288+
bash scripts/precheck.sh
289+
```
290+
291+
```powershell
292+
# Windows (PowerShell 7+)
293+
pwsh scripts/precheck.ps1
294+
```
295+
296+
**What it checks (15 sections):** environment detection, `azd` / Azure CLI / Bicep / Python / Node / Docker tooling, `jq` (bash only), Azure login + subscription, tenant match (cross-tenant + Guest user detection), RBAC roles (Contributor + UAA/RBAC Admin, or Owner), app registration permission, required resource providers, `azd` environment variables, presence of deployment hook scripts, and an Azure OpenAI quota report across the recommended regions.
297+
298+
**Exit codes:**
299+
300+
| Exit Code | Meaning |
301+
|-----------|---------|
302+
| `0` | All checks passed (warnings allowed) — safe to proceed to Step 5 |
303+
| `1` | One or more critical checks failed — fix the issues listed in the summary and re-run before invoking `azd up` |
304+
305+
For the full list of checks, severities, and remediation steps, see [DeploymentPreChecks.md](./DeploymentPreChecks.md).
306+
307+
## Step 5: Deploy the Solution
281308

282309
💡 **Before You Start:** If you encounter any issues during deployment, check our [Troubleshooting Guide](./TroubleShootingSteps.md) for common solutions.
283310

284311
⚠️ **Critical: Redeployment Warning** - If you have previously run `azd up` in this folder (i.e., a `.azure` folder exists), you must [create a fresh environment](#creating-a-new-environment) to avoid conflicts and deployment failures.
285312

286-
### 4.1 Authenticate with Azure
313+
### 5.1 Authenticate with Azure
287314

288315
```shell
289316
azd auth login
@@ -301,7 +328,7 @@ azd auth login --tenant-id <tenant-id>
301328
2. Navigate to **Microsoft Entra ID** from the left-hand menu
302329
3. Under the **Overview** section, locate the **Tenant ID** field. Copy the value displayed
303330

304-
### 4.2 Start Deployment
331+
### 5.2 Start Deployment
305332
**NOTE:** If you are running the latest azd version (version 1.23.9), please run the following command.
306333
```bash
307334
azd config set provision.preflight off
@@ -326,19 +353,19 @@ azd up
326353

327354
**⚠️ Deployment Issues:** If you encounter errors or timeouts, try a different region as there may be capacity constraints. For detailed error solutions, see our [Troubleshooting Guide](./TroubleShootingSteps.md).
328355

329-
### 4.3 Get Application URL
356+
### 5.3 Get Application URL
330357

331358
After successful deployment:
332359
1. Open [Azure Portal](https://portal.azure.com/)
333360
2. Navigate to your resource group
334361
3. Find the Frontend App Service
335362
4. Copy the **Default domain**
336363

337-
⚠️ **Important:** Complete [Post-Deployment Steps](#step-5-post-deployment-configuration) before accessing the application.
364+
⚠️ **Important:** Complete [Post-Deployment Steps](#step-6-post-deployment-configuration) before accessing the application.
338365

339-
## Step 5: Post-Deployment Configuration
366+
## Step 6: Post-Deployment Configuration
340367

341-
### 5.1 Run Post Deployment Script
368+
### 6.1 Run Post Deployment Script
342369

343370
1. You can upload Team Configurations using command printed in the terminal. The command will look like one of the following. Run the appropriate command for your shell from the project root:
344371

@@ -358,32 +385,32 @@ After successful deployment:
358385
![Usecase selection](./images/Usecase_selection.png)
359386

360387

361-
### 5.2 Configure Authentication (Optional)
388+
### 6.2 Configure Authentication (Optional)
362389

363390
1. Follow [App Authentication Configuration](./azure_app_service_auth_setup.md)
364391
2. Wait up to 10 minutes for authentication changes to take effect
365392

366-
### 5.3 Verify Deployment
393+
### 6.3 Verify Deployment
367394

368-
1. Access your application using the URL from Step 4.3
395+
1. Access your application using the URL from Step 5.3
369396
2. Confirm the application loads successfully
370397
<!-- 3. Verify you can sign in with your authenticated account -->
371398

372-
### 5.4 Test the Application
399+
### 6.4 Test the Application
373400

374401
**Quick Test Steps:**
375402

376-
1. **Access the application** using the URL from Step 4.3
403+
1. **Access the application** using the URL from Step 5.3
377404
2. **Sign in** with your authenticated account
378-
3. **Select a use case** from the available scenarios you uploaded in Step 5.1
405+
3. **Select a use case** from the available scenarios you uploaded in Step 6.1
379406
4. **Ask a sample question** relevant to the selected use case
380407
5. **Verify the response** includes appropriate multi-agent collaboration
381408
6. **Check the logs** in Azure Portal to confirm backend processing
382409

383410
📖 **Detailed Instructions:** See the complete [Sample Workflow](./SampleQuestions.md) guide for step-by-step testing procedures and sample questions for each use case.
384411

385412

386-
## Step 6: Clean Up (Optional)
413+
## Step 7: Clean Up (Optional)
387414

388415
### Remove All Resources
389416

0 commit comments

Comments
 (0)