Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Before you can build any agents, the tire factory's data foundation and Azure re
* **Container Registry** and a **Container Apps Environment** for the agents you deploy in later challenges

<details>
<summary>Cosmos DB data model (7 containers)</summary>
<summary>Cosmos DB data model (13 containers)</summary>

| Container | Partition key | Purpose | Sample count |
|-----------|--------------|---------|--------------|
Expand All @@ -35,6 +35,12 @@ Before you can build any agents, the tire factory's data foundation and Azure re
| `PartsInventory` | `/category` | Spare parts | 16 parts |
| `Technicians` | `/department` | Maintenance staff | 6 technicians |
| `WorkOrders` | `/status` | Maintenance history | 5 work orders |
| `MaintenanceHistory` | `/machineId` | Past repairs per machine | 12 records |
| `MaintenanceWindows` | `/isAvailable` | Production windows for planned work | 17 windows |
| `Suppliers` | `/category` | Parts suppliers | 5 suppliers |
| `MaintenanceSchedules` | `/id` | Written by the Maintenance Scheduler Agent (challenge 4) | empty |
| `PartsOrders` | `/id` | Written by the Parts Ordering Agent (challenge 4) | empty |
| `ChatHistories` | `/entityId` | Agent conversation history (challenge 4) | empty |

</details>

Expand Down Expand Up @@ -176,10 +182,10 @@ az cosmosdb sql container list \
--account-name "$COSMOS_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP" \
--database-name "FactoryOpsDB" \
--query "[].id" --output tsv
--query "[].name" --output tsv
```

You should see all seven containers listed in [Context and Background](#-context-and-background). Then confirm the knowledge base wiki articles were uploaded to Blob Storage:
You should see all 13 containers listed in [Context and Background](#-context-and-background). Then confirm the knowledge base wiki articles were uploaded to Blob Storage:

```bash
az storage blob list \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ across the agents and workflow.
## What `main.bicep` provisions

- Storage account with a `machine-wiki` blob container (knowledge base articles).
- Cosmos DB account (serverless) with the `FactoryOpsDB` database and its 10 containers
- Cosmos DB account (serverless) with the `FactoryOpsDB` database and its 13 containers (10 seeded with data, 3 empty for the challenge 4 agents)
(partition keys and the 30-day TTL on `Telemetry` match the source hack's seeding script).
- Azure AI Search, Microsoft Foundry account/project with the `gpt-5.4-mini`, `gpt-5.4`, and
`text-embedding-3-large` model deployments, and the AI Search/App Insights connections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ var openAiContributorRoleId = subscriptionResourceId('Microsoft.Authorization/ro
var storageBlobDataContributorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')
var cosmosDbDataContributorRoleId = '00000000-0000-0000-0000-000000000002'

// The 10 Cosmos containers seeded with sample factory-operations data.
// Matches challenge-0/seed-data.sh's `containers_config` in the source hack.
// The 10 Cosmos containers seeded with sample factory-operations data, plus the 3 that the
// challenge 4 agents write to (created empty so the agents never need to create them).
// Matches challenge-0/seed-data.sh's `containers_config` in the source hack and the partition
// keys in src/agents/services/cosmos_db_service.py.
var cosmosContainers = [
{ name: 'Machines', partitionKeyPath: '/type' }
{ name: 'Thresholds', partitionKeyPath: '/machineType' }
Expand All @@ -52,6 +54,9 @@ var cosmosContainers = [
{ name: 'MaintenanceHistory', partitionKeyPath: '/machineId' }
{ name: 'MaintenanceWindows', partitionKeyPath: '/isAvailable' }
{ name: 'Suppliers', partitionKeyPath: '/category' }
{ name: 'MaintenanceSchedules', partitionKeyPath: '/id' }
{ name: 'PartsOrders', partitionKeyPath: '/id' }
{ name: 'ChatHistories', partitionKeyPath: '/entityId' }
]

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ az cosmosdb sql container list \
--account-name "$COSMOS_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP" \
--database-name "FactoryOpsDB" \
--query "[].id" --output tsv
--query "[].name" --output tsv
```

Expected output (order may vary):
Expand All @@ -95,6 +95,12 @@ KnowledgeBase
PartsInventory
Technicians
WorkOrders
MaintenanceHistory
MaintenanceWindows
Suppliers
MaintenanceSchedules
PartsOrders
ChatHistories
```

```bash
Expand All @@ -112,7 +118,7 @@ Expected output: `5`

```bash
# Re-upload the knowledge base wiki articles
for f in data/kb-wiki/*.md; do
for f in 03-Azure/01-04-AI/08_Predictive_Maintenance/labautomation/data/kb-wiki/*.md; do
az storage blob upload \
--connection-string "$AZURE_STORAGE_CONNECTION_STRING" \
--container-name machine-wiki \
Expand Down