Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ebd0483
Add bicep troubleshooting
simonkurtz-MSFT Nov 25, 2025
8febb62
Feature/pylint refactoring (#98)
simonkurtz-MSFT Nov 26, 2025
4119e86
Add formatting settings
simonkurtz-MSFT Nov 26, 2025
c504da4
Intermediate check-in
simonkurtz-MSFT Dec 3, 2025
0b49598
Working AppGW with PE to APIM
simonkurtz-MSFT Dec 3, 2025
5b5a91a
Clean up imports and logging
simonkurtz-MSFT Dec 3, 2025
cf024a9
Add App Gateway testing instructions, clean-up
simonkurtz-MSFT Dec 3, 2025
03ac6b9
Update AVM versions, return App Gateway pip and domain, clean up
simonkurtz-MSFT Dec 3, 2025
5401b6c
Format
simonkurtz-MSFT Dec 3, 2025
125fb14
Format
simonkurtz-MSFT Dec 3, 2025
2f538fa
Add Readme
simonkurtz-MSFT Dec 3, 2025
d904cb6
Enable HTTP/2 for App Gateway
simonkurtz-MSFT Dec 3, 2025
0c418a1
Clean up
simonkurtz-MSFT Dec 3, 2025
76be7c6
Add App Gateway PE infrastructure
simonkurtz-MSFT Dec 3, 2025
54ada12
Do not show errors on clean up tasks
simonkurtz-MSFT Dec 3, 2025
5035178
Add Key Vault roles
simonkurtz-MSFT Dec 3, 2025
6e55433
Remove superfluous Key Vault RBAC assignment, format, clean up
simonkurtz-MSFT Dec 3, 2025
8203252
Format
simonkurtz-MSFT Dec 3, 2025
45ae587
Support tests with App Gateway and self-signed certificates
simonkurtz-MSFT Dec 4, 2025
d725bb5
Add App Gateway diagram
simonkurtz-MSFT Dec 4, 2025
cd30f29
Remove temporary ApimRequests2 class, streamline tests
simonkurtz-MSFT Dec 5, 2025
df20bbf
Set up samples for App Gateway use
simonkurtz-MSFT Dec 5, 2025
6085302
Fix unit tests
simonkurtz-MSFT Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ applyTo: "**"

## Purpose

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.
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.

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

Expand All @@ -24,7 +24,7 @@ In case of any conflicting instructions, the following hierarchy shall apply. If
1. Individualized instructions (e.g. a developer's or an organization's instruction file(s)), if present
2. This repository's `.github/.copilot-instructions.md`
3. General best practices and guidelines from sources such as [Microsoft Learn](https://learn.microsoft.com/docs/)
This includes the [Microsoft Cloud Adoption Framework](https://learn.microsoft.com/azure/cloud-adoption-framework/).
This includes the [Microsoft Cloud Adoption Framework](https://learn.microsoft.com/azure/cloud-adoption-framework/).
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)

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

## Formatting and Style

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

- Overall layout of a Bicep file should be:
- Visible sections of code with the following format should be used:

```bicep
// ------------------------------
// <SECTION HEADER>
// ------------------------------
```

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

- Prefer Python 3.12+ syntax and features unless otherwise specified.
- Respect the repository's `.pylintrc` file for linting rules. The file is found in the `tests/python/` folder.
- When inserting a comment to describe a method, insert a blank line after the comment section.
- 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.
- 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.
- 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:

```python
"""
Module docstring.
"""

import ...
...


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

- Overall layout of a Python file should be:
- Visible sections of code with the following format should be used:

```python
# ------------------------------
# <SECTION HEADER>
# ------------------------------
```

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

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

Expand All @@ -186,7 +187,7 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id
attribute: str
...
```

### Jupyter Notebook Instructions

- 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.
Expand All @@ -195,10 +196,10 @@ param resourceSuffix string = uniqueString(subscription().id, resourceGroup().id

- 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
- 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.
- Less is more. Don't be too verbose in the diagrams.
- Less is more. Don't be too verbose in the diagrams.
- Never include subscription IDs, resource group names, or any other sensitive information in the diagrams. That data is not relevant.
- Don't use the "legend" command if the information is relatively obvious.

### API Management Policy XML Instructions

- Policies should use camelCase for all variable names.
- Policies should use camelCase for all variable names.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ labs-in-progress/
.coverage
tests/python/htmlcov/

# Pylint reports
tests/python/pylint/reports/
tests/python/$JsonReport
tests/python/$TextReport

shared/bicep/modules/**/*.json
main.json

Expand Down
123 changes: 22 additions & 101 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,107 +1,28 @@
{
"plantuml.diagramsRoot": "assets/diagrams/src",
"plantuml.exportFormat": "svg",
"plantuml.exportOutDir": "assets/diagrams/out",
"plantuml.java": "C:\\Program Files\\OpenJDK\\jdk-22.0.2\\bin\\java.exe",
"plantuml.render": "Local",
"python.analysis.autoIndent": true,
"python.analysis.completeFunctionParens": true,
"python.analysis.diagnosticSeverityOverrides": {
"reportDuplicateImport": "warning",
"reportUndefinedVariable": "information",
"reportUnusedVariable": "information"
"jupyter.defaultKernel": "apim-samples",
"jupyter.kernels.changeKernelIdForNotebookEnabled": false,
"jupyter.preferredKernelIdForNotebook": {
"*.ipynb": "apim-samples"
},
"python.analysis.extraPaths": [
"${workspaceFolder}/shared/python"
],
"python.defaultInterpreterPath": "/workspaces/Apim-Samples/.venv/bin/python",
"python.pythonPath": "/workspaces/Apim-Samples/.venv/bin/python",
"python.envFile": "${workspaceFolder}/.env",
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"jupyter.askForKernelRestart": false,
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"jupyter.notebookFileRoot": "${workspaceFolder}",
"jupyter.kernels.excludePythonEnvironments": [
"**/anaconda3/**",
"**/conda/**",
"**/miniconda3/**",
"**/python3.*",
"*/site-packages/*",
"/bin/python",
"/bin/python3",
"/opt/python/*/bin/python*",
"/usr/bin/python",
"/usr/bin/python3",
"/usr/local/bin/python",
"/usr/local/bin/python3",
"python",
"python3"
],
"jupyter.kernels.trusted": [
"/workspaces/Apim-Samples/.venv/bin/python"
"./.venv/Scripts/python.exe"
],
"terminal.integrated.env.windows": {
"PATH": "${env:PATH}"
},
"terminal.integrated.showExitAlert": false,
"terminal.integrated.focusAfterRun": "terminal",
"terminal.integrated.defaultProfile.linux": "bash",
"workbench.panel.defaultLocation": "bottom",
"workbench.startupEditor": "none",
"workbench.panel.defaultPanelHeight": 350,
"workbench.view.alwaysShowHeaderActions": true,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.tabs.location": "left",
"xml.validation.enabled": false,
"xml.validation.namespaces.enabled": "never",
"xml.validation.schema.enabled": "never",
"xml.validation.disallowDocTypeDecl": false,
"xml.validation.resolveExternalEntities": false,
"xml.format.enabled": false,
"xml.format.emptyElements": "ignore",
"xml.format.enforceQuoteStyle": "preferred",
"xml.format.preserveEmptyContent": true,
"xml.format.preserveSpace": [
"xsl:text",
"xsl:comment",
"xsl:processing-instruction",
"literal",
"xsl:preserve-space",
"fragment",
"condition"
"jupyter.kernels.excludePythonEnvironments": [
"apim-samples"
],
"xml.format.splitAttributes": "preserve",
"xml.format.joinCDATALines": false,
"xml.format.joinCommentLines": false,
"xml.format.joinContentLines": false,
"xml.format.spaceBeforeEmptyCloseTag": true,
"xml.format.xsiSchemaLocationSplit": "onPair",
"xml.completion.autoCloseTags": true,
"xml.codeLens.enabled": false,
"xml.preferences.includeSchemaAssociations": "never",
"xml.trace.server": "off",
"files.associations": {
"*.xml": "xml",
"**/apim-policies/*.xml": "xml",
"**/samples/**/*.xml": "xml",
"pf-*.xml": "xml",
"hr_*.xml": "xml"
},
"html.validate": false,
"azureApiManagement.policies.validateSyntax": true,
"azureApiManagement.policies.showCodeLens": true,
"[xml]": {
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.autoClosingBrackets": "always",
"editor.autoClosingQuotes": "always",
"editor.suggest.insertMode": "replace",
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
"editor.formatOnType": false
}
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.renderWhitespace": "trailing",
"python.defaultInterpreterPath": "./.venv/Scripts/python.exe",
"python.pythonPath": "./.venv/Scripts/python.exe",
"python.envFile": "${workspaceFolder}/.env",
"notebook.defaultLanguage": "python",
"notebook.kernelPickerType": "mru",
"terminal.integrated.defaultProfile.windows": "PowerShell",
"plantuml.render": "Local",
"plantuml.exportFormat": "svg",
"plantuml.java": "C:\\Program Files\\OpenJDK\\jdk-22.0.2\\bin\\java.exe",
"plantuml.diagramsRoot": "assets/diagrams/src",
"plantuml.exportOutDir": "assets/diagrams/out"
}
Loading
Loading