Template Spec Versions - Create Or Update

Creates or updates a Template Spec version.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}?api-version=2021-05-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

Regex pattern: ^[-\w\._\(\)]+$

subscriptionId
path True

string

Subscription Id which forms part of the URI for every service call.

templateSpecName
path True

string

Name of the Template Spec.

Regex pattern: ^[-\w\._\(\)]+$

templateSpecVersion
path True

string

The version of the Template Spec.

Regex pattern: ^[-\w\._\(\)]+$

api-version
query True

string

Client Api version.

Request Body

Name Required Type Description
location True

string

The location of the Template Spec Version. It must match the location of the parent Template Spec.

properties.description

string

Template Spec version description.

properties.linkedTemplates

LinkedTemplateArtifact[]

An array of linked template artifacts.

properties.mainTemplate

object

The main Azure Resource Manager template content.

properties.metadata

object

The version metadata. Metadata is an open-ended object and is typically a collection of key-value pairs.

properties.uiFormDefinition

object

The Azure Resource Manager template UI definition content.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

TemplateSpecVersion

OK - The Template Spec Version has been successfully updated.

201 Created

TemplateSpecVersion

Template Spec Version created.

Other Status Codes

TemplateSpecsError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

TemplateSpecVersionsCreateUpdate

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/simpleTemplateSpec/versions/v1.0?api-version=2021-05-01

{
  "location": "eastus",
  "properties": {
    "description": "This is version v1.0 of our template content",
    "mainTemplate": {
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {},
      "resources": []
    }
  }
}

Sample Response

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/simpleTemplateSpec/versions/v1.0",
  "type": "Microsoft.Resources/templateSpecs/versions",
  "name": "v1.0",
  "location": "eastus",
  "systemData": {
    "createdBy": "string",
    "createdByType": "Application",
    "createdAt": "2020-02-01T01:01:01.1075056Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "Application",
    "lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
  },
  "properties": {
    "description": "This is version v1.0 of our template content",
    "mainTemplate": {
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {},
      "resources": []
    }
  }
}
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/simpleTemplateSpec/versions/v1.0",
  "type": "Microsoft.Resources/templateSpecs/versions",
  "name": "v1.0",
  "location": "eastus",
  "systemData": {
    "createdBy": "string",
    "createdByType": "Application",
    "createdAt": "2020-02-01T01:01:01.1075056Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "Application",
    "lastModifiedAt": "2020-02-01T01:01:01.1075056Z"
  },
  "properties": {
    "description": "This is version v1.0 of our template content",
    "mainTemplate": {
      "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {},
      "resources": []
    }
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

Error Response

LinkedTemplateArtifact

Represents a Template Spec artifact containing an embedded Azure Resource Manager template for use as a linked template.

systemData

Metadata pertaining to creation and last modification of the resource.

TemplateSpecsError

Template Specs error response.

TemplateSpecVersion

Template Spec Version object.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorResponse

Error Response

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorResponse[]

The error details.

message

string

The error message.

target

string

The error target.

LinkedTemplateArtifact

Represents a Template Spec artifact containing an embedded Azure Resource Manager template for use as a linked template.

Name Type Description
path

string

A filesystem safe relative path of the artifact.

template

object

The Azure Resource Manager template.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TemplateSpecsError

Template Specs error response.

Name Type Description
error

ErrorResponse

Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)

TemplateSpecVersion

Template Spec Version object.

Name Type Description
id

string

String Id used to locate any resource on Azure.

location

string

The location of the Template Spec Version. It must match the location of the parent Template Spec.

name

string

Name of this resource.

properties.description

string

Template Spec version description.

properties.linkedTemplates

LinkedTemplateArtifact[]

An array of linked template artifacts.

properties.mainTemplate

object

The main Azure Resource Manager template content.

properties.metadata

object

The version metadata. Metadata is an open-ended object and is typically a collection of key-value pairs.

properties.uiFormDefinition

object

The Azure Resource Manager template UI definition content.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

Type of this resource.