You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/json.instructions.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,3 +10,12 @@ applyTo: '**/*.json'
10
10
- If $schema is defined, ensure that all changes are validated.
11
11
- Use two spaces for indentation. Do not use tabs.
12
12
- Sort properties alphabetically.
13
+
14
+
## $schema URLs
15
+
16
+
- Always reference JSON schemas from `raw.githubusercontent.com`, never from `github.com/.../blob/...`. The `blob/` URL serves an HTML preview page, not the schema JSON, so editors and validators cannot fetch or validate against it.
17
+
- Use the `refs/heads/<branch>` form (or a pinned tag/commit) so the URL is unambiguous and stable.
- When adding or updating a `$schema` value in any JSON file, convert any `github.com/<org>/<repo>/blob/<ref>/<path>` URL to `raw.githubusercontent.com/<org>/<repo>/refs/heads/<ref>/<path>` (or the appropriate `refs/tags/<tag>` form for pinned versions).
Copy file name to clipboardExpand all lines: .github/python.instructions.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
description: 'Python coding conventions and guidelines'
3
-
applyTo: '**/*.py'
3
+
applyTo: '**/*.py,**/*.ipynb'
4
4
---
5
5
6
6
# Copilot Instructions (Python)
@@ -18,9 +18,10 @@ This ensures all code changes comply with the project's linting standards from t
18
18
## Ruff Expectations
19
19
20
20
- Use explicit imports (avoid `from module import *`), especially in notebooks, to prevent `F403/F405`.
21
-
- Keep lines within the configured length limit (see `pyproject.toml`), and wrap long strings or calls.
21
+
- Keep lines within the configured length limit (**150 characters** per `pyproject.toml`), and wrap long strings or calls. **Inline comments on assignments are the most commonly missed line-length offender** — when `var = value # comment` would exceed 150 chars, move the comment to its own line(s) above the assignment.
22
22
- Avoid f-strings without placeholders (e.g., `F541`).
23
23
-**Ruff gap:**`PLC0415` (`import-outside-toplevel`) only flags imports inside functions and classes. It does **not** flag imports inside module-level `if` / `else` / `try` blocks. Ruff will not catch those, so the top-of-file import rule below must be enforced manually.
24
+
-**Notebook cells follow the same rules** as `.py` files except for `F821` and `F401` (suppressed via per-file-ignores because notebook cells share kernel state). Line-length, quote style, and import placement still apply. After editing notebook cells, run `get_errors` and resolve any ruff `compileError` entries; ignore only the `"X" is not defined` cross-cell false positives.
Copy file name to clipboardExpand all lines: .github/skills/sample-creator/SKILL.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,8 @@ Assert that the deployment was successful by making calls to the deployed APIs.
189
189
190
190
### Cell 6: Python - Verification
191
191
192
+
Use `ApimRequests` and `ApimTesting` for structured test verification with verbose logging. If the sample also needs **traffic generation loops** (multi-caller simulation, load generation, etc.), add separate cells that use `requests.Session()` instead — see the "Testing and Traffic Generation" section in `copilot-instructions.md` for the session pattern.
193
+
192
194
```python
193
195
from apimrequests import ApimRequests
194
196
from apimtesting import ApimTesting
@@ -213,6 +215,8 @@ print_ok('All done!')
213
215
214
216
## Step 5: Create main.bicep
215
217
218
+
> **Always reuse infrastructure-provided resources.** The infrastructure deployment already creates an APIM service, a Log Analytics workspace, and an Application Insights component (the latter wired to APIM as the `apim-logger`). Sample `main.bicep` files must consume these via `existing` resource references — **do not** redeploy them. Only deploy a sample-local copy of one of these resources when the sample has a documented reason that satisfies one of the exceptions in `.github/copilot-instructions.md` ("Always reuse infrastructure-provided resources"). When wiring API-level diagnostics, omit the `apimLoggerName` parameter so APIs inherit the infrastructure logger automatically.
Copy file name to clipboardExpand all lines: AGENTS.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,14 @@ This repository provides resources to deploy Azure API Management infrastructure
10
10
-**Samples**: Real-world policy examples that can be deployed to any supported infrastructure
11
11
-**Shared Resources**: Reusable Bicep modules, Python helpers, and policy templates
12
12
13
+
## Accessibility Baseline
14
+
15
+
All repository contributions should treat accessibility as a first-class quality requirement.
16
+
17
+
- Use WCAG 2.0 AA as the default baseline for user-facing outputs, including documentation, web content, workbook/dashboard visuals, and presentation materials.
18
+
- Do not rely on color alone to convey meaning; pair color cues with labels, text, icons, or structure.
19
+
- Preserve or improve contrast and readability when editing existing assets.
20
+
13
21
## Repository Structure
14
22
15
23
```text
@@ -120,6 +128,7 @@ Skills provide templates, patterns, and step-by-step workflows.
-**Workbook files**: Azure Monitor Workbook JSON files use the `<name>.workbook.json` suffix (e.g., `costing.workbook.json`). One workbook per file, stored in the sample folder, loaded into Bicep via `loadJsonContent('<name>.workbook.json')`, and pushed back to Azure via a sample-local `update-workbook.ps1`. See the *Azure Monitor Workbook File Convention* section in `.github/copilot-instructions.md`.
123
132
-**Admin APIs**: Samples needing admin/operational endpoints use path `{api_prefix}admin` with `subscriptionRequired=True` and kebab-case operation paths (e.g., `/load-cache`)
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ It's quick and easy to get started!
67
67
|[AuthX][sample-authx]| Authentication and role-based authorization in a mock HR API. | All infrastructures |
68
68
|[AuthX Pro][sample-authx-pro]| Authentication and role-based authorization in a mock product with multiple APIs and policy fragments. | All infrastructures |
69
69
|[Azure Maps][sample-azure-maps]| Proxying calls to Azure Maps with APIM policies. | All infrastructures |
70
-
|[Costing][sample-costing]| Track and allocate API costs per business unit using APIM subscriptions, Entra ID application tracking, and AI Gateway token/PTU tracking via Log Analytics and Cost Management. | All infrastructures |
70
+
|[Costing][sample-costing]| Track and allocate API costs per business unit using APIM subscriptions, Entra ID application tracking, and AI Gateway token/PTU tracking including streaming (SSE) token usage, which is not simple to capture correctly in APIM. | All infrastructures |
71
71
|[Dynamic CORS][sample-dynamic-cors]| Dynamic per-API CORS origin validation using custom policy fragments and a maintainable origin mapping. | All infrastructures |
72
72
|[Egress Control][sample-egress-control]| Control APIM outbound internet traffic by routing it through a Network Virtual Appliance (NVA) in a hub/spoke topology. | appgw-apim, appgw-apim-pe |
73
73
|[General][sample-general]| Basic demo of APIM sample setup and policy usage. | All infrastructures |
Copy file name to clipboardExpand all lines: assets/APIM-Samples-Slide-Deck.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1117,8 +1117,8 @@ <h4>Azure Maps</h4>
1117
1117
<p>Proxying calls to Azure Maps through APIM policies.</p>
1118
1118
</div>
1119
1119
<divclass="arch-card">
1120
-
<h4>Costing & Showback</h4>
1121
-
<p>Track API costs per business unit via subscriptions, Entra ID apps & AI Gateway tokens.</p>
1120
+
<h4>Costing</h4>
1121
+
<p>Track API costs per business unit via subscriptions, Entra ID apps, and AI Gateway tokens, including streaming token usage (not simple to capture correctly in APIM).</p>
<p>Track and allocate API costs per business unit using subscriptions, Entra ID application tracking, and AI Gateway token/PTU tracking via Log Analytics and Cost Management.</p>
450
+
<p>Track and allocate API costs per business unit using subscriptions, Entra ID application tracking, and AI Gateway token/PTU tracking including streaming (SSE) token usage, which is not simple to capture correctly in APIM.</p>
0 commit comments