1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. ServiceEndpointNpm
Azure DevOps v3.9.0 published on Tuesday, Apr 22, 2025 by Pulumi

azuredevops.ServiceEndpointNpm

Explore with Pulumi AI

Manages a NPM service endpoint within Azure DevOps.

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 exampleServiceEndpointNpm = new azuredevops.ServiceEndpointNpm("example", {
    projectId: example.id,
    serviceEndpointName: "Example npm",
    url: "https://registry.npmjs.org",
    accessToken: "00000000-0000-0000-0000-000000000000",
    description: "Managed by Pulumi",
});
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_npm = azuredevops.ServiceEndpointNpm("example",
    project_id=example.id,
    service_endpoint_name="Example npm",
    url="https://registry.npmjs.org",
    access_token="00000000-0000-0000-0000-000000000000",
    description="Managed by Pulumi")
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
		}
		_, err = azuredevops.NewServiceEndpointNpm(ctx, "example", &azuredevops.ServiceEndpointNpmArgs{
			ProjectId:           example.ID(),
			ServiceEndpointName: pulumi.String("Example npm"),
			Url:                 pulumi.String("https://registry.npmjs.org"),
			AccessToken:         pulumi.String("00000000-0000-0000-0000-000000000000"),
			Description:         pulumi.String("Managed by Pulumi"),
		})
		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 exampleServiceEndpointNpm = new AzureDevOps.ServiceEndpointNpm("example", new()
    {
        ProjectId = example.Id,
        ServiceEndpointName = "Example npm",
        Url = "https://registry.npmjs.org",
        AccessToken = "00000000-0000-0000-0000-000000000000",
        Description = "Managed by Pulumi",
    });

});
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.ServiceEndpointNpm;
import com.pulumi.azuredevops.ServiceEndpointNpmArgs;
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 exampleServiceEndpointNpm = new ServiceEndpointNpm("exampleServiceEndpointNpm", ServiceEndpointNpmArgs.builder()
            .projectId(example.id())
            .serviceEndpointName("Example npm")
            .url("https://registry.npmjs.org")
            .accessToken("00000000-0000-0000-0000-000000000000")
            .description("Managed by Pulumi")
            .build());

    }
}
Copy
resources:
  example:
    type: azuredevops:Project
    properties:
      name: Example Project
      visibility: private
      versionControl: Git
      workItemTemplate: Agile
      description: Managed by Pulumi
  exampleServiceEndpointNpm:
    type: azuredevops:ServiceEndpointNpm
    name: example
    properties:
      projectId: ${example.id}
      serviceEndpointName: Example npm
      url: https://registry.npmjs.org
      accessToken: 00000000-0000-0000-0000-000000000000
      description: Managed by Pulumi
Copy

Create ServiceEndpointNpm Resource

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

Constructor syntax

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

@overload
def ServiceEndpointNpm(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       access_token: Optional[str] = None,
                       project_id: Optional[str] = None,
                       service_endpoint_name: Optional[str] = None,
                       url: Optional[str] = None,
                       description: Optional[str] = None)
func NewServiceEndpointNpm(ctx *Context, name string, args ServiceEndpointNpmArgs, opts ...ResourceOption) (*ServiceEndpointNpm, error)
public ServiceEndpointNpm(string name, ServiceEndpointNpmArgs args, CustomResourceOptions? opts = null)
public ServiceEndpointNpm(String name, ServiceEndpointNpmArgs args)
public ServiceEndpointNpm(String name, ServiceEndpointNpmArgs args, CustomResourceOptions options)
type: azuredevops:ServiceEndpointNpm
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. ServiceEndpointNpmArgs
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. ServiceEndpointNpmArgs
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. ServiceEndpointNpmArgs
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. ServiceEndpointNpmArgs
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. ServiceEndpointNpmArgs
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 serviceEndpointNpmResource = new AzureDevOps.ServiceEndpointNpm("serviceEndpointNpmResource", new()
{
    AccessToken = "string",
    ProjectId = "string",
    ServiceEndpointName = "string",
    Url = "string",
    Description = "string",
});
Copy
example, err := azuredevops.NewServiceEndpointNpm(ctx, "serviceEndpointNpmResource", &azuredevops.ServiceEndpointNpmArgs{
	AccessToken:         pulumi.String("string"),
	ProjectId:           pulumi.String("string"),
	ServiceEndpointName: pulumi.String("string"),
	Url:                 pulumi.String("string"),
	Description:         pulumi.String("string"),
})
Copy
var serviceEndpointNpmResource = new ServiceEndpointNpm("serviceEndpointNpmResource", ServiceEndpointNpmArgs.builder()
    .accessToken("string")
    .projectId("string")
    .serviceEndpointName("string")
    .url("string")
    .description("string")
    .build());
Copy
service_endpoint_npm_resource = azuredevops.ServiceEndpointNpm("serviceEndpointNpmResource",
    access_token="string",
    project_id="string",
    service_endpoint_name="string",
    url="string",
    description="string")
