Projects - Create

Projects_Create
Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates).

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}?api-version=2017-11-01-preview
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.visualstudio/account/{rootResourceName}/project/{resourceName}?api-version=2017-11-01-preview&validating={validating}

URI Parameters

Name In Required Type Description
resourceGroupName
path True
  • string

Name of the resource group within the Azure subscription.

resourceName
path True
  • string

Name of the Team Services project.

rootResourceName
path True
  • string

Name of the Team Services account.

subscriptionId
path True
  • string

The Azure subscription identifier.

api-version
query True
  • string

API Version

validating
query
  • string

This parameter is ignored and should be set to an empty string.

Request Body

Name Type Description
kind

Kind of project resource

location
  • string

Resource location.

properties.bootstrapPipelineTemplate

Template used to configure a bootstrap pipeline in the VSTS project.

properties.ownerUpn
  • string

Optional UPN of the owner, on-behalf-of whom the project is being created.

properties.processTemplateId

Process template to use in the project.

properties.versionControlOption

Version control to use for the default repo created in the project.

tags
  • object

Resource tags.

Responses

Name Type Description
200 OK

The operation succeeded. The response contains the details of the created or updated team project resource.

202 Accepted

The operation succeeded. A job to create the team project resource has been queued. The URI to monitor the status of the job is provided in the 'location' header.

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

Create a project resource

Sample Request

PUT https://management.azure.com/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject?api-version=2017-11-01-preview
{
  "id": "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/Microsoft.VisualStudio/account/ExampleAccount/project/ExampleProject",
  "name": "ExampleProject",
  "type": "Microsoft.VisualStudio/account/project",
  "location": "Central US",
  "tags": {},
  "properties": {
    "processTemplateId": "Scrum",
    "versionControlOption": "Git",
    "bootstrapPipelineTemplate": {
      "applicationSource": {
        "sourceType": "CodeTemplate",
        "applicationType": "NodeJs",
        "applicationConfiguration": {
          "nodeJsVersion": "8.5.0"
        }
      },
      "applicationTarget": {
        "targetType": "WindowsAppService",
        "resources": [
          {
            "id": "/subscriptions/ea99dfc9-1597-48ed-85f6-9bf922591395/resourceGroups/testrg/providers/Microsoft.Web/sites/MyWebSite",
            "role": "AppService"
          }
        ]
      },
      "authorizationDetails": {
        "azure": {
          "authorizationType": "authorizationToken",
          "parameters": {
            "token": "AAD_Access_Token_For_VSTS_Resource"
          }
        }
      }
    }
  }
}

Sample Response

{
  "id": "/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject",
  "name": "ExampleProject",
  "type": "microsoft.visualstudio/account/project",
  "location": "North Central US",
  "tags": {},
  "kind": "bootstrappedProject",
  "properties": {
    "processTemplateId": "Scrum",
    "versionControlOption": "Git",
    "tfsUniqueIdentifier": "vstfs:///Classification/TeamProject/7a4e6ba5-35bf-4667-86a4-9b598a88fa25",
    "bootstrapPipelineTemplate": {
      "applicationSource": {
        "sourceType": "CodeTemplate",
        "applicationType": "NodeJs",
        "applicationConfiguration": {
          "nodeJsVersion": "8.5.0"
        }
      },
      "applicationTarget": {
        "targetType": "WindowsAppService",
        "resources": [
          {
            "id": "/subscriptions/ea99dfc9-1597-48ed-85f6-9bf922591395/resourceGroups/testrg/providers/Microsoft.Web/sites/MyWebSite",
            "role": "AppService"
          }
        ]
      },
      "authorizationDetails": {}
    }
  }
}
location: https://management.azure.com/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/microsoft.visualstudio/account/ExampleAccount/project/ExampleProject/subContainers/ExampleProject/status/?api-version=2017-11-01-preview&jobId=126167d2-d710-4b5d-80a8-a1d58717142d&operation=put
retry-after: 5

Definitions

ApplicationTarget

Defines the target resources for a VSTS pipeline.

ApplicationTargetType

