AzureRM

Manages Manual or Automatic AzureRM service endpoint within Azure DevOps.

Requirements (Manual AzureRM Service Endpoint)

Before to create a service end point in Azure DevOps, you need to create a Service Principal in your Azure subscription.

For detailed steps to create a service principal with Azure cli see the documentation

Example Usage

Manual AzureRM Service Endpoint

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var project = new AzureDevOps.Core.Project("project", new AzureDevOps.Core.ProjectArgs
        {
            ProjectName = "Sample Project",
            Visibility = "private",
            VersionControl = "Git",
            WorkItemTemplate = "Agile",
        });
        var endpointazure = new AzureDevOps.ServiceEndpoint.AzureRM("endpointazure", new AzureDevOps.ServiceEndpoint.AzureRMArgs
        {
            ProjectId = project.Id,
            ServiceEndpointName = "TestServiceRM",
            Credentials = new AzureDevOps.ServiceEndpoint.Inputs.AzureRMCredentialsArgs
            {
                Serviceprincipalid = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
                Serviceprincipalkey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            },
            AzurermSpnTenantid = "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
            AzurermSubscriptionId = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
            AzurermSubscriptionName = "Sample Subscription",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Core"
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/ServiceEndpoint"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        project, err := Core.NewProject(ctx, "project", &Core.ProjectArgs{
            ProjectName:      pulumi.String("Sample Project"),
            Visibility:       pulumi.String("private"),
            VersionControl:   pulumi.String("Git"),
            WorkItemTemplate: pulumi.String("Agile"),
        })
        if err != nil {
            return err
        }
        endpointazure, err := ServiceEndpoint.NewAzureRM(ctx, "endpointazure", &ServiceEndpoint.AzureRMArgs{
            ProjectId:           project.ID(),
            ServiceEndpointName: pulumi.String("TestServiceRM"),
            Credentials: &ServiceEndpoint.AzureRMCredentialsArgs{
                Serviceprincipalid:  pulumi.String("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"),
                Serviceprincipalkey: pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
            },
            AzurermSpnTenantid:      pulumi.String("xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx"),
            AzurermSubscriptionId:   pulumi.String("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"),
            AzurermSubscriptionName: pulumi.String("Sample Subscription"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

project = azuredevops.core.Project("project",
    project_name="Sample Project",
    visibility="private",
    version_control="Git",
    work_item_template="Agile")
endpointazure = azuredevops.service_endpoint.AzureRM("endpointazure",
    project_id=project.id,
    service_endpoint_name="TestServiceRM",
    credentials={
        "serviceprincipalid": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
        "serviceprincipalkey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    },
    azurerm_spn_tenantid="xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
    azurerm_subscription_id="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
    azurerm_subscription_name="Sample Subscription")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const project = new azuredevops.Core.Project("project", {
    projectName: "Sample Project",
    visibility: "private",
    versionControl: "Git",
    workItemTemplate: "Agile",
});
const endpointazure = new azuredevops.ServiceEndpoint.AzureRM("endpointazure", {
    projectId: project.id,
    serviceEndpointName: "TestServiceRM",
    credentials: {
        serviceprincipalid: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
        serviceprincipalkey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    },
    azurermSpnTenantid: "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
    azurermSubscriptionId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
    azurermSubscriptionName: "Sample Subscription",
});

Automatic AzureRM Service Endpoint

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var project = new AzureDevOps.Core.Project("project", new AzureDevOps.Core.ProjectArgs
        {
            ProjectName = "Sample Project",
            Visibility = "private",
            VersionControl = "Git",
            WorkItemTemplate = "Agile",
        });
        var endpointazure = new AzureDevOps.ServiceEndpoint.AzureRM("endpointazure", new AzureDevOps.ServiceEndpoint.AzureRMArgs
        {
            ProjectId = project.Id,
            ServiceEndpointName = "TestServiceRM",
            AzurermSpnTenantid = "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
            AzurermSubscriptionId = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
            AzurermSubscriptionName = "Microsoft Azure DEMO",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Core"
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/ServiceEndpoint"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        project, err := Core.NewProject(ctx, "project", &Core.ProjectArgs{
            ProjectName:      pulumi.String("Sample Project"),
            Visibility:       pulumi.String("private"),
            VersionControl:   pulumi.String("Git"),
            WorkItemTemplate: pulumi.String("Agile"),
        })
        if err != nil {
            return err
        }
        endpointazure, err := ServiceEndpoint.NewAzureRM(ctx, "endpointazure", &ServiceEndpoint.AzureRMArgs{
            ProjectId:               project.ID(),
            ServiceEndpointName:     pulumi.String("TestServiceRM"),
            AzurermSpnTenantid:      pulumi.String("xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx"),
            AzurermSubscriptionId:   pulumi.String("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"),
            AzurermSubscriptionName: pulumi.String("Microsoft Azure DEMO"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

project = azuredevops.core.Project("project",
    project_name="Sample Project",
    visibility="private",
    version_control="Git",
    work_item_template="Agile")
endpointazure = azuredevops.service_endpoint.AzureRM("endpointazure",
    project_id=project.id,
    service_endpoint_name="TestServiceRM",
    azurerm_spn_tenantid="xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
    azurerm_subscription_id="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
    azurerm_subscription_name="Microsoft Azure DEMO")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const project = new azuredevops.Core.Project("project", {
    projectName: "Sample Project",
    visibility: "private",
    versionControl: "Git",
    workItemTemplate: "Agile",
});
const endpointazure = new azuredevops.ServiceEndpoint.AzureRM("endpointazure", {
    projectId: project.id,
    serviceEndpointName: "TestServiceRM",
    azurermSpnTenantid: "xxxxxxx-xxxx-xxx-xxxxx-xxxxxxxx",
    azurermSubscriptionId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
    azurermSubscriptionName: "Microsoft Azure DEMO",
});

Create a AzureRM Resource

new AzureRM(name: string, args: AzureRMArgs, opts?: CustomResourceOptions);
def AzureRM(resource_name, opts=None, authorization=None, azurerm_spn_tenantid=None, azurerm_subscription_id=None, azurerm_subscription_name=None, credentials=None, description=None, project_id=None, resource_group=None, service_endpoint_name=None, __props__=None);
func NewAzureRM(ctx *Context, name string, args AzureRMArgs, opts ...ResourceOption) (*AzureRM, error)
public AzureRM(string name, AzureRMArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AzureRMArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AzureRMArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AzureRMArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AzureRM Resource Properties

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

Inputs

The AzureRM resource accepts the following input properties:

AzurermSpnTenantid string

The tenant id if the service principal.

AzurermSubscriptionId string

The subscription Id of the Azure targets.

AzurermSubscriptionName string

The subscription Name of the targets.

ProjectId string

The project ID or project name.

ServiceEndpointName string

The Service Endpoint name.

Authorization Dictionary<string, string>
Credentials Pulumi.AzureDevOps.ServiceEndpoint.Inputs.AzureRMCredentialsArgs

A credentials block.

Description string
ResourceGroup string

The resource group used for scope of automatic service endpoint.

AzurermSpnTenantid string

The tenant id if the service principal.

AzurermSubscriptionId string

The subscription Id of the Azure targets.

AzurermSubscriptionName string

The subscription Name of the targets.

ProjectId string

The project ID or project name.

ServiceEndpointName string

The Service Endpoint name.

Authorization map[string]string
Credentials AzureRMCredentials

A credentials block.

Description string
ResourceGroup string

The resource group used for scope of automatic service endpoint.

azurermSpnTenantid string

The tenant id if the service principal.

azurermSubscriptionId string

The subscription Id of the Azure targets.

azurermSubscriptionName string

The subscription Name of the targets.

projectId string

The project ID or project name.

serviceEndpointName string

The Service Endpoint name.

authorization {[key: string]: string}
credentials AzureRMCredentials

A credentials block.

description string
resourceGroup string

The resource group used for scope of automatic service endpoint.

azurerm_spn_tenantid str

The tenant id if the service principal.

azurerm_subscription_id str

The subscription Id of the Azure targets.

azurerm_subscription_name str

The subscription Name of the targets.

project_id str

The project ID or project name.

service_endpoint_name str

The Service Endpoint name.

authorization Dict[str, str]
credentials Dict[AzureRMCredentials]

A credentials block.

description str
resource_group str

The resource group used for scope of automatic service endpoint.

Outputs

All input properties are implicitly available as output properties. Additionally, the AzureRM 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing AzureRM Resource

Get an existing AzureRM 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?: AzureRMState, opts?: CustomResourceOptions): AzureRM
static get(resource_name, id, opts=None, authorization=None, azurerm_spn_tenantid=None, azurerm_subscription_id=None, azurerm_subscription_name=None, credentials=None, description=None, project_id=None, resource_group=None, service_endpoint_name=None, __props__=None);
func GetAzureRM(ctx *Context, name string, id IDInput, state *AzureRMState, opts ...ResourceOption) (*AzureRM, error)
public static AzureRM Get(string name, Input<string> id, AzureRMState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

Authorization Dictionary<string, string>
AzurermSpnTenantid string

The tenant id if the service principal.

AzurermSubscriptionId string

The subscription Id of the Azure targets.

AzurermSubscriptionName string

The subscription Name of the targets.

Credentials Pulumi.AzureDevOps.ServiceEndpoint.Inputs.AzureRMCredentialsArgs

A credentials block.

Description string
ProjectId string

The project ID or project name.

ResourceGroup string

The resource group used for scope of automatic service endpoint.

ServiceEndpointName string

The Service Endpoint name.

Authorization map[string]string
AzurermSpnTenantid string

The tenant id if the service principal.

AzurermSubscriptionId string

The subscription Id of the Azure targets.

AzurermSubscriptionName string

The subscription Name of the targets.

Credentials AzureRMCredentials

A credentials block.

Description string
ProjectId string

The project ID or project name.

ResourceGroup string

The resource group used for scope of automatic service endpoint.

ServiceEndpointName string

The Service Endpoint name.

authorization {[key: string]: string}
azurermSpnTenantid string

The tenant id if the service principal.

azurermSubscriptionId string

The subscription Id of the Azure targets.

azurermSubscriptionName string

The subscription Name of the targets.

credentials AzureRMCredentials

A credentials block.

description string
projectId string

The project ID or project name.

resourceGroup string

The resource group used for scope of automatic service endpoint.

serviceEndpointName string

The Service Endpoint name.

authorization Dict[str, str]
azurerm_spn_tenantid str

The tenant id if the service principal.

azurerm_subscription_id str

The subscription Id of the Azure targets.

azurerm_subscription_name str

The subscription Name of the targets.

credentials Dict[AzureRMCredentials]

A credentials block.

description str
project_id str

The project ID or project name.

resource_group str

The resource group used for scope of automatic service endpoint.

service_endpoint_name str

The Service Endpoint name.

Supporting Types

AzureRMCredentials

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Serviceprincipalid string

The service principal application Id

Serviceprincipalkey string

The service principal secret.

ServiceprincipalkeyHash string
Serviceprincipalid string

The service principal application Id

Serviceprincipalkey string

The service principal secret.

ServiceprincipalkeyHash string
serviceprincipalid string

The service principal application Id

serviceprincipalkey string

The service principal secret.

serviceprincipalkeyHash string
serviceprincipalid str

The service principal application Id

serviceprincipalkey str

The service principal secret.

serviceprincipalkeyHash str

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.