Skip to content

Commit 4ac0b47

Browse files
Merge branch 'main' into fix/pythonpath
2 parents 268cd02 + 936048a commit 4ac0b47

File tree

19 files changed

+113
-79
lines changed

19 files changed

+113
-79
lines changed

.github/ISSUE_TEMPLATE/1-bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: "Bug report"
44
description: "Create a bug report to help us improve."
55
title: "[Bug]: <title>"
6-
labels: ["triage"]
6+
labels: ["bug"]
77
type: "Bug"
88
assignees:
99
- simonkurtz-MSFT

.github/ISSUE_TEMPLATE/2-sample_scenario.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: "Sample Scenario"
44
description: "Suggest a new API Management Sample Scenario."
55
title: "[Scenario]: <title>"
6-
labels: ["triage", "scenario"]
6+
labels: ["scenario"]
77
type: "Feature"
88
assignees:
99
- simonkurtz-MSFT

.github/ISSUE_TEMPLATE/3-feature_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
name: "Feature Request"
44
description: "Suggest a new feature or improvement."
55
title: "[Feature]: <title>"
6-
labels: ["triage"]
76
type: "Feature"
87
assignees:
98
- simonkurtz-MSFT

.github/ISSUE_TEMPLATE/9-task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
name: "Task"
44
description: "Create a general task that does not fit other categories."
55
title: "[Task]: <title>"
6-
labels: ["triage"]
76
type: "Task"
87
assignees:
98
- simonkurtz-MSFT
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
name: Label Non-Admin Issues
3+
4+
on:
5+
issues:
6+
types: [opened]
7+
8+
jobs:
9+
label-if-not-admin:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Step 1: Check if the issue creator has admin access to the repository
13+
- name: Check if issue creator has admin access to the repo
14+
id: check_permission
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const username = context.payload.issue.user.login;
19+
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
username
23+
});
24+
25+
console.log(`User ${username} has permission: ${permission.permission}`);
26+
core.setOutput("is_admin", permission.permission === "admin");
27+
28+
# Step 2: Add 'triage' label if the issue creator is not an admin
29+
- name: Add triage label if not admin
30+
if: steps.check_permission.outputs.is_admin != 'true'
31+
uses: actions/github-script@v7
32+
with:
33+
script: |
34+
await github.rest.issues.addLabels({
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
issue_number: context.issue.number,
38+
labels: ['triage']
39+
});

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository provides a playground to safely experiment with and learn Azure
66