Type of target.

ApplicationType

Type of application.

Authorization

Defines the authorization type and its parameters.

AuthorizationType

Type of authorization.

CodeRepository

Defines a code repository.

CodeRepositoryApplicationSource

Defines the source application, when it resides in a code repository.

CodeRepositoryType

Type of code repository.

CodeTemplateApplicationSource

Defines the source application template.

PipelineTemplate

Defines a VSTS pipeline template.

ProcessTemplate

Process template to use in the project.

ProjectResource

A Visual Studio Team Services project resource.

ProjectResourceKind

Kind of project resource

TargetResource

Defines a single resource used as target for a VSTS pipeline.

VersionControlOption

Version control to use for the default repo created in the project.

ApplicationTarget

Defines the target resources for a VSTS pipeline.

Name Type Description
resources

List of target resources.

targetType

Type of target.

ApplicationTargetType

Type of target.

Name Type Description
WindowsAppService
  • string

ApplicationType

Type of application.

Name Type Description
AspDotNet
  • string
AspDotNetCore
  • string
NodeJs
  • string

Authorization

Defines the authorization type and its parameters.

Name Type Description
authorizationType

Type of authorization.

parameters
  • object

Authorization parameters corresponding to the authorization type.

AuthorizationType

Type of authorization.

Name Type Description
authorizationToken
  • string
personalAccessToken
  • string

CodeRepository

Defines a code repository.

Name Type Description
authorizationReference
  • string

Reference to the authorization info used to access the code repository. This value is used as a key into the global authorization details dictionary.

defaultBranch
  • string

Default branch for which continuous integration should be configured in the VSTS pipeline.

id
  • string

Unique identifier of the code repository.

properties
  • object

Repository-specific properties.

repositoryType

Type of code repository.

CodeRepositoryApplicationSource

Defines the source application, when it resides in a code repository.

Name Type Description
applicationConfiguration
  • object

Application specific properties.

applicationType

Type of application.

repository

Code repository where the application source resides.

sourceType string:

Type of application source.

CodeRepositoryType

Type of code repository.

Name Type Description
gitHub
  • string
vstsGit
  • string

CodeTemplateApplicationSource

Defines the source application template.

Name Type Description
applicationConfiguration
  • object

Application specific properties.

applicationType

Type of application.

sourceType string:
  • CodeTemplate

Type of application source.

PipelineTemplate

Defines a VSTS pipeline template.

Name Type Description
applicationSource ApplicationSource:

Source application for the VSTS pipeline.

applicationTarget

Target resources for the VSTS pipeline.

authorizationDetails

Global dictionary of authorization details used by the pipeline, with a friendly name as key. Individual resource in the pipeline can reference to a specific authorization info using the friendly name.

ProcessTemplate

Process template to use in the project.

Name Type Description
Agile
  • string
Cmmi
  • string
Scrum
  • string

ProjectResource

A Visual Studio Team Services project resource.

Name Type Description
id
  • string

Unique identifier of the resource.

kind

Kind of project resource

location
  • string

Resource location.

name
  • string

Resource name.

properties.bootstrapPipelineTemplate

Template used to configure a bootstrap pipeline in the VSTS project.

properties.ownerUpn
  • string

Optional UPN of the owner, on-behalf-of whom the project is being created.

properties.processTemplateId

Process template to use in the project.

properties.tfsUniqueIdentifier
  • string

Unique identifier of the VSTS project.

properties.versionControlOption

Version control to use for the default repo created in the project.

tags
  • object

Resource tags.

type
  • string

Resource type.

ProjectResourceKind

Kind of project resource

Name Type Description
bootstrappedProject
  • string
project
  • string

TargetResource

Defines a single resource used as target for a VSTS pipeline.

Name Type Description
authorizationReference
  • string

Reference to the authorization info used to access the target resource. This value is used as a key into the global authorization details dictionary.

id
  • string

Unique identifier of the target resource.

role
  • string

Role of the target resource.

VersionControlOption

Version control to use for the default repo created in the project.

Name Type Description
Git
  • string
Tfvc
  • string