Add Cosmos DB 'orders' container to infra

未关闭 适合新手
#49 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
azure, powershell

调研方向

首先找到用于预配 Cosmos DB 产品容器的基础设施文件;issue 没有指定文件路径或测试。阅读该容器的声明方式,然后确定如何预配分区键为 /customerId 的订单容器。完成标准是全新部署包含这两个容器,并且启动初始化不再在订单步骤失败。

由索引模型根据 Issue 内容生成。

描述

Problem
GET /orders returned 500 on the app service

Root cause
CosmosDbService.InitializeAsync runs these steps in order: create db → create products → create orders (pk /customerId) → seed products → seed orders. The app's managed identity has Cosmos DB Built-in Data Contributor, which can't create containers with an AAD token. The orders step failed with 403 / substatus 5300 (POST /dbs/catalogdb/colls), and startup init stopped there.

The products seed never ran → products had 0 documents → empty list.
orders didn't exist → GetOrdersAsync got a 404 → 500.
The IaC only provisioned products, so every fresh deployment reproduces this.

主要语言
PowerShell
星标
45
派生
76
平均合并
1 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Cloud Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。