Microsoft Bicep Template Spec Versions API

Manage versions of Template Spec resources

OpenAPI Specification

microsoft-bicep-template-spec-versions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft Bicep Deployments Template Spec Versions API
  description: Azure Resource Manager Deployments REST API used by Microsoft Bicep to deploy infrastructure as code templates. Provides operations for creating, validating, and managing ARM/Bicep template deployments at resource group, subscription, management group, and tenant scopes.
  version: '2025-04-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/
  license:
    name: MIT
    url: https://github.com/Azure/bicep/blob/main/LICENSE
  termsOfService: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://management.azure.com
  description: Azure Resource Manager Global Endpoint
security:
- azure_auth:
  - user_impersonation
tags:
- name: Template Spec Versions
  description: Manage versions of Template Spec resources
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}
  : put:
      operationId: TemplateSpecVersions_CreateOrUpdate
      summary: Microsoft Bicep Create or update a Template Spec version
      description: Creates or updates a version of a Template Spec. Each version contains the actual compiled Bicep/ARM template content.
      tags:
      - Template Spec Versions
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - $ref: '#/components/parameters/templateSpecName'
      - $ref: '#/components/parameters/templateSpecVersion'
      - $ref: '#/components/parameters/apiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateSpecVersionModel'
      responses:
        '200':
          description: Template Spec version updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecVersionModel'
        '201':
          description: Template Spec version created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecVersionModel'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecsError'
    get:
      operationId: TemplateSpecVersions_Get
      summary: Microsoft Bicep Get a Template Spec version
      description: Gets a Template Spec version by name.
      tags:
      - Template Spec Versions
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - $ref: '#/components/parameters/templateSpecName'
      - $ref: '#/components/parameters/templateSpecVersion'
      - $ref: '#/components/parameters/apiVersion'
      responses:
        '200':
          description: Template Spec version details returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecVersionModel'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecsError'
    delete:
      operationId: TemplateSpecVersions_Delete
      summary: Microsoft Bicep Delete a Template Spec version
      description: Deletes a specific version from a Template Spec.
      tags:
      - Template Spec Versions
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - $ref: '#/components/parameters/templateSpecName'
      - $ref: '#/components/parameters/templateSpecVersion'
      - $ref: '#/components/parameters/apiVersion'
      responses:
        '200':
          description: Template Spec version deleted successfully
        '204':
          description: Template Spec version not found (already deleted)
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecsError'
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions
  : get:
      operationId: TemplateSpecVersions_List
      summary: Microsoft Bicep List Template Spec versions
      description: Lists all the versions of a Template Spec.
      tags:
      - Template Spec Versions
      parameters:
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/resourceGroupName'
      - $ref: '#/components/parameters/templateSpecName'
      - $ref: '#/components/parameters/apiVersion'
      responses:
        '200':
          description: List of versions returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecVersionListResult'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSpecsError'
components:
  schemas:
    TemplateSpecsError:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorResponse'
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: The error code
        message:
          type: string
          description: The error message
        target:
          type: string
          description: The error target
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponse'
          description: The error details
        additionalInfo:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: The additional info type
              info:
                type: object
                description: The additional info
          description: The error additional info
    LinkedTemplateArtifact:
      type: object
      required:
      - path
      - template
      properties:
        path:
          type: string
          description: A filesystem safe relative path of the artifact
        template:
          type: object
          description: The ARM/Bicep compiled template content
    SystemData:
      type: object
      properties:
        createdBy:
          type: string
          description: The identity that created the resource
        createdByType:
          type: string
          enum:
          - User
          - Application
          - ManagedIdentity
          - Key
          description: The type of identity that created the resource
        createdAt:
          type: string
          format: date-time
          description: The timestamp of resource creation (UTC)
        lastModifiedBy:
          type: string
          description: The identity that last modified the resource
        lastModifiedByType:
          type: string
          enum:
          - User
          - Application
          - ManagedIdentity
          - Key
          description: The type of identity that last modified the resource
        lastModifiedAt:
          type: string
          format: date-time
          description: The timestamp of resource last modification (UTC)
    TemplateSpecVersionListResult:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/TemplateSpecVersionModel'
          description: Array of Template Spec versions
        nextLink:
          type: string
          format: uri
          readOnly: true
          description: URL to get the next set of results
    TemplateSpecVersionModel:
      type: object
      required:
      - location
      - properties
      properties:
        id:
          type: string
          readOnly: true
          description: String ID used to locate any resource on Azure
        name:
          type: string
          readOnly: true
          description: Name of this resource
        type:
          type: string
          readOnly: true
          description: Type of this resource
        location:
          type: string
          description: The location of the Template Spec version
        tags:
          type: object
          additionalProperties:
            type: string
          description: Resource tags
        systemData:
          $ref: '#/components/schemas/SystemData'
        properties:
          type: object
          required:
          - mainTemplate
          properties:
            description:
              type: string
              maxLength: 4096
              description: Template Spec version description
            linkedTemplates:
              type: array
              items:
                $ref: '#/components/schemas/LinkedTemplateArtifact'
              description: An array of linked template artifacts
            mainTemplate:
              type: object
              description: The main ARM/Bicep compiled template content for this version
            metadata:
              type: object
              description: The version metadata. Metadata is an open-ended object and is typically a collection of key-value pairs.
            uiFormDefinition:
              type: object
              description: The Azure Resource Manager template UI definition content. This can be used to customize the portal deployment experience.
  parameters:
    templateSpecName:
      name: templateSpecName
      in: path
      required: true
      description: Name of the Template Spec
      schema:
        type: string
        minLength: 1
        maxLength: 90
        pattern: ^[-\w\.\_\(\)]+$
    subscriptionId:
      name: subscriptionId
      in: path
      required: true
      description: Subscription ID which forms part of the URI for every service call
      schema:
        type: string
    resourceGroupName:
      name: resourceGroupName
      in: path
      required: true
      description: The name of the resource group. The name is case insensitive.
      schema:
        type: string
        minLength: 1
        maxLength: 90
        pattern: ^[-\w\.\_\(\)]+$
    apiVersion:
      name: api-version
      in: query
      required: true
      description: Client API version
      schema:
        type: string
        default: '2021-05-01'
    templateSpecVersion:
      name: templateSpecVersion
      in: path
      required: true
      description: The version of the Template Spec
      schema:
        type: string
        minLength: 1
        maxLength: 90
        pattern: ^[-\w\.\_\(\)]+$
  securitySchemes:
    azure_auth:
      type: oauth2
      description: Azure Active Directory OAuth2 Flow
      flows:
        implicit:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
          scopes:
            user_impersonation: Impersonate your user account
externalDocs:
  description: Azure Resource Manager Deployments API Documentation
  url: https://learn.microsoft.com/en-us/rest/api/resources/deployments