你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Published Blueprints - Create

Publish a new version of the blueprint definition with the latest artifacts. Published blueprint definitions are immutable.

PUT https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}?api-version=2018-11-01-preview

URI Parameters

Name In Required Type Description
blueprintName
path True

string

Name of the blueprint definition.

resourceScope
path True

string

The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').

versionId
path True

string

Version of the published blueprint definition.

api-version
query True

string

Client API Version.

Request Body

Name Type Description
description

string

Multi-line explain this resource.

displayName

string

One-liner string explain this resource.

properties.blueprintName

string

Name of the published blueprint definition.

properties.changeNotes

string

Version-specific change notes.

properties.parameters

<string,  ParameterDefinition>

Parameters required by this blueprint definition.

properties.resourceGroups

<string,  ResourceGroupDefinition>

Resource group placeholders defined by this blueprint definition.

properties.targetScope

BlueprintTargetScope

The scope where this blueprint definition can be assigned.

Responses

Name Type Description
201 Created

PublishedBlueprint

Created -- blueprint definition published.

Other Status Codes

CloudError

Blueprints error response.

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

PublishedManagementGroupBlueprint_Publish
PublishedSubscriptionBlueprint_Publish

PublishedManagementGroupBlueprint_Publish

Sample Request

PUT https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/v2?api-version=2018-11-01-preview

Sample Response

{
  "properties": {
    "description": "blueprint contains all artifact kinds {'template', 'rbac', 'policy'}",
    "blueprintName": "simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "type": "string",
        "metadata": {
          "displayName": "storage account type.",
          "description": null
        }
      },
      "costCenter": {
        "type": "string",
        "metadata": {
          "displayName": "force cost center tag for all resources under given subscription.",
          "description": null
        }
      },
      "owners": {
        "type": "array",
        "metadata": {
          "displayName": "assign owners to subscription along with blueprint assignment.",
          "description": null
        }
      }
    },
    "resourceGroups": {
      "storageRG": {
        "metadata": {
          "displayName": "storage resource group",
          "description": "Contains storageAccounts that collect all shoebox logs."
        }
      }
    },
    "targetScope": "subscription"
  },
  "id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
  "type": "Microsoft.Blueprint/blueprints/versions",
  "name": "v2"
}

PublishedSubscriptionBlueprint_Publish

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/v2?api-version=2018-11-01-preview

Sample Response

{
  "properties": {
    "description": "blueprint contains all artifact kinds {'template', 'rbac', 'policy'}",
    "blueprintName": "simpleBlueprint",
    "parameters": {
      "storageAccountType": {
        "type": "string",
        "metadata": {
          "displayName": "storage account type.",
          "description": null
        }
      },
      "costCenter": {
        "type": "string",
        "metadata": {
          "displayName": "force cost center tag for all resources under given subscription.",
          "description": null
        }
      },
      "owners": {
        "type": "array",
        "metadata": {
          "displayName": "assign owners to subscription along with blueprint assignment.",
          "description": null
        }
      }
    },
    "resourceGroups": {
      "storageRG": {
        "metadata": {
          "displayName": "storage resource group",
          "description": "Contains storageAccounts that collect all shoebox logs."
        }
      }
    },
    "targetScope": "subscription"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
  "type": "Microsoft.Blueprint/blueprints/versions",
  "name": "v2"
}

Definitions

Name Description
BlueprintStatus

The status of the blueprint. This field is readonly.

BlueprintTargetScope

The scope where this blueprint definition can be assigned.

CloudError
ErrorAdditionalInfo

The resource management error additional info.

ErrorResponse

Error Response

ParameterDefinition

Represent a parameter with constrains and metadata.

PublishedBlueprint

Represents a published blueprint.

ResourceGroupDefinition

Represents an Azure resource group in a blueprint definition.

TemplateParameterType

Allowed data types for Resource Manager template parameters.

BlueprintStatus

The status of the blueprint. This field is readonly.

Name Type Description
lastModified

string

Last modified time of this blueprint definition.

timeCreated

string

Creation time of this blueprint definition.

BlueprintTargetScope

The scope where this blueprint definition can be assigned.

Name Type Description
managementGroup

string

The blueprint targets a management group during blueprint assignment. This is reserved for future use.

subscription

string

The blueprint targets a subscription during blueprint assignment.

CloudError

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.)

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.

ParameterDefinition

Represent a parameter with constrains and metadata.

Name Type Description
allowedValues

AllowedValues[]

Array of allowed values for this parameter.

defaultValue

Default Value for this parameter.

metadata.description

string

Description of this parameter/resourceGroup.

metadata.displayName

string

DisplayName of this parameter/resourceGroup.

metadata.strongType

string

StrongType for UI to render rich experience during blueprint assignment. Supported strong types are resourceType, principalId and location.

type

TemplateParameterType

Allowed data types for Resource Manager template parameters.

PublishedBlueprint

Represents a published blueprint.

Name Type Description
description

string

Multi-line explain this resource.

displayName

string

One-liner string explain this resource.

id

string

String Id used to locate any resource on Azure.

name

string

Name of this resource.

properties.blueprintName

string

Name of the published blueprint definition.

properties.changeNotes

string

Version-specific change notes.

properties.parameters

<string,  ParameterDefinition>

Parameters required by this blueprint definition.

properties.resourceGroups

<string,  ResourceGroupDefinition>

Resource group placeholders defined by this blueprint definition.

properties.status

BlueprintStatus

Status of the blueprint. This field is readonly.

properties.targetScope

BlueprintTargetScope

The scope where this blueprint definition can be assigned.

type

string

Type of this resource.

ResourceGroupDefinition

Represents an Azure resource group in a blueprint definition.

Name Type Description
dependsOn

string[]

Artifacts which need to be deployed before this resource group.

location

string

Location of this resourceGroup. Leave empty if the resource group location will be specified during the blueprint assignment.

metadata.description

string

Description of this parameter/resourceGroup.

metadata.displayName

string

DisplayName of this parameter/resourceGroup.

metadata.strongType

string

StrongType for UI to render rich experience during blueprint assignment. Supported strong types are resourceType, principalId and location.

name

string

Name of this resourceGroup. Leave empty if the resource group name will be specified during the blueprint assignment.

tags

object

Tags to be assigned to this resource group.

TemplateParameterType

Allowed data types for Resource Manager template parameters.

Name Type Description
array

string

bool

string

int

string

object

string

secureObject

string

secureString

string

string

string