PR

provisioning-library-generation

A workflow for creating and maintaining C# provisioning libraries for Azure resources.

Install

mkdir -p .claude/skills/provisioning-library-generation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16650" && unzip -o skill.zip -d .claude/skills/provisioning-library-generation && rm skill.zip

Installs to .claude/skills/provisioning-library-generation

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Generate new Azure.Provisioning.* libraries OR regenerate existing ones. Use when introducing a brand-new provisioning library, adding new resource types, enum values, or API versions.
184 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Onboard brand new `Azure.Provisioning.{Service}` packages
  • Update existing packages to add new resources
  • Add new enum values to provisioning libraries
  • Update API versions in provisioning libraries
  • Determine if management library version update is needed
  • Run the provisioning generator

How it works

The skill guides through onboarding new provisioning libraries or regenerating existing ones by determining management library version updates, checking resource whitelists, and running the provisioning generator.

Inputs & outputs

You give it
request to generate or regenerate an Azure.Provisioning library
You get back
newly generated or updated `Azure.Provisioning.{Service}` package

When to use provisioning-library-generation

  • Onboard a new provisioning library
  • Regenerate provisioning resources
  • Update API version in SDK
  • Add new enum values to library

About this skill

Provisioning Library Generation

This skill covers two related generation workflows for Azure.Provisioning.* libraries:

  • Onboarding — introducing a brand new Azure.Provisioning.{Service} package.
  • Regeneration — updating an existing package to add new resources, enum values, or API versions.

Start here: Use Workflow Selection below to choose the correct process before doing anything else.


Workflow Selection

Is this onboarding or regeneration?

  • If sdk/{service}/Azure.Provisioning.{Service}/ already exists → Regeneration. Jump to Regeneration Workflow.
  • If it does NOT exist → Onboarding. Read and follow ONBOARDING.md in this skill directory. New provisioning libraries are onboarded through the TypeSpec provisioning emitter.

Regeneration Workflow

(For existing packages — adding new resources, enum values, or API versions.)

Step 1: Determine If Management Library Version Update Is Needed

Key principle: Only update the management library version if explicitly requested or if the feature doesn't exist in the current version. Prefer not updating to reduce the amount of changes.

  1. If the requirement explicitly says "update the version" → Update the version (proceed to Step 2A)

  2. If the requirement does NOT explicitly request a version update:

    • Check if the feature already exists in the current management library:
      # Search for the resource/feature in the management library
      grep -r "NetworkSecurityPerimeterResource" sdk/{service}/Azure.ResourceManager.{Service}/
      
    • If the feature exists → Skip version update, proceed to Step 2B
    • If the feature doesn't exist → You'll need to update the version (proceed to Step 2A)

Step 2A: Update Management Library Version (If Needed)

Edit eng/centralpackagemanagement/Directory.Packages.props to update the management library version:

<PackageVersion Include="Azure.ResourceManager.{ServiceName}" Version="{NewVersion}" />

Step 2B: Check for Resource Whitelist (If Applicable)

Some specifications (like Network) use a whitelist to limit which resources are generated. Check the specification file:

cat sdk/provisioning/Generator/src/Specifications/{Service}Specification.cs

If you see a _generatedResources HashSet, add the new resource types to it:

private readonly HashSet<Type> _generatedResources = new()
{
    // ... existing resources ...
    typeof(NetworkSecurityPerimeterResource),
    typeof(NetworkSecurityPerimeterAccessRuleResource),
    // ... add all related resource types ...
};

Step 3: Run the Provisioning Generator

Navigate to the generator directory and run:

cd sdk/provisioning/Generator/src
dotnet run --framework net10.0 -- --filter {ServiceName}

Important: The generator reads from NuGet packages, NOT local source code. The version in eng/centralpackagemanagement/Directory.Packages.props determines which package version is used.

Verify Only Target Library Changed

After running the generator, verify that only the target provisioning library was modified:

git status --short -- sdk/provisioning/

The generator may regenerate other libraries (e.g., Azure.Provisioning) due to shared dependencies. Revert any changes to libraries other than the target:

# Example: If you're adding features to Azure.Provisioning.Network, revert changes to Azure.Provisioning
git checkout main -- sdk/provisioning/Azure.Provisioning/

