swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Azure Blueprints Client provides access to blueprint definitions, assignments, and artifacts, and related blueprint operations.
  title: BlueprintClient
  version: 2018-11-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/blueprintAssignment.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: blueprint-blueprintAssignment
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: Client API Version.
    in: query
    name: api-version
    required: true
    type: string
    x-ms-parameter-location: client
  AssignmentNameParameter:
    description: Name of the blueprint assignment.
    in: path
    name: assignmentName
    required: true
    type: string
    x-ms-parameter-location: method
  ScopeParameter:
    description: "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'). For blueprint assignments management group scope is reserved for future use."
    in: path
    name: scope
    required: true
    type: string
    x-ms-parameter-location: method
    x-ms-skip-url-encoding: true
paths:
  "/{scope}/providers/Microsoft.Blueprint/blueprintAssignments":
    get:
      description: List blueprint assignments within a subscription.
      operationId: Assignments_List
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ScopeParameter"
      responses:
        "200":
          description: OK -- all blueprint assignments retrieved.
          schema:
            $ref: "#/definitions/AssignmentList"
      tags:
        - Assignment
      x-ms-examples:
        Assignment:
          parameters:
            api-version: 2017-11-11-preview
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint
                    identity:
                      principalId: 00000000-0000-0000-0000-000000000000
                      tenantId: 00000000-0000-0000-0000-000000000000
                      type: SystemAssigned
                    location: eastus
                    name: assignSimpleBlueprint
                    properties:
                      blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                      description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                      parameters:
                        costCenter:
                          value: Contoso/Online/Shopping/Production
                        owners:
                          value:
                            - johnDoe@contoso.com
                            - johnsteam@contoso.com
                        storageAccountType:
                          value: Standard_LRS
                      provisioningState: failed
                      resourceGroups:
                        storageRG:
                          location: eastus
                          name: defaultRG
                    type: Microsoft.Blueprint/Assignment
      x-ms-pageable:
        nextLinkName: nextLink
  "/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}":
    delete:
      description: Delete a blueprint assignment.
      operationId: Assignments_Delete
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ScopeParameter"
        - $ref: "#/parameters/AssignmentNameParameter"
      responses:
        "202":
          description: OK -- blueprint assignment deleted.
          schema:
            $ref: "#/definitions/Assignment"
        "204":
          description: No Content
      tags:
        - Assignment
      x-ms-examples:
        Assignment_Delete:
          parameters:
            api-version: 2017-11-11-preview
            assignmentName: assignSimpleBlueprint
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "202":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint
                identity:
                  principalId: 00000000-0000-0000-0000-000000000000
                  tenantId: 00000000-0000-0000-0000-000000000000
                  type: SystemAssigned
                location: eastus
                name: assignSimpleBlueprint
                properties:
                  blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                  description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                  parameters:
                    costCenter:
                      value: Contoso/Online/Shopping/Production
                    owners:
                      value:
                        - johnDoe@contoso.com
                        - johnsteam@contoso.com
                    storageAccountType:
                      value: Standard_LRS
                  provisioningState: deleting
                  resourceGroups:
                    storageRG:
                      location: eastus
                      name: defaultRG
                type: Microsoft.Blueprint/Assignment
            "204": {}
    get:
      description: Get a blueprint assignment.
      operationId: Assignments_Get
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ScopeParameter"
        - $ref: "#/parameters/AssignmentNameParameter"
      responses:
        "200":
          description: OK -- blueprint assignment retrieved.
          schema:
            $ref: "#/definitions/Assignment"
      tags:
        - Assignment
      x-ms-examples:
        Assignment:
          parameters:
            api-version: 2017-11-11-preview
            assignmentName: assignSimpleBlueprint
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint
                identity:
                  principalId: 00000000-0000-0000-0000-000000000000
                  tenantId: 00000000-0000-0000-0000-000000000000
                  type: SystemAssigned
                location: eastus
                name: assignSimpleBlueprint
                properties:
                  blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                  description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                  parameters:
                    costCenter:
                      value: Contoso/Online/Shopping/Production
                    owners:
                      value:
                        - johnDoe@contoso.com
                        - johnsteam@contoso.com
                    storageAccountType:
                      value: Standard_LRS
                  provisioningState: succeed
                  resourceGroups:
                    storageRG:
                      location: eastus
                      name: defaultRG
                type: Microsoft.Blueprint/Assignment
    put:
      description: Create or update a blueprint assignment.
      operationId: Assignments_CreateOrUpdate
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ScopeParameter"
        - $ref: "#/parameters/AssignmentNameParameter"
        - description: Blueprint assignment object to save.
          in: body
          name: assignment
          required: true
          schema:
            $ref: "#/definitions/Assignment"
      responses:
        "201":
          description: Created -- blueprint assignment saved.
          schema:
            $ref: "#/definitions/Assignment"
      tags:
        - Assignment
      x-ms-examples:
        Assignment with system-assigned managed identity:
          parameters:
            api-version: 2017-11-11-preview
            assignment:
              identity:
                type: SystemAssigned
              location: eastus
              properties:
                blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                parameters:
                  costCenter:
                    value: Contoso/Online/Shopping/Production
                  owners:
                    value:
                      - johnDoe@contoso.com
                      - johnsteam@contoso.com
                  storageAccountType:
                    value: Standard_LRS
                resourceGroups:
                  storageRG:
                    location: eastus
                    name: defaultRG
            assignmentName: assignSimpleBlueprint
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "201":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint
                identity:
                  principalId: 00000000-0000-0000-0000-000000000000
                  tenantId: 00000000-0000-0000-0000-000000000000
                  type: SystemAssigned
                location: eastus
                name: assignSimpleBlueprint
                properties:
                  blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                  description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                  parameters:
                    costCenter:
                      value: Contoso/Online/Shopping/Production
                    owners:
                      value:
                        - johnDoe@contoso.com
                        - johnsteam@contoso.com
                    storageAccountType:
                      value: Standard_LRS
                  provisioningState: creating
                  resourceGroups:
                    storageRG:
                      location: eastus
                      name: defaultRG
                type: Microsoft.Blueprint/Assignment
        Assignment with user-assigned managed identity:
          parameters:
            api-version: 2017-11-11-preview
            assignment:
              identity:
                type: UserAssigned
                userAssignedIdentities:
                  /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity: {}
              location: eastus
              properties:
                blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                parameters:
                  costCenter:
                    value: Contoso/Online/Shopping/Production
                  owners:
                    value:
                      - johnDoe@contoso.com
                      - johnsteam@contoso.com
                  storageAccountType:
                    value: Standard_LRS
                resourceGroups:
                  storageRG:
                    location: eastus
                    name: defaultRG
            assignmentName: assignSimpleBlueprint
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "201":
              body:
                id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint
                identity:
                  tenantId: 00000000-0000-0000-0000-000000000000
                  type: UserAssigned
                  userAssignedIdentities:
                    /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity:
                      clientId: 00000000-0000-0000-0000-000000000000
                      principalId: 00000000-0000-0000-0000-000000000000
                location: eastus
                name: assignSimpleBlueprint
                properties:
                  blueprintId: /providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint
                  description: enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.
                  parameters:
                    costCenter:
                      value: Contoso/Online/Shopping/Production
                    owners:
                      value:
                        - johnDoe@contoso.com
                        - johnsteam@contoso.com
                    storageAccountType:
                      value: Standard_LRS
                  provisioningState: creating
                  resourceGroups:
                    storageRG:
                      location: eastus
                      name: defaultRG
                type: Microsoft.Blueprint/Assignment
  "/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/WhoIsBlueprint":
    post:
      description: Get Blueprints service SPN objectId
      operationId: Assignments_WhoIsBlueprint
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/ScopeParameter"
        - $ref: "#/parameters/AssignmentNameParameter"
      responses:
        "200":
          description: Blueprints service SPN objectId
          schema:
            $ref: "#/definitions/WhoIsBlueprintContract"
      x-ms-examples:
        WhoIsBlueprint_Action:
          parameters:
            api-version: 2018-11-01-preview
            assignmentName: assignSimpleBlueprint
            scope: subscriptions/00000000-0000-0000-0000-000000000000
          responses:
            "200":
              body:
                objectId: 00000000-1111-0000-1111-000000000000
