| applyTo | **/specification/**/resource-manager/*.json |
|---|
When reviewing Azure Resource Manager (ARM) OpenAPI specifications, ensure compliance with Microsoft API Guidelines and Azure RPC contracts. Prioritize Azure RPC requirements when conflicts arise.
- MUST follow [Azure REST API Guidelines] (https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md)
- MUST conform to [Azure RPC contracts] (https://github.com/cloud-and-ai-microsoft/resource-provider-contract)
- Azure RPC takes precedence over general guidelines in case of conflicts
- NO breaking changes in GA (stable) API versions per Azure Breaking Changes Policy
- Verify no removal/renaming of properties, operations, or parameters in existing versions
- Check property types remain unchanged (e.g., boolean → string is breaking)
- Ensure enum values are not removed or renamed
- New required properties or parameters require new API version
- URL path format changes require new API version
- Resource model name MUST match singular form of resource type (e.g.,
VirtualMachineforvirtualMachines) - Top-level resources MUST have
ListByResourceGroupandListBySubscriptionoperations - Tracked resources MUST have GET, PUT, PATCH (update), and DELETE operations
- All resources MUST include
systemDataproperty (read-only) with type from common-types - Nested resources MUST have List operation
- MUST reference appropriate common-types version (v3, v4, or v5) for standard ARM types:
Resource,TrackedResource,ProxyResource,ExtensionResourceErrorResponse,ErrorDetail- Standard parameters:
SubscriptionIdParameter,ResourceGroupNameParameter,ApiVersionParameter
- Use
$refto common-types instead of redefining standard ARM structures
- API version MUST follow
YYYY-MM-DDformat - Version MUST be in path:
/subscriptions/{subscriptionId}/providers/Microsoft.{Namespace}/...?api-version=YYYY-MM-DD - Stable versions in
/stable/directory, preview in/preview/
- MUST define
securityDefinitionswith OAuth2 Azure AD authentication - MUST apply
securityrequirement to all operations - Scopes should use
user_impersonationfor management plane
- Mark required parameters as
"required": true- incorrect marking breaks customers - Mark read-only properties as
"readOnly": true(e.g.,id,name,type,systemData) - Use
x-ms-mutabilityto specify create/read/update behavior - Collections MUST support multiple elements, not artificially limited to one
- Only define operations/properties/parameters actually supported by the service
- Properties and parameters: camelCase (e.g.,
resourceGroupName) - Resource types in path: camelCase (e.g.,
/virtualMachines/{virtualMachineName}) - Resource provider namespace: PascalCase (e.g.,
Microsoft.Compute) - Model definitions: PascalCase (e.g.,
VirtualMachine) - Enum values: PascalCase preferred
- Avoid abbreviations in names unless industry-standard
- Use resource name, not abbreviations, in path parameters:
{virtualMachineName}not{vmName}
- OperationId format:
{ResourceType}_{Action}(e.g.,VirtualMachines_Get,VirtualMachines_CreateOrUpdate) - Operations MUST have unique
operationId - Use standard verbs: GET →
Get/List, PUT →CreateOrUpdate, PATCH →Update, DELETE →Delete, POST → action name - Include
x-ms-examplesreferencing example JSON files - DELETE operations: return 200 (with body), 202 (async), or 204 (no content)
- Long-running operations: use
x-ms-long-running-operation: trueand return 201 or 202
- List operations MUST use
x-ms-pageablewithnextLinkName - Collection models MUST have
valuearray property and optionalnextLinkstring
- Every operation, parameter, property, and model MUST have clear description
- Start operation descriptions with verb (e.g., "Gets the virtual machine.")
- Start with capital letter, end with period
- Specify units for quantifiable properties (MB, seconds, etc.)
- Use correct acronym capitalization: "URL" not "Url", "ID" not "Id"
- Avoid: "Gets or sets...", "Gets...", "Sets..." in property descriptions
- Document all HTTP status codes in responses
- Default error response MUST reference common-types
ErrorResponse - Include "default" response for all operations
- Use
x-ms-error-response: truefor error responses
- REQUIRED:
x-ms-parameter-location: "method"for common parameters (subscriptionId, resourceGroupName, apiVersion) - Use
x-ms-enumwithmodelAsString: truefor extensible enums (allows new values without breaking) - Use
x-ms-discriminator-valuefor polymorphic types - Private/internal operations: mark with
x-ms-visibility: "internal"
Think as a customer: Are parameter names intuitive? Is required vs. optional clear? Are default values documented? Can developers understand how to use this API from the specification alone?
- MUST include
x-ms-examplesfor all operations - Example files in
examples/directory - MUST test all operations before PR submission
- Examples MUST validate against specification
✓ No breaking changes in existing versions
✓ Follows Azure RPC contracts
✓ Common-types properly referenced
✓ Naming conventions (camelCase properties, PascalCase types)
✓ Required/readOnly correctly marked
✓ Security definitions present
✓ Standard ARM operations implemented
✓ Pagination on list operations
✓ Operation IDs follow pattern
✓ Examples provided and valid
✓ Descriptions clear and complete
✓ API version format correct
Flag violations clearly with line numbers and specific guidance for fixes. Once completed always add the following comment : "Copilot used the entire file : .github/instructions/armapi-review.instructions.md for arm api reviews."