Only keep changes to Azure.Provisioning.{TargetService}/.

Generator Errors

If the generator fails with errors:

  1. Capture the full error output including stack traces and error messages
  2. Report the error to the user with enough context to understand what went wrong
  3. Stop and let the user decide how to proceed — generator errors often require code changes to the generator itself or the specification files, which may need human judgment

Do NOT attempt to automatically fix generator errors without user guidance.

Schema and Bicep-reference validation is handled by the dedicated provisioning PR review workflow. Do not duplicate that validation in this generation workflow.

Step 4: Handle Breaking Changes (Version Updates Only)

When updating management library versions, compare the generated code with the previous version. Common breaking changes include:

Type Removed

If a type is removed from the management library:

  • Create a backward-compatible stub in sdk/provisioning/Azure.Provisioning.{Service}/src/BackwardCompatible/Models/
  • Mark it with [EditorBrowsable(EditorBrowsableState.Never)] and [Obsolete]

Property Type Changed

If a property type changes:

  1. In the specification file, use CustomizeProperty to rename the new property:
    CustomizeProperty("ResourceName", "PropertyName", p => p.Name = "NewPropertyName");
    
  2. Use CustomizeResource with GeneratePartialPropertyDefinition = true:
    CustomizeResource("ResourceName", r => r.GeneratePartialPropertyDefinition = true);
    
  3. Create a partial class in BackwardCompatible/ that implements DefineAdditionalProperties() to add the old property name

Enum Ordinal Shift

If enum member ordering changes (affecting implicit numeric values):

  • Use OrderEnum<T>() in the specification file to preserve the original ordering:
    OrderEnum<PostgreSqlFlexibleServerVersion>("Ver15", "Ver14", "Ver13", "Ver12", "Ver11", "Sixteen");
    

DataMember Attribute Removed

If [DataMember] attributes are removed from enums, ApiCompat will report CP0014 errors.

For provisioning packages, add the suppression to eng/apicompatbaselines/Azure.Provisioning.{Service}.xml:

<Suppression>
  <DiagnosticId>CP0014</DiagnosticId>
  <Target>F:Azure.Provisioning.{Service}.{EnumType}.{Member}:[T:System.Runtime.Serialization.DataMemberAttribute]</Target>
</Suppression>

Note: This centralized suppression approach is specifically supported for provisioning packages and is the only option for suppressing these particular ApiCompat errors.

Step 5: Fix Spell Check Issues

If CI fails with "Unknown word" errors, add the words to sdk/provisioning/cspell.yaml:

  - filename: '**/sdk/provisioning/Azure.Provisioning.{Service}/**/*.cs'
    words:
      - newword1
      - newword2

Important: Use sdk/provisioning/cspell.yaml, NOT .vscode/cspell.json.

Step 6: Run Pre-Commit Checks

Before committing, invoke the pre-commit-checks skill with the service directory set to provisioning. This will handle code formatting, API export, and snippet updates.

Step 7: Update CHANGELOG and Commit

  1. Update the CHANGELOG at sdk/provisioning/Azure.Provisioning.{Service}/CHANGELOG.md:

    ## X.X.X-beta.X (Unreleased)
    
    ### Features Added
    
    - Added support for `{NewResource}` resources and related types.
    
  2. Stage all changes and commit:

    git add -A
    git commit -m "Add {Feature} to Azure.Provisioning.{Service}"
    

Example A: PostgreSQL Server Versions 17 and 18 (Version Update Required)

The requirement was to add PostgreSQL versions 17 and 18, which required updating the management library.

  1. Updated eng/centralpackagemanagement/Directory.Packages.props: Changed Azure.ResourceManager.PostgreSql from 1.3.1 to 1.4.1
  2. Ran generator: dotnet run --framework net10.0 -- --filter PostgreSql
  3. Handled breaking changes: Property renames, obsolete stubs, enum ordering, ApiCompatBaseline
  4. Fixed CI issues: Added spell check words to cspell.yaml
  5. Ran pre-commit checks: pwsh eng\scripts\CodeChecks.ps1 -ServiceDirectory provisioning

Example B: NetworkSecurityPerimeter Resources (No Version Update Needed)