definitions:
  Assignment:
    allOf:
      - $ref: "#/definitions/TrackedResource"
    description: Represents a blueprint assignment.
    properties:
      identity:
        $ref: "#/definitions/ManagedServiceIdentity"
        description: Managed identity for this blueprint assignment.
      properties:
        $ref: "#/definitions/AssignmentProperties"
        description: Properties for blueprint assignment object.
        x-ms-client-flatten: true
    required:
      - identity
      - properties
    type: object
  AssignmentList:
    description: List of blueprint assignments
    properties:
      nextLink:
        description: Link to the next page of results.
        readOnly: true
        type: string
      value:
        description: List of blueprint assignments.
        items:
          $ref: "#/definitions/Assignment"
        type: array
    type: object
  AssignmentLockSettings:
    description: Defines how resources deployed by a blueprint assignment are locked.
    properties:
      excludedPrincipals:
        description: List of AAD principals excluded from blueprint locks. Up to 5 principals are permitted.
        items:
          type: string
        type: array
      mode:
        description: Lock mode.
        enum:
          - None
          - AllResourcesReadOnly
          - AllResourcesDoNotDelete
        type: string
        x-ms-enum:
          modelAsString: true
          name: AssignmentLockMode
    type: object
  AssignmentProperties:
    allOf:
      - $ref: "#/definitions/BlueprintResourcePropertiesBase"
    description: Detailed properties for a blueprint assignment.
    properties:
      blueprintId:
        description: ID of the published version of a blueprint definition.
        type: string
      locks:
        $ref: "#/definitions/AssignmentLockSettings"
        description: Defines how resources deployed by a blueprint assignment are locked.
      parameters:
        $ref: "#/definitions/ParameterValueCollection"
        description: Blueprint assignment parameter values.
      provisioningState:
        description: State of the blueprint assignment.
        enum:
          - creating
          - validating
          - waiting
          - deploying
          - cancelling
          - locking
          - succeeded
          - failed
          - canceled
          - deleting
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: AssignmentProvisioningState
      resourceGroups:
        $ref: "#/definitions/ResourceGroupValueCollection"
        description: Names and locations of resource group placeholders.
      status:
        $ref: "#/definitions/AssignmentStatus"
        description: Status of blueprint assignment. This field is readonly.
        readOnly: true
    required:
      - parameters
      - resourceGroups
    type: object
  AssignmentStatus:
    allOf:
      - $ref: "#/definitions/BlueprintResourceStatusBase"
    description: The status of a blueprint assignment. This field is readonly.
    properties:
      managedResources:
        description: List of resources that were created by the blueprint assignment.
        items:
          type: string
        readOnly: true
        type: array
    type: object
  AzureResourceBase:
    description: Common properties for all Azure resources.
    properties:
      id:
        description: String Id used to locate any resource on Azure.
        readOnly: true
        type: string
      name:
        description: Name of this resource.
        readOnly: true
        type: string
      type:
        description: Type of this resource.
        readOnly: true
        type: string
    type: object
    x-ms-azure-resource: true
  BlueprintResourcePropertiesBase:
    description: Shared properties between all blueprint resources.
    properties:
      description:
        description: Multi-line explain this resource.
        maxLength: 500
        type: string
      displayName:
        description: One-liner string explain this resource.
        maxLength: 256
        type: string
    type: object
    x-ms-external: true
  BlueprintResourceStatusBase:
    description: Shared status properties between all blueprint resources.
    properties:
      lastModified:
        description: Last modified time of this blueprint definition.
        format: date-time
        readOnly: true
        type: string
      timeCreated:
        description: Creation time of this blueprint definition.
        format: date-time
        readOnly: true
        type: string
    type: object
  ManagedServiceIdentity:
    description: Managed identity generic object.
    properties:
      principalId:
        description: Azure Active Directory principal ID associated with this Identity.
        type: string
      tenantId:
        description: ID of the Azure Active Directory.
        type: string
      type:
        description: Type of the managed identity.
        enum:
          - None
          - SystemAssigned
          - UserAssigned
        type: string
        x-ms-enum:
          modelAsString: true
          name: ManagedServiceIdentityType
      userAssignedIdentities:
        additionalProperties:
          $ref: "#/definitions/UserAssignedIdentity"
          description: User-assigned managed identity.
        description: The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed identity.
        type: object
    required:
      - type
    type: object
  ParameterValue:
    description: Value for the specified parameter. Can be either 'value' or 'reference' but not both.
    properties:
      reference:
        $ref: "#/definitions/SecretValueReference"
        description: Parameter value as reference type.
      value:
        description: Parameter value as value type.
    type: object
  ParameterValueCollection:
    additionalProperties:
      $ref: "#/definitions/ParameterValue"
      description: Key/Value pair of parameter fulfillment.
    description: A dictionary for parameters and their corresponding values.
    properties: {}
    type: object
  ResourceGroupValue:
    description: Represents an Azure resource group.
    properties:
      location:
        description: Location of the resource group.
        type: string
      name:
        description: Name of the resource group.
        maxLength: 90
        minLength: 1
        type: string
    type: object
  ResourceGroupValueCollection:
    additionalProperties:
      $ref: "#/definitions/ResourceGroupValue"
    description: A dictionary which maps resource group placeholders to the resource groups which will be created.
    properties: {}
    type: object
  SecretValueReference:
    description: Reference to a Key Vault secret.
    properties:
      keyVault:
        $ref: "#/definitions/keyVaultReference"
        description: Specifies the reference to a given Azure Key Vault.
      secretName:
        description: Name of the secret.
        type: string
      secretVersion:
        description: The version of the secret to use. If left blank, the latest version of the secret is used.
        type: string
    required:
      - keyVault
      - secretName
    type: object
  TrackedResource:
    allOf:
      - $ref: "#/definitions/AzureResourceBase"
    description: Common properties for all Azure tracked resources.
    properties:
      location:
        description: The location of this blueprint assignment.
        type: string
        x-ms-mutability:
          - read
          - create
    required:
      - location
    type: object
  UserAssignedIdentity:
    description: User-assigned managed identity.
    properties:
      clientId:
        description: Client App Id associated with this identity.
        type: string
      principalId:
        description: Azure Active Directory principal ID associated with this Identity.
        type: string
    type: object
  WhoIsBlueprintContract:
    description: Response schema for querying the Azure Blueprints service principal in the tenant.
    properties:
      objectId:
        description: AAD object Id of the Azure Blueprints service principal in the tenant.
        type: string
  keyVaultReference:
    description: Specifies the link to a Key Vault.
    properties:
      id:
        description: Azure resource ID of the Key Vault.
        type: string
    required:
      - id
    type: object
