Variablegroups - Get Variable Groups

Get variable groups.

GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/variablegroups?api-version=5.0-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/variablegroups?groupName={groupName}&actionFilter={actionFilter}&$top={$top}&continuationToken={continuationToken}&queryOrder={queryOrder}&api-version=5.0-preview.1

URI Parameters

Name In Required Type Description
organization
path True
  • string

The name of the Azure DevOps organization.

project
path True
  • string

Project ID or project name

api-version
query True
  • string

Version of the API to use. This should be set to '5.0-preview.1' to use this version of the api.

$top
query
  • integer
int32

Number of variable groups to get.

actionFilter
query

Action filter for the variable group. It specifies the action which can be performed on the variable groups.

continuationToken
query
  • integer
int32

Gets the variable groups after the continuation token provided.

groupName
query
  • string

Name of variable group.

queryOrder
query

Gets the results in the defined order. Default is 'IdDescending'.

Responses

Name Type Description
200 OK

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.variablegroups_read Grants the ability to read variable groups

Examples

Get variable groups using action filter
Get variable groups using group name filter

Get variable groups using action filter

Sample Request

GET https://dev.azure.com/fabrikam/DGDemo/_apis/distributedtask/variablegroups?actionFilter=Use&$top=2&continuationToken=2&queryOrder=IdAscending&api-version=5.0-preview.1

Sample Response

{
  "count": 2,
  "value": [
    {
      "variables": {
        "key1": {
          "value": "value1"
        }
      },
      "id": 2,
      "type": "Vsts",
      "name": "TestVariableGroup2",
      "description": "A test variable group",
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
      },
      "createdOn": "2017-12-12T06:35:52.08Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
      },
      "modifiedOn": "2017-12-12T06:35:52.08Z"
    },
    {
      "variables": {
        "key1": {
          "value": "value1"
        }
      },
      "id": 3,
      "type": "Vsts",
      "name": "TestVariableGroup3",
      "description": "A test variable group",
      "createdBy": {
        "id": "9acfc89e-2530-636e-8f2f-1940a029363b",
        "displayName": "msft 3",
        "uniqueName": "msft3@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/9acfc89e-2530-636e-8f2f-1940a029363b",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=9acfc89e-2530-636e-8f2f-1940a029363b"
      },
      "createdOn": "2017-12-12T06:35:52.24Z",
      "modifiedBy": {
        "id": "9acfc89e-2530-636e-8f2f-1940a029363b",
        "displayName": "msft 3",
        "uniqueName": "msft3@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/9acfc89e-2530-636e-8f2f-1940a029363b",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=9acfc89e-2530-636e-8f2f-1940a029363b"
      },
      "modifiedOn": "2017-12-12T06:35:52.24Z"
    }
  ]
}

Get variable groups using group name filter

Sample Request

GET https://dev.azure.com/fabrikam/DGDemo/_apis/distributedtask/variablegroups?groupName=Test*&queryOrder=IdDescending&api-version=5.0-preview.1

Sample Response

{
  "count": 2,
  "value": [
    {
      "variables": {
        "key1": {
          "value": "value1"
        }
      },
      "id": 2,
      "type": "Vsts",
      "name": "TestVariableGroup2",
      "description": "A test variable group",
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
      },
      "createdOn": "2017-12-12T06:35:52.08Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
      },
      "modifiedOn": "2017-12-12T06:35:52.08Z"
    },
    {
      "variables": {
        "key1": {
          "value": "value1"
        },
        "key2": {
          "value": null,
          "isSecret": true
        }
      },
      "id": 1,
      "type": "Vsts",
      "name": "TestVariableGroup1",
      "description": "Updated variable group",
      "createdBy": {
        "id": "9acfc89e-2530-636e-8f2f-1940a029363b",
        "displayName": "msft 3",
        "uniqueName": "msft3@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/9acfc89e-2530-636e-8f2f-1940a029363b",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=9acfc89e-2530-636e-8f2f-1940a029363b"
      },
      "createdOn": "2017-12-12T06:35:51.6933333Z",
      "modifiedBy": {
        "id": "9acfc89e-2530-636e-8f2f-1940a029363b",
        "displayName": "msft 3",
        "uniqueName": "msft3@outlook.com",
        "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/9acfc89e-2530-636e-8f2f-1940a029363b",
        "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=9acfc89e-2530-636e-8f2f-1940a029363b"
      },
      "modifiedOn": "2017-12-12T06:35:52.0166667Z"
    }
  ]
}

Definitions

IdentityRef
ReferenceLinks

The class to represent a collection of REST reference links.

VariableGroup

A variable group is a collection of related variables.

VariableGroupActionFilter

Action filter for the variable group. It specifies the action which can be performed on the variable groups.

VariableGroupProviderData

Defines provider data of the variable group.

VariableGroupQueryOrder

Gets the results in the defined order. Default is 'IdDescending'.

VariableValue

IdentityRef

Name Type Description
_links

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor
  • string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias
  • string
displayName
  • string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id
  • string
imageUrl
  • string
inactive
  • boolean
isAadIdentity
  • boolean
isContainer
  • boolean
isDeletedInOrigin
  • boolean
profileUrl
  • string
uniqueName
  • string
url
  • string

This url is the full route to the source resource of this graph subject.

The class to represent a collection of REST reference links.

Name Type Description
links
  • object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

VariableGroup

A variable group is a collection of related variables.

Name Type Description
createdBy

Gets or sets the identity who created the variable group.

createdOn
  • string

Gets or sets the time when variable group was created.

description
  • string

Gets or sets description of the variable group.

id
  • integer

Gets or sets id of the variable group.

isShared
  • boolean

Indicates whether variable group is shared with other projects or not.

modifiedBy

Gets or sets the identity who modified the variable group.

modifiedOn
  • string

Gets or sets the time when variable group was modified

name
  • string

Gets or sets name of the variable group.

providerData

Gets or sets provider data.

type
  • string

Gets or sets type of the variable group.

variables

Gets or sets variables contained in the variable group.

VariableGroupActionFilter

Action filter for the variable group. It specifies the action which can be performed on the variable groups.

Name Type Description
manage
  • string
none
  • string
use
  • string

VariableGroupProviderData

Defines provider data of the variable group.

VariableGroupQueryOrder

Gets the results in the defined order. Default is 'IdDescending'.

Name Type Description
idAscending
  • string

Order by id ascending.

idDescending
  • string

Order by id descending.

VariableValue

Name Type Description
isSecret
  • boolean
value
  • string