The requirement was to add NetworkSecurityPerimeter support. The resources already existed in the current management library but weren't being generated due to a whitelist.

  1. Checked management library: Resources already existed in Azure.ResourceManager.Network
  2. Updated NetworkSpecification.cs: Added 7 resource types to _generatedResources:
    typeof(NetworkSecurityPerimeterResource),
    typeof(NetworkSecurityPerimeterAccessRuleResource),
    typeof(NetworkSecurityPerimeterAssociationResource),
    typeof(NetworkSecurityPerimeterLinkResource),
    typeof(NetworkSecurityPerimeterLinkReferenceResource),
    typeof(NetworkSecurityPerimeterLoggingConfigurationResource),
    typeof(NetworkSecurityPerimeterProfileResource),
    
  3. Ran generator: dotnet run --framework net10.0 -- --filter Network
  4. Ran pre-commit checks: No breaking changes (new resources only)
  5. Updated CHANGELOG: Documented new NetworkSecurityPerimeter support

Key Files

FilePurpose
eng/centralpackagemanagement/Directory.Packages.propsManagement library version
sdk/provisioning/Generator/src/Specifications/{Service}Specification.csGenerator customizations and resource whitelist
sdk/provisioning/Generator/src/Model/Specification.Customize.csCustomization API (OrderEnum, CustomizeResource, etc.)
sdk/provisioning/Azure.Provisioning.{Service}/src/BackwardCompatible/Backward-compatible customizations
eng/apicompatbaselines/Azure.Provisioning.{Service}.xmlAPI compatibility suppressions (provisioning only)
sdk/provisioning/cspell.yamlSpell check configuration for provisioning

Troubleshooting

Resources not being generated

  • Check if the specification uses a whitelist (_generatedResources)
  • Verify the resource types are added to the whitelist
  • Ensure the management library version is correct

Generator fails to find types

  • Ensure the management library version in eng/centralpackagemanagement/Directory.Packages.props is correct and published
  • Try running dotnet restore befo

Content truncated.

When not to use it

  • When the task is not related to generating or regenerating `Azure.Provisioning.*` libraries
  • When the generator fails with errors and user guidance is not provided
  • When attempting to automatically fix generator errors

Limitations

  • The skill generates new `Azure.Provisioning.*` libraries OR regenerates existing ones
  • The skill is used when introducing a brand-new provisioning library, adding new resource types, enum values, or API versions
  • The skill requires user decision on how to proceed with generator errors

How it compares

This skill provides a structured workflow for generating and regenerating Azure.Provisioning libraries, including specific steps for version updates and handling breaking changes, unlike manual code generation.

Compared to similar skills

provisioning-library-generation side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
provisioning-library-generation (this skill)01moReviewAdvanced
azure-servicebus-dotnet33moReviewIntermediate
dotnet-backend-patterns75moNo flagsAdvanced
azure-resource-manager-mysql-dotnet13moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

azure-servicebus-dotnet

microsoft

Azure Service Bus SDK for .NET. Enterprise messaging with queues, topics, subscriptions, and sessions. Use for reliable message delivery, pub/sub patterns, dead letter handling, and background processing. Triggers: "Service Bus", "ServiceBusClient", "ServiceBusSender", "ServiceBusReceiver", "ServiceBusProcessor", "message queue", "pub/sub .NET", "dead letter queue".

316

dotnet-backend-patterns

wshobson

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

722

azure-resource-manager-mysql-dotnet

microsoft

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "MySQL", "MySqlFlexibleServer", "MySQL Flexible Server", "Azure Database for MySQL", "MySQL database management", "MySQL firewall", "MySQL backup".

14

azure-ai-openai-dotnet

microsoft

Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: "Azure OpenAI", "AzureOpenAIClient", "ChatClient", "chat completions .NET", "GPT-4", "embeddings", "DALL-E", "Whisper", "OpenAI .NET".

13

ccxt-csharp

ccxt

CCXT cryptocurrency exchange library for C# and .NET developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in .NET projects. Use when working with crypto exchanges in C# applications, trading systems, or financial software. Supports .NET Standard 2.0+.

13

azure-ai-document-intelligence-dotnet

microsoft

Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: "Document Intelligence", "DocumentIntelligenceClient", "form recognizer", "invoice extraction", "receipt OCR", "document analysis .NET".

03

Search skills

Search the agent skills registry