1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. ResourceAuthorization
Azure DevOps v3.8.0 published on Monday, Mar 17, 2025 by Pulumi

azuredevops.ResourceAuthorization

Explore with Pulumi AI

Manages authorization of resources, e.g. for access in build pipelines.

Currently supported resources: service endpoint (aka service connection, endpoint).

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const example = new azuredevops.Project("example", {
    name: "Example Project",
    visibility: "private",
    versionControl: "Git",
    workItemTemplate: "Agile",
    description: "Managed by Pulumi",
});
const exampleServiceEndpointBitBucket = new azuredevops.ServiceEndpointBitBucket("example", {
    projectId: example.id,
    username: "username",
    password: "password",
    serviceEndpointName: "example-bitbucket",
    description: "Managed by Pulumi",
});
const exampleResourceAuthorization = new azuredevops.ResourceAuthorization("example", {
    projectId: example.id,
    resourceId: exampleServiceEndpointBitBucket.id,
    authorized: true,
});
Copy
import pulumi
import pulumi_azuredevops as azuredevops

example = azuredevops.Project("example",
    name="Example Project",
    visibility="private",
    version_control="Git",
    work_item_template="Agile",
    description="Managed by Pulumi")
example_service_endpoint_bit_bucket = azuredevops.ServiceEndpointBitBucket("example",
    project_id=example.id,
    username="username",
    password="password",
    service_endpoint_name="example-bitbucket",
    description="Managed by Pulumi")
