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: README.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This repository provides a playground to safely experiment with and learn Azure
6
6
7
7
_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._
8
8
9
-
## Objectives
9
+
## 🎯 Objectives
10
10
11
11
1. Educate you on common APIM architectures we see across industries and customers.
12
12
1. Empower you to safely experiment with APIM policies.
@@ -16,9 +16,9 @@ _Try it out, learn from it, apply it in your setups._
16
16
17
17
---
18
18
19
-
## Getting Started
19
+
## 🚀 Getting Started
20
20
21
-
### Prerequisites
21
+
### 📋 Prerequisites
22
22
23
23
These prerequisites apply broadly across all infrastructure and samples. If there are specific deviations, expect them to be noted there.
24
24
@@ -29,7 +29,7 @@ These prerequisites apply broadly across all infrastructure and samples. If ther
29
29
-[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.
30
30
-[Sign in to Azure with Azure CLI](https://learn.microsoft.com/cli/azure/authenticate-azure-cli-interactively)
31
31
32
-
### Initialization
32
+
### 🛠️ Initialization
33
33
34
34
Run through the following steps to create a Python virtual environment before doing anything else:
35
35
@@ -43,15 +43,15 @@ Run through the following steps to create a Python virtual environment before do
43
43
44
44
The first time you run a Jupyter notebook, you'll be asked to install the Jupyter kernel package (ipykernel).
45
45
46
-
### List of Samples
46
+
### 📁 List of Samples
47
47
48
48
| Sample Name | Description | Supported Infrastructure(s) |
|[General](./samples/general/create.ipynb)| Basic demo of APIM sample setup and policy usage. | All infrastructures |
51
51
|[Load Balancing](./samples/load-balancing/create.ipynb)| Priority and weighted load balancing across backends. | apim-aca, afd-apim (with ACA) |
52
52
|[AuthX](./samples/authx/create.ipynb)| Authentication and role-based authorization in a mock HR API. | All infrastructures |
53
53
54
-
### Running a Sample
54
+
### ▶️ Running a Sample
55
55
56
56
1. Locate the specific sample's `create.ipynb` file and adjust the parameters under the `User-defined Parameters` header as you see fit.
57
57
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.
@@ -61,9 +61,9 @@ Now that infrastructure and sample have been stood up, you can experiment with t
61
61
62
62
---
63
63
64
-
## Repo Structure
64
+
## 📂 Repo Structure
65
65
66
-
### High-level
66
+
### 🦅 High-level
67
67
68
68
- All _samples_ can be found in the `samples` folder. Samples showcase functionality and provide a baseline for your experimentation.
69
69
- All _infrastructures_ can be found in the `infrastructure` folder. They provide the architectural underpinnings.
@@ -73,14 +73,14 @@ Now that infrastructure and sample have been stood up, you can experiment with t
73
73
- Reusable _APIM policies_ are found in the `apim-policies` folder.
74
74
- Reusable Jupyter notebooks are found in the `jupyter` folder.
75
75
76
-
### Sample Setup
76
+
### ⚙️ Sample Setup
77
77
78
78
- Each sample uses an architecture infrastructure. This keeps the samples free of almost all setup.
79
79
- Each infrastructure and sample features a `create.ipynb` for creation (and running) of the sample setup and a `main.bicep` file for IaC configuration.
80
80
- Each infrastructure contains a `clean-up.ipynb` file to tear down everything in the infrastructure and its resource group. This reduces your Azure cost.
81
81
- Samples (and infrastructures) may contain additional files specific to their use cases.
82
82
83
-
### Infrastructure Architectures
83
+
### 🏛️ Infrastructure Architectures
84
84
85
85
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.
86
86
@@ -95,15 +95,15 @@ We provide several common architectural approaches to integrating APIM into your
95
95
96
96
---
97
97
98
-
## Development
98
+
## 🛠️ Development
99
99
100
100
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.
101
101
102
102
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.
103
103
104
104
**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!
105
105
106
-
### Adding a Sample
106
+
### ➕ Adding a Sample
107
107
108
108
Adding a new sample is relatively straight-forward.
109
109
@@ -115,11 +115,11 @@ Adding a new sample is relatively straight-forward.
115
115
1. Test the sample with all supported infrastructures.
116
116
1. Create a pull request for merge.
117
117
118
-
### Testing & Code Coverage
118
+
### 🧪 Testing & Code Coverage
119
119
120
120
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.
121
121
122
-
#### Running Tests Locally
122
+
#### 🚀 Running Tests Locally
123
123
124
124
-**PowerShell (Windows):**
125
125
- Run all tests with coverage: `./tests/python/run_tests.ps1`
@@ -136,26 +136,26 @@ You can also run tests manually and see details in the console:
After running tests, open `tests/python/htmlcov/index.html` in your browser to view detailed coverage information.
142
142
143
-
#### Pytest Markers
143
+
#### 🏷️ Pytest Markers
144
144
145
145
-`@pytest.mark.unit` — marks a unit test
146
146
-`@pytest.mark.http` — marks a test involving HTTP/mocking
147
147
148
148
Markers are registered in `pytest.ini` to avoid warnings.
149
149
150
-
#### Continuous Integration (CI)
150
+
#### ⚡ Continuous Integration (CI)
151
151
152
152
On every push or pull request, GitHub Actions will:
153
153
- Install dependencies
154
154
- Run all Python tests in `tests/python` with coverage
155
155
- Store the `.coverage` file in `tests/python`
156
156
- Upload the HTML coverage report as a workflow artifact for download
157
157
158
-
#### Additional Notes
158
+
#### 📝 Additional Notes
159
159
160
160
- The `.gitignore` is configured to exclude coverage output and artifacts.
161
161
- All test and coverage features work both locally and in CI.
@@ -164,13 +164,13 @@ For more details on pytest usage, see the [pytest documentation](https://docs.py
164
164
165
165
---
166
166
167
-
## Supporting Resources
167
+
## 📚 Supporting Resources
168
168
169
169
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.
170
170
171
171
---
172
172
173
-
## Acknowledgements
173
+
## 🙏 Acknowledgements
174
174
175
175
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!
0 commit comments