swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Azure Blueprint Client.
  title: BlueprintClient
  version: 2017-11-11-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/2017-11-11-preview/blueprintAssignment.json
      version: "2.0"
  x-preferred: false
  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 assignment.
    in: path
    name: assignmentName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: azure subscriptionId, which we assign the blueprint to.
    in: path
    name: subscriptionId
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments":
    get:
      description: List Blueprint assignments within a subscription.
      operationId: Assignments_List
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: OK - all Blueprint assignment retrieved.
          schema:
            $ref: "#/definitions/AssignmentList"
      tags:
        - Assignment
      x-ms-examples:
        Assignment:
          parameters:
            api-version: 2017-11-11-preview
            subscriptionId: 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
  "/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}":
    delete:
      description: Delete a Blueprint assignment.
      operationId: Assignments_Delete
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $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
            subscriptionId: 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/SubscriptionIdParameter"
        - $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
            subscriptionId: 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/SubscriptionIdParameter"
        - $ref: "#/parameters/AssignmentNameParameter"
        - description: 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:
          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
            subscriptionId: 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
definitions:
  Assignment:
    allOf:
      - $ref: "#/definitions/TrackedResource"
    description: Represents a Blueprint assignment.
    properties:
      identity:
        $ref: "#/definitions/ManagedServiceIdentity"
        description: Managed Service Identity for this Blueprint assignment
      properties:
        $ref: "#/definitions/AssignmentProperties"
        description: Properties for 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 Blueprint-managed resources will be locked.
    properties:
      mode:
        description: Lock mode.
        enum:
          - None
          - AllResources
        type: string
        x-ms-enum:
          modelAsString: true
          name: AssignmentLockMode
    type: object
  AssignmentProperties:
    allOf:
      - $ref: "#/definitions/BlueprintResourcePropertiesBase"
    description: Detailed properties for Assignment.
    properties:
      blueprintId:
        description: ID of the Blueprint definition resource.
        type: string
      locks:
        $ref: "#/definitions/AssignmentLockSettings"
        description: Defines how Blueprint-managed resources will be locked.
      parameters:
        $ref: "#/definitions/ParameterValueCollection"
        description: Blueprint parameter values.
      provisioningState:
        description: State of the 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 Blueprint assignment. This field is readonly.
    properties: {}
    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.
        readOnly: true
        type: string
      timeCreated:
        description: Creation time of this blueprint.
        readOnly: true
        type: string
    type: object
  ManagedServiceIdentity:
    description: Managed Service Identity
    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 Service Identity.
        enum:
          - None
          - SystemAssigned
          - UserAssigned
        type: string
        x-ms-enum:
          modelAsString: true
          name: ManagedServiceIdentityType
    required:
      - type
    type: object
  ParameterValue:
    allOf:
      - $ref: "#/definitions/ParameterValueBase"
    description: Value for the specified parameter.
    properties:
      value:
        description: actual value.
    required:
      - value
    type: object
  ParameterValueBase:
    description: Base class for ParameterValue.
    properties:
      description:
        description: Optional property, just to establish ParameterValueBase as a BaseClass.
        type: string
    type: object
  ParameterValueCollection:
    additionalProperties:
      $ref: "#/definitions/ParameterValueBase"
      description: keyValue 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
  SecretReferenceParameterValue:
    allOf:
      - $ref: "#/definitions/ParameterValueBase"
    description: The reference to a secret, if the parameter should be protected.
    properties:
      reference:
        $ref: "#/definitions/SecretValueReference"
        description: Specifies the reference.
    required:
      - reference
    type: object
  SecretValueReference:
    description: Reference to a KeyVault secret.
    properties:
      keyVault:
        $ref: "#/definitions/keyVaultReference"
        description: Specifies the reference to a given Azure KeyVault.
      secretName:
        description: Name of the secret.
        type: string
      secretVersion:
        description: Version of the secret, (if there are multiple versions)
        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
  keyVaultReference:
    description: Specifies the link to a KeyVault.
    properties:
      id:
        description: Azure resource ID of the KeyVault.
        type: string
    required:
      - id
    type: object