example_resource_authorization = azuredevops.ResourceAuthorization("example",
    project_id=example.id,
    resource_id=example_service_endpoint_bit_bucket.id,
    authorized=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
			Name:             pulumi.String("Example Project"),
			Visibility:       pulumi.String("private"),
			VersionControl:   pulumi.String("Git"),
			WorkItemTemplate: pulumi.String("Agile"),
			Description:      pulumi.String("Managed by Pulumi"),
		})
		if err != nil {
			return err
		}
		exampleServiceEndpointBitBucket, err := azuredevops.NewServiceEndpointBitBucket(ctx, "example", &azuredevops.ServiceEndpointBitBucketArgs{
			ProjectId:           example.ID(),
			Username:            pulumi.String("username"),
			Password:            pulumi.String("password"),
			ServiceEndpointName: pulumi.String("example-bitbucket"),
			Description:         pulumi.String("Managed by Pulumi"),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewResourceAuthorization(ctx, "example", &azuredevops.ResourceAuthorizationArgs{
			ProjectId:  example.ID(),
			ResourceId: exampleServiceEndpointBitBucket.ID(),
			Authorized: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var example = new AzureDevOps.Project("example", new()
    {
        Name = "Example Project",
        Visibility = "private",
        VersionControl = "Git",
        WorkItemTemplate = "Agile",
        Description = "Managed by Pulumi",
    });

    var exampleServiceEndpointBitBucket = new AzureDevOps.ServiceEndpointBitBucket("example", new()
    {
        ProjectId = example.Id,
        Username = "username",
        Password = "password",
        ServiceEndpointName = "example-bitbucket",
        Description = "Managed by Pulumi",
    });

    var exampleResourceAuthorization = new AzureDevOps.ResourceAuthorization("example", new()
    {
        ProjectId = example.Id,
        ResourceId = exampleServiceEndpointBitBucket.Id,
        Authorized = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Project;
import com.pulumi.azuredevops.ProjectArgs;
import com.pulumi.azuredevops.ServiceEndpointBitBucket;
import com.pulumi.azuredevops.ServiceEndpointBitBucketArgs;
import com.pulumi.azuredevops.ResourceAuthorization;
import com.pulumi.azuredevops.ResourceAuthorizationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Project("example", ProjectArgs.builder()
            .name("Example Project")
            .visibility("private")
            .versionControl("Git")
            .workItemTemplate("Agile")
            .description("Managed by Pulumi")
            .build());

        var exampleServiceEndpointBitBucket = new ServiceEndpointBitBucket("exampleServiceEndpointBitBucket", ServiceEndpointBitBucketArgs.builder()
            .projectId(example.id())
            .username("username")
            .password("password")
            .serviceEndpointName("example-bitbucket")
            .description("Managed by Pulumi")
            .build());

        var exampleResourceAuthorization = new ResourceAuthorization("exampleResourceAuthorization", ResourceAuthorizationArgs.builder()
            .projectId(example.id())
            .resourceId(exampleServiceEndpointBitBucket.id())
            .authorized(true)
            .build());

    }
}
Copy
resources:
  example:
    type: azuredevops:Project
    properties:
      name: Example Project
      visibility: private
      versionControl: Git
      workItemTemplate: Agile
      description: Managed by Pulumi
  exampleServiceEndpointBitBucket:
    type: azuredevops:ServiceEndpointBitBucket
    name: example
    properties:
      projectId: ${example.id}
      username: username
      password: password
      serviceEndpointName: example-bitbucket
      description: Managed by Pulumi
  exampleResourceAuthorization:
    type: azuredevops:ResourceAuthorization
    name: example
    properties:
      projectId: ${example.id}
      resourceId: ${exampleServiceEndpointBitBucket.id}
      authorized: true
Copy

Create ResourceAuthorization Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ResourceAuthorization(name: string, args: ResourceAuthorizationArgs, opts?: CustomResourceOptions);
@overload
def ResourceAuthorization(resource_name: str,
                          args: ResourceAuthorizationArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def ResourceAuthorization(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          authorized: Optional[bool] = None,
                          project_id: Optional[str] = None,
                          resource_id: Optional[str] = None,
                          definition_id: Optional[int] = None,
                          type: Optional[str] = None)
func NewResourceAuthorization(ctx *Context, name string, args ResourceAuthorizationArgs, opts ...ResourceOption) (*ResourceAuthorization, error)
public ResourceAuthorization(string name, ResourceAuthorizationArgs args, CustomResourceOptions? opts = null)
public ResourceAuthorization(String name, ResourceAuthorizationArgs args)
public ResourceAuthorization(String name, ResourceAuthorizationArgs args, CustomResourceOptions options)
type: azuredevops:ResourceAuthorization
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ResourceAuthorizationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ResourceAuthorizationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ResourceAuthorizationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ResourceAuthorizationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ResourceAuthorizationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var resourceAuthorizationResource = new AzureDevOps.ResourceAuthorization("resourceAuthorizationResource", new()
{
    Authorized = false,
    ProjectId = "string",
    ResourceId = "string",
    DefinitionId = 0,
    Type = "string",
});
Copy
example, err := azuredevops.NewResourceAuthorization(ctx, "resourceAuthorizationResource", &azuredevops.ResourceAuthorizationArgs{
	Authorized:   pulumi.Bool(false),
	ProjectId:    pulumi.String("string"),
	ResourceId:   pulumi.String("string"),
	DefinitionId: pulumi.Int(0),
	Type:         pulumi.String("string"),
})
Copy
var resourceAuthorizationResource = new ResourceAuthorization("resourceAuthorizationResource", ResourceAuthorizationArgs.builder()
    .authorized(false)
    .projectId("string")
    .resourceId("string")
    .definitionId(0)
    .type("string")
    .build());
Copy
resource_authorization_resource = azuredevops.ResourceAuthorization("resourceAuthorizationResource",
    authorized=False,
    project_id="string",
    resource_id="string",
    definition_id=0,
    type="string")
Copy
const resourceAuthorizationResource = new azuredevops.ResourceAuthorization("resourceAuthorizationResource", {
    authorized: false,
    projectId: "string",
    resourceId: "string",
    definitionId: 0,
    type: "string",
});
Copy
type: azuredevops:ResourceAuthorization
properties:
    authorized: false
    definitionId: 0
    projectId: string
    resourceId: string
    type: string
Copy

ResourceAuthorization Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ResourceAuthorization resource accepts the following input properties:

Authorized This property is required. bool
Set to true to allow public access in the project.
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The project ID or project name.
ResourceId This property is required. string
The ID of the resource to authorize.
DefinitionId int
The ID of the build definition to authorize.
Type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
Authorized This property is required. bool
Set to true to allow public access in the project.
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The project ID or project name.
ResourceId This property is required. string
The ID of the resource to authorize.
DefinitionId int
The ID of the build definition to authorize.
Type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized This property is required. Boolean
Set to true to allow public access in the project.
projectId
This property is required.
Changes to this property will trigger replacement.
String
The project ID or project name.
resourceId This property is required. String
The ID of the resource to authorize.
definitionId Integer
The ID of the build definition to authorize.
type String
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized This property is required. boolean
Set to true to allow public access in the project.
projectId
This property is required.
Changes to this property will trigger replacement.
string
The project ID or project name.
resourceId This property is required. string
The ID of the resource to authorize.
definitionId number
The ID of the build definition to authorize.
type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized This property is required. bool
Set to true to allow public access in the project.
project_id
This property is required.
Changes to this property will trigger replacement.
str
The project ID or project name.
resource_id This property is required. str
The ID of the resource to authorize.
definition_id int
The ID of the build definition to authorize.
type str
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized This property is required. Boolean
Set to true to allow public access in the project.
projectId
This property is required.
Changes to this property will trigger replacement.
String
The project ID or project name.
resourceId This property is required. String
The ID of the resource to authorize.
definitionId Number
The ID of the build definition to authorize.
type String
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.

Outputs

All input properties are implicitly available as output properties. Additionally, the ResourceAuthorization resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ResourceAuthorization Resource

Get an existing ResourceAuthorization resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ResourceAuthorizationState, opts?: CustomResourceOptions): ResourceAuthorization
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authorized: Optional[bool] = None,
        definition_id: Optional[int] = None,
        project_id: Optional[str] = None,
        resource_id: Optional[str] = None,
        type: Optional[str] = None) -> ResourceAuthorization
func GetResourceAuthorization(ctx *Context, name string, id IDInput, state *ResourceAuthorizationState, opts ...ResourceOption) (*ResourceAuthorization, error)
public static ResourceAuthorization Get(string name, Input<string> id, ResourceAuthorizationState? state, CustomResourceOptions? opts = null)
public static ResourceAuthorization get(String name, Output<String> id, ResourceAuthorizationState state, CustomResourceOptions options)
resources:  _:    type: azuredevops:ResourceAuthorization    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Authorized bool
Set to true to allow public access in the project.
DefinitionId int
The ID of the build definition to authorize.
ProjectId Changes to this property will trigger replacement. string
The project ID or project name.
ResourceId string
The ID of the resource to authorize.
Type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
Authorized bool
Set to true to allow public access in the project.
DefinitionId int
The ID of the build definition to authorize.
ProjectId Changes to this property will trigger replacement. string
The project ID or project name.
ResourceId string
The ID of the resource to authorize.
Type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized Boolean
Set to true to allow public access in the project.
definitionId Integer
The ID of the build definition to authorize.
projectId Changes to this property will trigger replacement. String
The project ID or project name.
resourceId String
The ID of the resource to authorize.
type String
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized boolean
Set to true to allow public access in the project.
definitionId number
The ID of the build definition to authorize.
projectId Changes to this property will trigger replacement. string
The project ID or project name.
resourceId string
The ID of the resource to authorize.
type string
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized bool
Set to true to allow public access in the project.
definition_id int
The ID of the build definition to authorize.
project_id Changes to this property will trigger replacement. str
The project ID or project name.
resource_id str
The ID of the resource to authorize.
type str
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.
authorized Boolean
Set to true to allow public access in the project.
definitionId Number
The ID of the build definition to authorize.
projectId Changes to this property will trigger replacement. String
The project ID or project name.
resourceId String
The ID of the resource to authorize.
type String
The type of the resource to authorize. Possible values: endpoint, queue, variablegroup. Defaults to value: endpoint.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.