77
_If you are interested in APIM & Azure OpenAI integrations, please check out the excellent [AI Gateway](https://github.com/Azure-Samples/AI-Gateway) GitHub repository._
88

9-
## Objectives
9+
## 🎯 Objectives
1010

1111
1. Educate you on common APIM architectures we see across industries and customers.
1212
1. Empower you to safely experiment with APIM policies.
@@ -16,9 +16,9 @@ _Try it out, learn from it, apply it in your setups._
1616

1717
---
1818

19-
## Getting Started
19+
## 🚀 Getting Started
2020

21-
### Prerequisites
21+
### 📋 Prerequisites
2222

2323
These prerequisites apply broadly across all infrastructure and samples. If there are specific deviations, expect them to be noted there.
2424

@@ -29,7 +29,7 @@ These prerequisites apply broadly across all infrastructure and samples. If ther
2929
- [An Azure Subscription](https://azure.microsoft.com/free/) with Owner or Contributor+UserAccessAdministrator permissions. Execute [shared/jupyter/verify-az-account.ipynb](shared/jupyter/verify-az-account.ipynb) to verify.
3030
- [Sign in to Azure with Azure CLI](https://learn.microsoft.com/cli/azure/authenticate-azure-cli-interactively)
3131

32-
### Initialization
32+
### 🛠️ Initialization
3333

3434
Run through the following steps to create a Python virtual environment before doing anything else:
3535

@@ -44,15 +44,15 @@ Run through the following steps to create a Python virtual environment before do
4444

4545
The first time you run a Jupyter notebook, you'll be asked to install the Jupyter kernel package (ipykernel).
4646

47-
### List of Samples
47+
### 📁 List of Samples
4848

4949
| Sample Name | Description | Supported Infrastructure(s) |
5050
|:-----------------|:----------------------------------------------------------------------------|:-------------------------------------------|
5151
| [General](./samples/general/create.ipynb) | Basic demo of APIM sample setup and policy usage. | All infrastructures |
5252
| [Load Balancing](./samples/load-balancing/create.ipynb) | Priority and weighted load balancing across backends. | apim-aca, afd-apim (with ACA) |
5353
| [AuthX](./samples/authx/create.ipynb) | Authentication and role-based authorization in a mock HR API. | All infrastructures |
5454

55-
### Running a Sample
55+
### ▶️ Running a Sample
5656

5757
1. Locate the specific sample's `create.ipynb` file and adjust the parameters under the `User-defined Parameters` header as you see fit.
5858
1. Ensure that the specified infrastructure already exists in your subscription. If not, proceed to the desired infrastructure folder and execute its `create.ipynb` file. Wait until this completes before continuing.
@@ -62,9 +62,9 @@ Now that infrastructure and sample have been stood up, you can experiment with t
6262

6363
---
6464

65-
## Repo Structure
65+
## 📂 Repo Structure
6666

67-
### High-level
67+
### 🦅 High-level
6868

6969
- All _samples_ can be found in the `samples` folder. Samples showcase functionality and provide a baseline for your experimentation.
7070
- All _infrastructures_ can be found in the `infrastructure` folder. They provide the architectural underpinnings.
@@ -74,14 +74,14 @@ Now that infrastructure and sample have been stood up, you can experiment with t
7474
- Reusable _APIM policies_ are found in the `apim-policies` folder.
7575
- Reusable Jupyter notebooks are found in the `jupyter` folder.
7676

77-
### Sample Setup
77+
### ⚙️ Sample Setup
7878

7979
- Each sample uses an architecture infrastructure. This keeps the samples free of almost all setup.
8080
- Each infrastructure and sample features a `create.ipynb` for creation (and running) of the sample setup and a `main.bicep` file for IaC configuration.
8181
- Each infrastructure contains a `clean-up.ipynb` file to tear down everything in the infrastructure and its resource group. This reduces your Azure cost.
8282
- Samples (and infrastructures) may contain additional files specific to their use cases.
8383

84-
### Infrastructure Architectures
84+
### 🏛️ Infrastructure Architectures
8585

8686
We provide several common architectural approaches to integrating APIM into your Azure ecosystem. While these are high-fidelity setups, they are not production-ready. Please refer to the [Azure API Management landing zone accelerator](https://learn.microsoft.com/azure/cloud-adoption-framework/scenarios/app-platform/api-management/landing-zone-accelerator) for up-to-date production setups.
8787

@@ -96,15 +96,15 @@ We provide several common architectural approaches to integrating APIM into your
9696

9797
---
9898

99-
## Development
99+
## 🛠️ Development
100100

101101
As you work with this repo, you will likely want to make your own customizations. There's little you need to know to be successful.
102102

103103
The repo uses the bicep linter and has rules defined in `bicepconfig.json`. See the [bicep linter documentation](https://learn.microsoft.com/azure/azure-resource-manager/bicep/bicep-config-linter) for details.
104104

105105
**We welcome contributions!** Please consider forking the repo and creating issues and pull requests to share your samples. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. Thank you!
106106

107-
### Adding a Sample
107+
### Adding a Sample
108108

109109
Adding a new sample is relatively straight-forward.
110110

@@ -116,11 +116,11 @@ Adding a new sample is relatively straight-forward.
116116
1. Test the sample with all supported infrastructures.
117117
1. Create a pull request for merge.
118118

119-
### Testing & Code Coverage
119+
### 🧪 Testing & Code Coverage
120120

121121
Python modules in `shared/python` are covered by comprehensive unit tests located in `tests/python`. All tests use [pytest](https://docs.pytest.org/) and leverage modern pytest features, including custom markers for unit and HTTP tests.
122122

123-
#### Running Tests Locally
123+
#### 🚀 Running Tests Locally
124124

125125
- **PowerShell (Windows):**
126126
- Run all tests with coverage: `./tests/python/run_tests.ps1`
@@ -137,26 +137,26 @@ You can also run tests manually and see details in the console:
137137
pytest -v --cov=shared/python --cov-report=html:tests/python/htmlcov --cov-report=term tests/python
138138
```
139139

140-
#### Viewing Coverage Reports
140+
#### 📊 Viewing Coverage Reports
141141

142142
After running tests, open `tests/python/htmlcov/index.html` in your browser to view detailed coverage information.
143143

144-
#### Pytest Markers
144+
#### 🏷️ Pytest Markers
145145

146146
- `@pytest.mark.unit` — marks a unit test
147147
- `@pytest.mark.http` — marks a test involving HTTP/mocking
148148

149149
Markers are registered in `pytest.ini` to avoid warnings.
150150

151-
#### Continuous Integration (CI)
151+
#### Continuous Integration (CI)
152152

153153
On every push or pull request, GitHub Actions will:
154154
- Install dependencies
155155
- Run all Python tests in `tests/python` with coverage
156156
- Store the `.coverage` file in `tests/python`
157157
- Upload the HTML coverage report as a workflow artifact for download
158158

159-
#### Additional Notes
159+
#### 📝 Additional Notes
160160

161161
- The `.gitignore` is configured to exclude coverage output and artifacts.
162162
- All test and coverage features work both locally and in CI.
@@ -165,13 +165,13 @@ For more details on pytest usage, see the [pytest documentation](https://docs.py
165165

166166
---
167167

168-
## Supporting Resources
168+
## 📚 Supporting Resources
169169

170170
The APIM team maintains an [APIM policy snippets repo](https://github.com/Azure/api-management-policy-snippets) with use cases we have seen. They are not immediately executable samples and require integrations such as in this repo.
171171

172172
---
173173

174-
## Acknowledgements
174+
## 🙏 Acknowledgements
175175

176176
This project has its roots in work done by [Alex Vieira](https://github.com/vieiraae) on the excellent Azure API Management [AI Gateway](https://github.com/Azure-Samples/AI-Gateway) GitHub repository. Much of the structure is similar and its reuse resulted in significant time savings. Thank you, Alex!
177177

assets/APIM-Samples-199x163.png

30.4 KB
Loading

assets/APIM-Samples.pdn

430 KB
Binary file not shown.

assets/APIM-Samples.png

289 KB
Loading

infrastructure/afd-apim/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Secure architecture that takes all traffic off the public Internet once Azure Fr
44

55
<img src="./Azure Front Door, API Management & Container Apps Architecture.svg" alt="Diagram showing Azure Front Door, API Management, and Container Apps architecture. Azure Front Door routes traffic to API Management, which then routes to Container Apps. Telemetry is sent to Azure Monitor." title="Azure Front Door, API Management & Container Apps Architecture" width="1000" />
66

7-
## Objectives
7+
## 🎯 Objectives
88

99
1. Provide a secure pathway to API Management via a private link from Front Door
1010
1. Maintain private networking by integrating API Management with a VNet to communicate with Azure Container Apps. (This can also be achieved via a private link there)
1111
1. Empower users to use Azure Container Apps, if desired
1212
1. Enable observability by sending telemetry to Azure Monitor
1313

14-
## Configuration
14+
## ⚙️ Configuration
1515

1616
Adjust the `user-defined parameters` in this lab's Jupyter Notebook's [Initialize notebook variables](./create.ipynb#initialize-notebook-variables) section.
1717

18-
## Execution
18+
## ▶️ Execution
1919

2020
1. Execute this lab's [Jupyter Notebook](./create.ipynb) step-by-step or via _Run All_.

0 commit comments

Comments
 (0)