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!
Copy file name to clipboardExpand all lines: infrastructure/afd-apim/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ Secure architecture that takes all traffic off the public Internet once Azure Fr
4
4
5
5
<imgsrc="./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" />
6
6
7
-
## Objectives
7
+
## 🎯 Objectives
8
8
9
9
1. Provide a secure pathway to API Management via a private link from Front Door
10
10
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)
11
11
1. Empower users to use Azure Container Apps, if desired
12
12
1. Enable observability by sending telemetry to Azure Monitor
13
13
14
-
## Configuration
14
+
## ⚙️ Configuration
15
15
16
16
Adjust the `user-defined parameters` in this lab's Jupyter Notebook's [Initialize notebook variables](./create.ipynb#initialize-notebook-variables) section.
17
17
18
-
## Execution
18
+
## ▶️ Execution
19
19
20
20
1. Execute this lab's [Jupyter Notebook](./create.ipynb) step-by-step or via _Run All_.
Copy file name to clipboardExpand all lines: infrastructure/afd-apim/create.ipynb
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
"cell_type": "markdown",
16
16
"metadata": {},
17
17
"source": [
18
-
"### Initialize notebook variables\n",
18
+
"### 🛠️ 1. Initialize notebook variables\n",
19
19
"\n",
20
20
"Configures everything that's needed for deployment. \n",
21
21
"\n",
@@ -83,7 +83,7 @@
83
83
"cell_type": "markdown",
84
84
"metadata": {},
85
85
"source": [
86
-
"### Create deployment using Bicep\n",
86
+
"### 🚀 2. Create deployment using Bicep\n",
87
87
"\n",
88
88
"Creates the bicep deployment into the previously-specified resource group. A bicep parameters file will be created prior to execution."
89
89
]
@@ -124,7 +124,7 @@
124
124
"cell_type": "markdown",
125
125
"metadata": {},
126
126
"source": [
127
-
"### Approve Front Door private link connection to APIM\n",
127
+
"### 🔗 3. Approve Front Door private link connection to APIM\n",
128
128
"\n",
129
129
"In the deployed Bicep template, Azure Front Door will establish a private link connection to the API Management service. This connection should be approved. Run the following command to approve the connection."
130
130
]
@@ -170,7 +170,7 @@
170
170
"cell_type": "markdown",
171
171
"metadata": {},
172
172
"source": [
173
-
"### Verify API Request Success via API Management\n",
173
+
"### ✅ 4. Verify API Request Success via API Management\n",
174
174
"\n",
175
175
"As we have not yet disabled public access to APIM, this request should succeed with a **200**."
176
176
]
@@ -196,7 +196,7 @@
196
196
"cell_type": "markdown",
197
197
"metadata": {},
198
198
"source": [
199
-
"### Disabling API Management public network access\n",
199
+
"### 🔒 5. Disabling API Management public network access\n",
200
200
"\n",
201
201
"The initial `APIM` service deployment above cannot disable public network access. It must be disabled subsequently below."
202
202
]
@@ -231,7 +231,7 @@
231
231
"cell_type": "markdown",
232
232
"metadata": {},
233
233
"source": [
234
-
"### Verify API Request Success via Azure Front Door & Failure with API Management\n",
234
+
"### ✅ 6. Verify API Request Success via Azure Front Door & Failure with API Management\n",
235
235
"\n",
236
236
"At this time only requests through Front Door should be successful and return a **200**. Requests to APIM that worked previously should result in a **403**."
237
237
]
@@ -269,8 +269,7 @@
269
269
"cell_type": "markdown",
270
270
"metadata": {},
271
271
"source": [
272
-
"<a id='clean'></a>\n",
273
-
"### Clean up resources\n",
272
+
"### 🗑️ Clean up resources\n",
274
273
"\n",
275
274
"When you're finished experimenting, it's advisable to remove all associated resources from Azure to avoid unnecessary cost.\n",
276
275
"Use the [clean-up notebook](clean-up.ipynb) for that."
Copy file name to clipboardExpand all lines: infrastructure/apim-aca/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,16 @@ This architecture secures API traffic by routing requests through Azure API Mana
4
4
5
5
<imgsrc="./API Management & Container Apps Architecture.svg"alt="Diagram showing Azure API Management and Container Apps architecture. API Management routes traffic to Container Apps. Telemetry is sent to Azure Monitor."title="API Management & Container Apps Architecture"width="800" />
6
6
7
-
## Objectives
7
+
## 🎯 Objectives
8
8
9
9
1. Provide a secure API gateway using Azure API Management
10
10
1. Integrate API Management with Azure Container Apps for backend services
11
11
1. Enable observability by sending telemetry to Azure Monitor
12
12
13
-
## Configuration
13
+
## ⚙️ Configuration
14
14
15
15
Adjust the `user-defined parameters` in this lab's Jupyter Notebook's [Initialize notebook variables](./create.ipynb#initialize-notebook-variables) section.
16
16
17
-
## Execution
17
+
## ▶️ Execution
18
18
19
19
1. Execute this lab's [Jupyter Notebook](./create.ipynb) step-by-step or via _Run All_.
Copy file name to clipboardExpand all lines: infrastructure/simple-apim/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ This architecture provides a basic API gateway using Azure API Management, suita
4
4
5
5
<imgsrc="./Simple API Management Architecture.svg"alt="Diagram showing a simple Azure API Management architecture. API Management acts as a gateway for API consumers. Telemetry is sent to Azure Monitor."title="Simple API Management Architecture"width="800" />
6
6
7
-
## Objectives
7
+
## 🎯 Objectives
8
8
9
9
1. Provide the simplest Azure API Management infrastructure with a public ingress to allow for easy testing
10
10
1. Enable observability by sending telemetry to Azure Monitor
11
11
12
-
## Configuration
12
+
## ⚙️ Configuration
13
13
14
14
Adjust the `user-defined parameters` in this lab's Jupyter Notebook's [Initialize notebook variables](./create.ipynb#initialize-notebook-variables) section.
15
15
16
-
## Execution
16
+
## ▶️ Execution
17
17
18
18
1. Execute this lab's [Jupyter Notebook](./create.ipynb) step-by-step or via _Run All_.
0 commit comments