Skip to content

Commit 68d84b4

Browse files
Add App Gateway Private Endpoint to APIM infrastructure (#99)
1 parent caec34f commit 68d84b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3381
-1600
lines changed

.github/copilot-instructions.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ applyTo: "**"
66

77
## Purpose
88

9-
This instructions file is designed to guide GitHub Copilot's behavior specifically for this repository. It is intended to provide clear, general, and maintainable guidelines for code generation, style, and collaboration.
9+
This instructions file is designed to guide GitHub Copilot's behavior specifically for this repository. It is intended to provide clear, general, and maintainable guidelines for code generation, style, and collaboration.
1010

1111
**In case of any conflict, instructions from other individualized or project-specific files (such as `my-copilot.instructions.md`) take precedence over this file.**
1212

@@ -24,7 +24,7 @@ In case of any conflicting instructions, the following hierarchy shall apply. If
2424
1. Individualized instructions (e.g. a developer's or an organization's instruction file(s)), if present
2525
2. This repository's `.github/.copilot-instructions.md`
2626
3. General best practices and guidelines from sources such as [Microsoft Learn](https://learn.microsoft.com/docs/)
27-
This includes the [Microsoft Cloud Adoption Framework](https://learn.microsoft.com/azure/cloud-adoption-framework/).
27+
This includes the [Microsoft Cloud Adoption Framework](https://learn.microsoft.com/azure/cloud-adoption-framework/).
2828
4. Official [GitHub Copilot best practices documentation](https://docs.github.com/enterprise-cloud@latest/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks)
2929

3030
## Copilot Personality Behavior
@@ -58,11 +58,11 @@ In case of any conflicting instructions, the following hierarchy shall apply. If
5858
- `/`: Root directory containing the main files and folders. Bicep configuration is stored in `bicepconfig.json`.
5959
- The following folders are all at the root level:
6060
- `assets/`: PlantUML diagrams and images. Static assets such as these should be placed here. Any diagrams should be placed in the /diagrams/src subfolder.
61-
- `infrastructure/`: Contains Jupyter notebooks for setting up various API Management infrastructures. When modifying samples, these notebooks should not need to be modified.
61+
- `infrastructure/`: Contains Jupyter notebooks for setting up various API Management infrastructures. When modifying samples, these notebooks should not need to be modified.
6262
- `samples/`: Various policy and scenario samples that can be applied to the infrastructures.
6363
- `setup/`: General setup scripts and configurations for the repository and dev environment setup.
6464
- `shared/`: Shared resources, such as Bicep modules, Python libraries, and other reusable components.
65-
- `tests/`: Contains unit tests for Python code and Bicep modules. This folder should contain all tests for all code in the repository.
65+
- `tests/`: Contains unit tests for Python code and Bicep modules. This folder should contain all tests for all code in the repository.
6666

6767
## Formatting and Style
6868

@@ -109,14 +109,14 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
109109

110110
- Overall layout of a Bicep file should be:
111111
- Visible sections of code with the following format should be used:
112-
112+
113113
```bicep
114114
// ------------------------------
115115
// <SECTION HEADER>
116116
// ------------------------------
117117
```
118118

119-
- <SECTION HEADER> should be indented three spaces and be in all caps.
119+
- <SECTION HEADER> should be indented three spaces and be in all caps.
120120
- Section headers should have only two blank lines before and only one blank line after.
121121
- Top-to-bottom, the following comma-separated section headers should be inserted unless the section is empty:
122122
- Parameters
@@ -128,19 +128,20 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
128128
### Python Instructions
129129

130130
- Prefer Python 3.12+ syntax and features unless otherwise specified.
131+
- Respect the repository's `.pylintrc` file for linting rules. The file is found in the `tests/python/` folder.
131132
- When inserting a comment to describe a method, insert a blank line after the comment section.
132133
- Never leave a blank line at the very top of a Python file. The file must start immediately with the module docstring or code. Always remove any leading blank line at the top.
133134
- Do not have imports such as `from shared.python import Foo`. The /shared/python directory is covered by a root `.env` file. Just use `import Foo` or `from Foo import Bar` as appropriate.
134135
- After the module docstring, all import statements must come before any section headers (e.g., CONSTANTS, VARIABLES, etc.). Section headers should only appear after the imports. Here is a more explicit example:
135-
136+
136137
```python
137138
"""
138139
Module docstring.
139140
"""
140141

141142
import ...
142143
...
143-
144+
144145

145146
# ------------------------------
146147
# CONSTANTS
@@ -150,14 +151,14 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
150151

151152
- Overall layout of a Python file should be:
152153
- Visible sections of code with the following format should be used:
153-
154+
154155
```python
155156
# ------------------------------
156157
# <SECTION HEADER>
157158
# ------------------------------
158159
```
159160

160-
- <SECTION HEADER> should be indented three spaces and be in all caps.
161+
- <SECTION HEADER> should be indented three spaces and be in all caps.
161162
- Section headers should have only two blank lines before and only one blank line after.
162163
- Top-to-bottom, the following comma-separated section headers should be inserted unless the section is empty:
163164
- Constants
@@ -173,7 +174,7 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
173174
- Private Methods
174175
- Public Methods
175176

176-
- Python Docstring/Class Formatting Rule:
177+
- Python Docstring/Class Formatting Rule:
177178
- Always insert a single blank line after a class docstring and before any class attributes or methods.
178179
- Never place class attributes or decorators on the same line as the docstring. Example:
179180

@@ -186,7 +187,7 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
186187
attribute: str
187188
...
188189
```
189-
190+
190191
### Jupyter Notebook Instructions
191192

192193
- Use these [configuration settings](https://github.com/microsoft/vscode-jupyter/blob/dd568fde/package.nls.json) as a reference for the VS Code Jupyter extension configuration.
@@ -195,10 +196,10 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
195196

196197
- Ensure you verify that all include links are correct and up to date. This link provides a starting point: https://github.com/plantuml-stdlib/Azure-PlantUML/blob/master/AzureSymbols.md
197198
- Keep diagrams simple. For Azure, include major components, not individual aspects of components. For example, there is no need for individual policies in WAFs or APIs in API Management, Smart Detector Alert Rules, etc.
198-
- Less is more. Don't be too verbose in the diagrams.
199+
- Less is more. Don't be too verbose in the diagrams.
199200
- Never include subscription IDs, resource group names, or any other sensitive information in the diagrams. That data is not relevant.
200201
- Don't use the "legend" command if the information is relatively obvious.
201202

202203
### API Management Policy XML Instructions
203204

204-
- Policies should use camelCase for all variable names.
205+
- Policies should use camelCase for all variable names.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ labs-in-progress/
2828
.coverage
2929
tests/python/htmlcov/
3030

31+
# Pylint reports
32+
tests/python/pylint/reports/
33+
tests/python/$JsonReport
34+
tests/python/$TextReport
35+
3136
shared/bicep/modules/**/*.json
3237
main.json
3338

.vscode/settings.json

Lines changed: 22 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,28 @@
11
{
2-
"plantuml.diagramsRoot": "assets/diagrams/src",
3-
"plantuml.exportFormat": "svg",
4-
"plantuml.exportOutDir": "assets/diagrams/out",
5-
"plantuml.java": "C:\\Program Files\\OpenJDK\\jdk-22.0.2\\bin\\java.exe",
6-
"plantuml.render": "Local",
7-
"python.analysis.autoIndent": true,
8-
"python.analysis.completeFunctionParens": true,
9-
"python.analysis.diagnosticSeverityOverrides": {
10-
"reportDuplicateImport": "warning",
11-
"reportUndefinedVariable": "information",
12-
"reportUnusedVariable": "information"
2+
"jupyter.defaultKernel": "apim-samples",
3+
"jupyter.kernels.changeKernelIdForNotebookEnabled": false,
4+
"jupyter.preferredKernelIdForNotebook": {
5+
"*.ipynb": "apim-samples"
136
},
14-
"python.analysis.extraPaths": [
15-
"${workspaceFolder}/shared/python"
16-
],
17-
"python.defaultInterpreterPath": "/workspaces/Apim-Samples/.venv/bin/python",
18-
"python.pythonPath": "/workspaces/Apim-Samples/.venv/bin/python",
19-
"python.envFile": "${workspaceFolder}/.env",
20-
"python.terminal.activateEnvironment": true,
21-
"python.terminal.activateEnvInCurrentTerminal": true,
22-
"jupyter.askForKernelRestart": false,
23-
"jupyter.interactiveWindow.textEditor.executeSelection": true,
24-
"jupyter.notebookFileRoot": "${workspaceFolder}",
25-
"jupyter.kernels.excludePythonEnvironments": [
26-
"**/anaconda3/**",
27-
"**/conda/**",
28-
"**/miniconda3/**",
29-
"**/python3.*",
30-
"*/site-packages/*",
31-
"/bin/python",
32-
"/bin/python3",
33-
"/opt/python/*/bin/python*",
34-
"/usr/bin/python",
35-
"/usr/bin/python3",
36-
"/usr/local/bin/python",
37-
"/usr/local/bin/python3",
38-
"python",
39-
"python3"
40-
],
417
"jupyter.kernels.trusted": [
42-
"/workspaces/Apim-Samples/.venv/bin/python"
8+
"./.venv/Scripts/python.exe"
439
],
44-
"terminal.integrated.env.windows": {
45-
"PATH": "${env:PATH}"
46-
},
47-
"terminal.integrated.showExitAlert": false,
48-
"terminal.integrated.focusAfterRun": "terminal",
49-
"terminal.integrated.defaultProfile.linux": "bash",
50-
"workbench.panel.defaultLocation": "bottom",
51-
"workbench.startupEditor": "none",
52-
"workbench.panel.defaultPanelHeight": 350,
53-
"workbench.view.alwaysShowHeaderActions": true,
54-
"terminal.integrated.tabs.enabled": true,
55-
"terminal.integrated.tabs.location": "left",
56-
"xml.validation.enabled": false,
57-
"xml.validation.namespaces.enabled": "never",
58-
"xml.validation.schema.enabled": "never",
59-
"xml.validation.disallowDocTypeDecl": false,
60-
"xml.validation.resolveExternalEntities": false,
61-
"xml.format.enabled": false,
62-
"xml.format.emptyElements": "ignore",
63-
"xml.format.enforceQuoteStyle": "preferred",
64-
"xml.format.preserveEmptyContent": true,
65-
"xml.format.preserveSpace": [
66-
"xsl:text",
67-
"xsl:comment",
68-
"xsl:processing-instruction",
69-
"literal",
70-
"xsl:preserve-space",
71-
"fragment",
72-
"condition"
10+
"jupyter.kernels.excludePythonEnvironments": [
11+
"apim-samples"
7312
],
74-
"xml.format.splitAttributes": "preserve",
75-
"xml.format.joinCDATALines": false,
76-
"xml.format.joinCommentLines": false,
77-
"xml.format.joinContentLines": false,
78-
"xml.format.spaceBeforeEmptyCloseTag": true,
79-
"xml.format.xsiSchemaLocationSplit": "onPair",
80-
"xml.completion.autoCloseTags": true,
81-
"xml.codeLens.enabled": false,
82-
"xml.preferences.includeSchemaAssociations": "never",
83-
"xml.trace.server": "off",
84-
"files.associations": {
85-
"*.xml": "xml",
86-
"**/apim-policies/*.xml": "xml",
87-
"**/samples/**/*.xml": "xml",
88-
"pf-*.xml": "xml",
89-
"hr_*.xml": "xml"
90-
},
91-
"html.validate": false,
92-
"azureApiManagement.policies.validateSyntax": true,
93-
"azureApiManagement.policies.showCodeLens": true,
94-
"[xml]": {
95-
"editor.quickSuggestions": {
96-
"other": true,
97-
"comments": false,
98-
"strings": true
99-
},
100-
"editor.autoClosingBrackets": "always",
101-
"editor.autoClosingQuotes": "always",
102-
"editor.suggest.insertMode": "replace",
103-
"editor.formatOnSave": false,
104-
"editor.formatOnPaste": false,
105-
"editor.formatOnType": false
106-
}
13+
"files.trimTrailingWhitespace": true,
14+
"files.insertFinalNewline": true,
15+
"files.trimFinalNewlines": true,
16+
"editor.renderWhitespace": "trailing",
17+
"python.defaultInterpreterPath": "./.venv/Scripts/python.exe",
18+
"python.pythonPath": "./.venv/Scripts/python.exe",
19+
"python.envFile": "${workspaceFolder}/.env",
20+
"notebook.defaultLanguage": "python",
21+
"notebook.kernelPickerType": "mru",
22+
"terminal.integrated.defaultProfile.windows": "PowerShell",
23+
"plantuml.render": "Local",
24+
"plantuml.exportFormat": "svg",
25+
"plantuml.java": "C:\\Program Files\\OpenJDK\\jdk-22.0.2\\bin\\java.exe",
26+
"plantuml.diagramsRoot": "assets/diagrams/src",
27+
"plantuml.exportOutDir": "assets/diagrams/out"
10728
}

0 commit comments

Comments
 (0)