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.
77
96%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
This skill covers two related generation workflows for Azure.Provisioning.* libraries:
Azure.Provisioning.{Service} package.Start here: Use Workflow Selection below to choose the correct process before doing anything else.
sdk/{service}/Azure.Provisioning.{Service}/ already exists → Regeneration. Jump to Regeneration Workflow.ONBOARDING.md in this skill directory. New provisioning libraries are onboarded through the TypeSpec provisioning emitter.(For existing packages — adding new resources, enum values, or API versions.)
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.
If the requirement explicitly says "update the version" → Update the version (proceed to Step 2A)
If the requirement does NOT explicitly request a version update:
# Search for the resource/feature in the management library
grep -r "NetworkSecurityPerimeterResource" sdk/{service}/Azure.ResourceManager.{Service}/Edit eng/centralpackagemanagement/Directory.Packages.props to update the management library version:
<PackageVersion Include="Azure.ResourceManager.{ServiceName}" Version="{NewVersion}" />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.csIf 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 ...
};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.
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}/.
If the generator fails with errors:
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.
When updating management library versions, compare the generated code with the previous version. Common breaking changes include:
If a type is removed from the management library:
sdk/provisioning/Azure.Provisioning.{Service}/src/BackwardCompatible/Models/[EditorBrowsable(EditorBrowsableState.Never)] and [Obsolete]If a property type changes:
CustomizeProperty to rename the new property:
CustomizeProperty("ResourceName", "PropertyName", p => p.Name = "NewPropertyName");CustomizeResource with GeneratePartialPropertyDefinition = true:
CustomizeResource("ResourceName", r => r.GeneratePartialPropertyDefinition = true);BackwardCompatible/ that implements DefineAdditionalProperties() to add the old property nameIf enum member ordering changes (affecting implicit numeric values):
OrderEnum<T>() in the specification file to preserve the original ordering:
OrderEnum<PostgreSqlFlexibleServerVersion>("Ver15", "Ver14", "Ver13", "Ver12", "Ver11", "Sixteen");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.
If CI fails with "Unknown word" errors, add the words to sdk/provisioning/cspell.yaml:
- filename: '**/sdk/provisioning/Azure.Provisioning.{Service}/**/*.cs'
words:
- newword1
- newword2Important: Use sdk/provisioning/cspell.yaml, NOT .vscode/cspell.json.
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.
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.Stage all changes and commit:
git add -A
git commit -m "Add {Feature} to Azure.Provisioning.{Service}"The requirement was to add PostgreSQL versions 17 and 18, which required updating the management library.
eng/centralpackagemanagement/Directory.Packages.props: Changed Azure.ResourceManager.PostgreSql from 1.3.1 to 1.4.1dotnet run --framework net10.0 -- --filter PostgreSqlcspell.yamlpwsh eng\scripts\CodeChecks.ps1 -ServiceDirectory provisioningThe requirement was to add NetworkSecurityPerimeter support. The resources already existed in the current management library but weren't being generated due to a whitelist.
Azure.ResourceManager.NetworkNetworkSpecification.cs: Added 7 resource types to _generatedResources:
typeof(NetworkSecurityPerimeterResource),
typeof(NetworkSecurityPerimeterAccessRuleResource),
typeof(NetworkSecurityPerimeterAssociationResource),
typeof(NetworkSecurityPerimeterLinkResource),
typeof(NetworkSecurityPerimeterLinkReferenceResource),
typeof(NetworkSecurityPerimeterLoggingConfigurationResource),
typeof(NetworkSecurityPerimeterProfileResource),dotnet run --framework net10.0 -- --filter Network| File | Purpose |
|---|---|
eng/centralpackagemanagement/Directory.Packages.props | Management library version |
sdk/provisioning/Generator/src/Specifications/{Service}Specification.cs | Generator customizations and resource whitelist |
sdk/provisioning/Generator/src/Model/Specification.Customize.cs | Customization API (OrderEnum, CustomizeResource, etc.) |
sdk/provisioning/Azure.Provisioning.{Service}/src/BackwardCompatible/ | Backward-compatible customizations |
eng/apicompatbaselines/Azure.Provisioning.{Service}.xml | API compatibility suppressions (provisioning only) |
sdk/provisioning/cspell.yaml | Spell check configuration for provisioning |
_generatedResources)eng/centralpackagemanagement/Directory.Packages.props is correct and publisheddotnet restore before the generatorBackwardCompatible/Models/CustomizeProperty and CustomizeResource in specification filesDefineAdditionalProperties() for property renames[DataMember] attribute removal errors can be suppressed via the centralized XML suppression fileOrderEnum<T>() in the specification file to control orderingfef8881
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.