This document provides guidelines for AI agents (e.g., GitHub Copilot, MCP-based assistants, LLM-based tools) working with the Azure SDK for .NET repository. It defines safe and effective patterns for agent interactions with this codebase, automation workflows, and development processes.
The Azure SDK for .NET repository contains:
- Data plane client Libraries: SDKs for interacting with Azure services at application runtime
- Management plane Libraries: SDKs for provisioning and managing Azure resources
- Code Generators: Tools that generate Azure Data Plane and Management Plane SDKs
- Build Infrastructure: Common engineering systems and tooling for SDK development
/sdk # Individual Azure service SDKs
/eng/packages/http-client-csharp # Azure Data Plane SDK generator
/eng/packages/http-client-csharp-mgmt # Azure Management Plane SDK generator
/eng # Build, test, and automation infrastructure
/doc # Documentation
For detailed developer instructions, see CONTRIBUTING.md.
AI agents may assist with the following activities:
- Reading and Understanding Code: Navigating source files, understanding SDK patterns, and explaining implementations
- Code Generation Support: Assisting with SDK code generation using AutoRest and TypeSpec
- Test Creation: Writing unit tests and integration tests following existing patterns
- Bug Fixes: Identifying and fixing issues in SDK code
- API Review: Preparing code for API reviews and ensuring adherence to design guidelines
- README Updates: Improving SDK documentation and code samples
- Code Comments: Adding inline documentation
- Migration Guides: Creating guides for breaking changes
- Build Verification: Running builds and interpreting results
- Test Execution: Running test suites and analyzing failures
- PR Triage: Summarizing changes and checking CI status
- Issue Analysis: Interpreting bug reports and feature requests
AI agents must not:
- Commit Secrets: Never commit credentials, API keys, or sensitive configuration
- Bypass Security: Skip security checks or modify security-critical code without human review
- Auto-merge PRs: Merge pull requests without proper human approval
- Modify CI/CD Pipelines: Change GitHub Actions workflows without explicit permission
- Delete Test Coverage: Remove or disable existing tests unless explicitly instructed
- Break API Compatibility: Introduce breaking changes in GA libraries without explicit design approval
AI agents should be cautious when:
- Modifying generated code — never update generated code without running the generator to regenerate it
- Making changes to shared infrastructure in
/eng— never do this unless explicitly asked - Updating package dependencies (requires dependency management approval)
- Changing public APIs (requires API review)
# Build a specific service
cd sdk/eventhub
dotnet build
# Run tests (live tests are excluded by default)
dotnet test
# Run tests (explicitly skip live tests)
dotnet test --filter TestCategory!=Live
# Build and test via service.proj
dotnet build eng/service.proj /p:ServiceDirectory=eventhub
dotnet test eng/service.proj /p:ServiceDirectory=eventhub --filter TestCategory!=Live# Build a specific management library
msbuild eng/mgmt.proj /p:scope=Compute
# Run tests
msbuild eng/mgmt.proj /t:RunTests /p:scope=Compute
# Create NuGet package
msbuild eng/mgmt.proj /t:CreateNugetPackage /p:scope=Compute# Build entire repository
dotnet build build.proj
# Build specific scope
dotnet build build.proj /p:Scope=servicebus# Generate code for a data plane SDK
cd sdk/<service>/<project>/src
dotnet build /t:GenerateCode -v d# Install dependencies
cd eng/packages/http-client-csharp
npm install
# Generate test projects
./eng/scripts/Generate.ps1# Install dependencies
cd eng/packages/http-client-csharp-mgmt
npm install
# Generate test projects
./eng/scripts/Generate.ps1When making public API changes:
# Export API for review
eng/scripts/Export-API.ps1 <service-directory>
# Example
eng/scripts/Export-API.ps1 tablesThis generates API listing files in the format: sdk/<service>/<project>/api/<project>.<framework>.cs
# Update snippets in markdown documentation
eng/scripts/Update-Snippets.ps1 <service-directory>
# Example
eng/scripts/Update-Snippets.ps1 keyvault# Verify package is ready for release
# Checks: API review status, changelog, package name approval, release date
CheckPackageReleaseReadiness -PackageName <package-name># Trigger release pipeline
ReleasePackage -PackageName <package-name> -Language dotnet# Update version and changelog for release
./eng/common/scripts/Prepare-Release.ps1 <PackageName> [<ServiceDirectory>] [<ReleaseDate>]- .NET 10.0.103 SDK (or higher within 10.0.* band)
- PowerShell 7+ for scripts and code generation
- Node.js 22.x.x for TypeSpec and code generation
- Git with proper line ending configuration (see Configuration section below)
- Windows:
core.autocrlf=true(Checkout Windows-style, commit Unix-style) - Linux/macOS:
core.autocrlf=input(Checkout as-is, commit Unix-style)
Clone to short paths (e.g., C:\git) to avoid 260-character path limit. Paths in the repo are kept under 210 characters.
- Client Libraries:
Azure.<NamespaceGroup>.<ServiceName>(e.g.,Azure.Storage.Blobs. See the guidelines for approved group names) - Management Libraries:
Azure.ResourceManager.<ResourceProvider>(e.g.,Azure.ResourceManager.Compute) - Legacy Libraries:
Microsoft.Azure.*(previous generation; also includes current bridge/integration packages and libraries with unusual dependencies)
- Client Libraries: Use
$(RequiredTargetFrameworks)fromeng/Directory.Build.Data.props - Management Libraries: Use
$(SdkTargetFx)fromAzSdk.reference.props
Package versions are centrally managed in eng/Packages.Data.props. When adding dependencies:
- Ensure an
<Update>reference with version exists inPackages.Data.props - Add
<Include>reference without version in your.csproj - Contact azuresdkengsysteam@microsoft.com for version changes
- Unit Tests: Required for all code changes
- Live Tests: Should be recorded using Azure.Core.TestFramework. Note: Newer libraries based on System.ClientModel use the unbranded generator and Microsoft.ClientModel.TestFramework instead.
- Test Categories: Use
TestCategory!=Livefilter to skip live tests - Code Coverage: Run with
/p:CollectCoverage=true
Note: The AutoRest/TypeSpec code generation workflow described in this document applies primarily to HTTP/REST-based client libraries. AMQP or MQTT-based libraries (e.g., Event Hubs, Service Bus, SignalR) do not use this generation process and have different development patterns.
- Client Libraries:
sdk/service/ci.ymlfiles define CI for each service - Management Libraries:
sdk/resourcemanager/ci.mgmt.ymlfor management plane - CI Updates: Run
eng/scripts/Update-Mgmt-CI.ps1after adding management libraries
GA libraries use ApiCompat tool to enforce API compatibility:
- Set
ApiCompatVersionproperty to last GA version - Tool automatically verifies no breaking changes on build
- Breaking changes fail CI for GA libraries
- Generated code resides in
Generated/folders - Customizations go in
Customizations/folders - Use
generate.cmdorgenerate.ps1to regenerate - Never manually edit generated code - fix the generator or add customizations
Libraries have source link enabled:
- Enable Microsoft Symbol Servers in Visual Studio
- Disable "Just My Code" to step into SDK code
- Useful for debugging Azure.Core and other dependencies
To use MCP (Model Context Protocol) tool calls:
- PowerShell must be installed (Installation Guide)
- Restart IDE after installation to use MCP server
CheckPackageReleaseReadiness: Verify package release readinessReleasePackage: Trigger package release pipelineazsdk_package_generate_code: Generate SDK from TypeSpec locallyazsdk_package_build_code: Build/compile SDK locally
See eng/common/instructions/azsdk-tools/ for detailed tool documentation.
- CONTRIBUTING.md: Complete contribution guide
- README.md: Repository overview and getting started
- Azure SDK Design Guidelines for .NET: Design principles
- Versioning: Versioning strategy
- Breaking Change Rules: Breaking change policy
This repository includes agent-specific instructions in .github/copilot-instructions.md for GitHub Copilot integration. For the most current Copilot-specific guidance, refer to:
.github/copilot-instructions.md
- GitHub Issues: Report bugs or request features
- Stack Overflow: Tag questions with
azureand.net - Gitter Chat: azure/azure-sdk-for-net
Never open public GitHub issues for security vulnerabilities. Report privately to:
- Email: secure@microsoft.com
- MSRC Portal: https://www.microsoft.com/msrc/faqs-report-an-issue
The Azure SDK collects telemetry by default:
- Disable per-client: Set
IsTelemetryEnabled=falsein client options - Disable globally: Set environment variable
AZURE_TELEMETRY_DISABLED=true - See Telemetry Guidelines
This project follows the Microsoft Open Source Code of Conduct.
For questions, contact opencode@microsoft.com.
This repository is licensed under the MIT License. See LICENSE.txt.
Note: This document follows the AGENTS.md standards for AI agent documentation in open source repositories.