Copy
const serviceEndpointNpmResource = new azuredevops.ServiceEndpointNpm("serviceEndpointNpmResource", {
    accessToken: "string",
    projectId: "string",
    serviceEndpointName: "string",
    url: "string",
    description: "string",
});
Copy
type: azuredevops:ServiceEndpointNpm
properties:
    accessToken: string
    description: string
    projectId: string
    serviceEndpointName: string
    url: string
Copy

ServiceEndpointNpm 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 ServiceEndpointNpm resource accepts the following input properties:

AccessToken This property is required. string
The access token for npm registry.
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the project.
ServiceEndpointName This property is required. string
The Service Endpoint name.
Url This property is required. string
URL of the npm registry to connect with.
Description string
The Service Endpoint description.
AccessToken This property is required. string
The access token for npm registry.
ProjectId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the project.
ServiceEndpointName This property is required. string
The Service Endpoint name.
Url This property is required. string
URL of the npm registry to connect with.
Description string
The Service Endpoint description.
accessToken This property is required. String
The access token for npm registry.
projectId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the project.
serviceEndpointName This property is required. String
The Service Endpoint name.
url This property is required. String
URL of the npm registry to connect with.
description String
The Service Endpoint description.
accessToken This property is required. string
The access token for npm registry.
projectId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the project.
serviceEndpointName This property is required. string
The Service Endpoint name.
url This property is required. string
URL of the npm registry to connect with.
description string
The Service Endpoint description.
access_token This property is required. str
The access token for npm registry.
project_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the project.
service_endpoint_name This property is required. str
The Service Endpoint name.
url This property is required. str
URL of the npm registry to connect with.
description str
The Service Endpoint description.
accessToken This property is required. String
The access token for npm registry.
projectId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the project.
serviceEndpointName This property is required. String
The Service Endpoint name.
url This property is required. String
URL of the npm registry to connect with.
description String
The Service Endpoint description.

Outputs

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

Authorization Dictionary<string, string>
Id string
The provider-assigned unique ID for this managed resource.
Authorization map[string]string
Id string
The provider-assigned unique ID for this managed resource.
authorization Map<String,String>
id String
The provider-assigned unique ID for this managed resource.
authorization {[key: string]: string}
id string
The provider-assigned unique ID for this managed resource.
authorization Mapping[str, str]
id str
The provider-assigned unique ID for this managed resource.
authorization Map<String>
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ServiceEndpointNpm Resource

Get an existing ServiceEndpointNpm 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?: ServiceEndpointNpmState, opts?: CustomResourceOptions): ServiceEndpointNpm
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_token: Optional[str] = None,
        authorization: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        project_id: Optional[str] = None,
        service_endpoint_name: Optional[str] = None,
        url: Optional[str] = None) -> ServiceEndpointNpm
func GetServiceEndpointNpm(ctx *Context, name string, id IDInput, state *ServiceEndpointNpmState, opts ...ResourceOption) (*ServiceEndpointNpm, error)
public static ServiceEndpointNpm Get(string name, Input<string> id, ServiceEndpointNpmState? state, CustomResourceOptions? opts = null)
public static ServiceEndpointNpm get(String name, Output<String> id, ServiceEndpointNpmState state, CustomResourceOptions options)
resources:  _:    type: azuredevops:ServiceEndpointNpm    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:
AccessToken string
The access token for npm registry.
Authorization Dictionary<string, string>
Description string
The Service Endpoint description.
ProjectId Changes to this property will trigger replacement. string
The ID of the project.
ServiceEndpointName string
The Service Endpoint name.
Url string
URL of the npm registry to connect with.
AccessToken string
The access token for npm registry.
Authorization map[string]string
Description string
The Service Endpoint description.
ProjectId Changes to this property will trigger replacement. string
The ID of the project.
ServiceEndpointName string
The Service Endpoint name.
Url string
URL of the npm registry to connect with.
accessToken String
The access token for npm registry.
authorization Map<String,String>
description String
The Service Endpoint description.
projectId Changes to this property will trigger replacement. String
The ID of the project.
serviceEndpointName String
The Service Endpoint name.
url String
URL of the npm registry to connect with.
accessToken string
The access token for npm registry.
authorization {[key: string]: string}
description string
The Service Endpoint description.
projectId Changes to this property will trigger replacement. string
The ID of the project.
serviceEndpointName string
The Service Endpoint name.
url string
URL of the npm registry to connect with.
access_token str
The access token for npm registry.
authorization Mapping[str, str]
description str
The Service Endpoint description.
project_id Changes to this property will trigger replacement. str
The ID of the project.
service_endpoint_name str
The Service Endpoint name.
url str
URL of the npm registry to connect with.
accessToken String
The access token for npm registry.
authorization Map<String>
description String
The Service Endpoint description.
projectId Changes to this property will trigger replacement. String
The ID of the project.
serviceEndpointName String
The Service Endpoint name.
url String
URL of the npm registry to connect with.

Import

Azure DevOps NPM Service Endpoint can be imported using the projectID/serviceEndpointID, e.g.

$ pulumi import azuredevops:index/serviceEndpointNpm:ServiceEndpointNpm example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

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