agentleFS
MicrosoftKnown publishermicrosoft/AzureTRE/.github/copilot-instructions.md

AzureTRE

Copilot instructions235 starsChanged 10 months agoMITView on GitHub

This file provides context and guidance for GitHub Copilot when working with the Azure Trusted Research Environment (Azure TRE) project. Azure TRE is an accelerator to assist Microsoft customers and partners who want to build out Trusted Research Environments on Azure. It enables authorized users to deploy and configure secure workspaces and researcher tooling without a dependency on IT teams. Trusted Research Environments (TREs) enable organizations to provide research and development (R&D) teams secure access to data alongside tooling to…

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

22 rules. About 0 are common, 20 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Follow the formatting rules defined in .editorconfig

    line 68
  2. Distinctive:

    Use consistent indentation, line endings, and character encoding as specified

    line 69
  3. Distinctive:

    Ensure final newlines and trim trailing whitespace per .editorconfig settings

    line 70
  4. Distinctive:

    Follow PEP 8 style guidelines

    line 73
  5. Distinctive:

    Use FastAPI for API endpoints

    line 74
  6. Distinctive:

    Use pytest for testing

    line 75
  7. Distinctive:

    Follow module structure conventions

    line 79
  8. Distinctive:

    Use variables.tf and outputs.tf for module interfaces

    line 80
  9. Distinctive:

    Follow standard ESLint configuration

    line 84
  10. Distinctive:

    Use Vitest for testing React components

    line 85
  11. Distinctive:

    Use React Testing Library for component testing

    line 86
  12. Distinctive:

    Use semantic queries (getByRole, getByLabelText) over test IDs when possible

    line 90
  13. Distinctive:

    Use npm for package management

    line 91
  14. Distinctive:

    Use consistent indentation (2 spaces)

    line 94
  15. Distinctive:

    Follow Porter best practices for bundle manifests

    line 95
  16. Distinctive:

    Update CHANGELOG.md for all significant changes

    line 98
  17. Distinctive:

    Azure: All resources are deployed in Azure

    line 103
  18. Distinctive:

    When creating a pull request, you must update the CHANGELOG.md file with your changes.

    line 181
  19. Very specific:

    Always include issue and/or PR references using the format (#1234).

    line 191
  20. Distinctive:

    Don't change anything under the COMPONENTS section.

    line 193
  21. Distinctive:

    When editing components or bundles, you must increase their version numbers according to semantic versioning principles:

    line 197
  22. Distinctive:

    Always use semantic versioning (MAJOR.MINOR.PATCH) and follow versioning guidelines in the documentation.

    line 216

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

GitHub Copilot Instructions for Azure TRE

This file provides context and guidance for GitHub Copilot when working with the Azure Trusted Research Environment (Azure TRE) project.

Project Overview

Azure TRE is an accelerator to assist Microsoft customers and partners who want to build out Trusted Research Environments on Azure. It enables authorized users to deploy and configure secure workspaces and researcher tooling without a dependency on IT teams.

Trusted Research Environments (TREs) enable organizations to provide research and development (R&D) teams secure access to data alongside tooling to ensure productivity while keeping security controls in place.

Core features include:

  • Self-service workspace management for TRE administrators
  • Self-service provisioning of R&D tooling for R&D teams
  • Package and repository mirroring
  • Extensible architecture with custom service templates
  • Microsoft Entra ID integration
  • Airlock for import and export
  • Cost reporting

Primary Technologies

Azure TRE uses the following key technologies:

  • Infrastructure as Code:
    • Terraform for infrastructure provisioning
    • Porter/CNAB for bundle packaging
  • Languages:
    • Python (API, resource processor)
    • TypeScript/JavaScript (UI)
    • Bash (deployment scripts)
    • HCL (Terraform)
    • YAML (CI/CD pipelines, Porter manifests)
  • Cloud Services:
    • Azure services (App Service, Container Registry, Cosmos DB, etc.)
    • Microsoft Entra ID for authentication
    • Azure VMSS for resource processor
  • Development Tools:
    • Docker for containerization and as devcontainer for Visual Studio Code Dev Containers extension
    • GitHub Actions for CI/CD
    • Make for build/deployment automation
    • TRE CLI for common TRE setup, authentication, and management commands

Repository Structure

├── .github               - GitHub workflows, issue templates, and configuration
├── cli                   - TRE CLI for common setup, auth, and management commands
├── devops                - DevOps scripts and bootstrapping tools
├── docs                  - Documentation
├── e2e_tests             - pytest-based end-to-end tests
├── api_app               - API source code and docs
├── resource_processor    - VMSS Porter Runner
├── scripts               - Utility scripts
├── ui                    - React-based web UI with TypeScript
└── templates             - Resource templates
    ├── core/terraform    - Terraform definitions of Azure TRE core resources
    ├── shared_services   - Terraform definitions of shared services
    ├── workspace_services - Workspace services
    └── workspaces        - Workspace templates

Coding Conventions

  • General Formatting:
    • Follow the formatting rules defined in .editorconfig
    • Use consistent indentation, line endings, and character encoding as specified
    • Ensure final newlines and trim trailing whitespace per .editorconfig settings
  • Python:
    • Follow PEP 8 style guidelines
    • Use FastAPI for API endpoints
    • Use pytest for testing
  • Terraform:
    • Use HCL format
    • Follow module structure conventions
    • Use variables.tf and outputs.tf for module interfaces
    • Include resource tagging for cost tracking
  • TypeScript/JavaScript:
    • Follow standard ESLint configuration
    • Use Vitest for testing React components
    • Use React Testing Library for component testing
    • Mock FluentUI components in tests due to JSDOM limitations
    • Maintain 80% code coverage across branches, functions, lines, and statements
    • Focus on testing user interactions and component behavior
    • Use semantic queries (getByRole, getByLabelText) over test IDs when possible
    • Use npm for package management
  • YAML:
    • Use consistent indentation (2 spaces)
    • Follow Porter best practices for bundle manifests
  • Git:
    • Update CHANGELOG.md for all significant changes
    • Reference issue numbers in commit messages

Environment Assumptions

  • Azure: All resources are deployed in Azure
  • Microsoft Entra ID: Used for authentication and authorization
  • Networking: Core infrastructure uses hub-spoke networking model
  • Security: Zero-trust security model with strict network boundaries
  • Deployment: CI/CD through GitHub Actions

Template Structure

Azure TRE uses Porter bundles to define workspaces, workspace services, and user resources. These bundles consist of:

porter.yaml

This is the main Porter manifest file that defines:

  • Credentials required for deployment
  • Parameters and their defaults
  • Actions (install, upgrade, uninstall)
  • Mixins used (terraform, exec, etc.)
  • Outputs from the deployment

Example structure:

name: tre-service-example
version: 0.1.0
description: "An example TRE service"
registry: azuretre
dockerfile: Dockerfile.tmpl

credentials:
  - name: azure_tenant_id
    env: ARM_TENANT_ID
  - name: azure_subscription_id
    env: ARM_SUBSCRIPTION_ID
  - name: azure_client_id
    env: ARM_CLIENT_ID
  - name: azure_client_secret
    env: ARM_CLIENT_SECRET

parameters:
  - name: param_name
    type: string
    description: "param_description"
    # ... additional parameters

mixins:
  # ... mixins used

install:
  # ... install actions

upgrade:
  # ... upgrade actions

uninstall:
  # ... uninstall actions

template_schema.json

JSON Schema file that defines the parameters that can be provided when deploying a resource. It follows standard JSON Schema format and is used by the API and UI to generate forms for resource creation.

Key sections include:

  • Properties with types, descriptions, and defaults
  • Required fields
  • UI schema for customizing the display in the UI

Important: The property names in template_schema.json and the parameters section in porter.yaml should match.

Terraform

Most bundles use Terraform to provision the actual resources in Azure. Common practices include:

  • Breaking Terraform code into modules
  • Using remote state for complex deployments
  • Applying proper tagging for cost tracking
  • Using variables.tf, main.tf, and outputs.tf
  • Including lifecycle blocks to prevent resource recreation

Changelog Updates

When creating a pull request, you must update the CHANGELOG.md file with your changes. Add your changes under one of these sections in the unreleased section at the top:

  • ENHANCEMENTS
  • BUG FIXES

Format for changelog entries:

* Brief description of change ([#1234](https://github.com/microsoft/AzureTRE/issues/1234))

Always include issue and/or PR references using the format ([#1234](https://github.com/microsoft/AzureTRE/issues/1234)).

Don't change anything under the COMPONENTS section; it is auto-generated during releases.

Version Management

When editing components or bundles, you must increase their version numbers according to semantic versioning principles:

  1. MAJOR version: Breaking changes, potential data loss, significant changes requiring review
  2. MINOR version: New functionality with automatic upgrade capability
  3. PATCH version: Backward-compatible bug or typo fixes

Version updates should be documented in:

  1. The component's version file:
    • Porter bundles: in porter.yaml
    • API: in api_app/_version.py
    • Resource Processor: in resource_processor/_version.py
    • Airlock Processor: in airlock_processor/_version.py
    • UI: in ui/app/package.json
    • Core: in core/version.txt
    • DevOps: in devops/version.txt

Example CHANGELOG entry for version updates: Refer to the example provided under "Format for changelog entries" above.

Always use semantic versioning (MAJOR.MINOR.PATCH) and follow versioning guidelines in the documentation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.