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
Relevant Links
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:
- Azurerm
Spn stringTenantid The tenant id if the service principal.
- Azurerm
Subscription stringId The subscription Id of the Azure targets.
- Azurerm
Subscription stringName The subscription Name of the targets.
- Project
Id string The project ID or project name.
- Service
Endpoint stringName The Service Endpoint name.
- Dictionary<string, string>
- Credentials
Pulumi.
Azure Dev Ops. Service Endpoint. Inputs. Azure RMCredentials Args A
credentialsblock.- Description string
- Resource
Group string The resource group used for scope of automatic service endpoint.
- Azurerm
Spn stringTenantid The tenant id if the service principal.
- Azurerm
Subscription stringId The subscription Id of the Azure targets.
- Azurerm
Subscription stringName The subscription Name of the targets.
- Project
Id string The project ID or project name.
- Service
Endpoint stringName The Service Endpoint name.
- map[string]string
- Credentials
Azure
RMCredentials A
credentialsblock.- Description string
- Resource
Group string The resource group used for scope of automatic service endpoint.
- azurerm
Spn stringTenantid The tenant id if the service principal.
- azurerm
Subscription stringId The subscription Id of the Azure targets.
- azurerm
Subscription stringName The subscription Name of the targets.
- project
Id string The project ID or project name.
- service
Endpoint stringName The Service Endpoint name.
- {[key: string]: string}
- credentials
Azure
RMCredentials A
credentialsblock.- description string
- resource
Group string The resource group used for scope of automatic service endpoint.
- azurerm_
spn_ strtenantid The tenant id if the service principal.
- azurerm_
subscription_ strid The subscription Id of the Azure targets.
- azurerm_
subscription_ strname The subscription Name of the targets.
- project_
id str The project ID or project name.
- service_
endpoint_ strname The Service Endpoint name.
- Dict[str, str]
- credentials
Dict[Azure
RMCredentials] A
credentialsblock.- 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:
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): AzureRMstatic 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:
- Dictionary<string, string>
- Azurerm
Spn stringTenantid The tenant id if the service principal.
- Azurerm
Subscription stringId The subscription Id of the Azure targets.
- Azurerm
Subscription stringName The subscription Name of the targets.
- Credentials
Pulumi.
Azure Dev Ops. Service Endpoint. Inputs. Azure RMCredentials Args A
credentialsblock.- Description string
- Project
Id string The project ID or project name.
- Resource
Group string The resource group used for scope of automatic service endpoint.
- Service
Endpoint stringName The Service Endpoint name.
- map[string]string
- Azurerm
Spn stringTenantid The tenant id if the service principal.
- Azurerm
Subscription stringId The subscription Id of the Azure targets.
- Azurerm
Subscription stringName The subscription Name of the targets.
- Credentials
Azure
RMCredentials A
credentialsblock.- Description string
- Project
Id string The project ID or project name.
- Resource
Group string The resource group used for scope of automatic service endpoint.
- Service
Endpoint stringName The Service Endpoint name.
- {[key: string]: string}
- azurerm
Spn stringTenantid The tenant id if the service principal.
- azurerm
Subscription stringId The subscription Id of the Azure targets.
- azurerm
Subscription stringName The subscription Name of the targets.
- credentials
Azure
RMCredentials A
credentialsblock.- description string
- project
Id string The project ID or project name.
- resource
Group string The resource group used for scope of automatic service endpoint.
- service
Endpoint stringName The Service Endpoint name.
- Dict[str, str]
- azurerm_
spn_ strtenantid The tenant id if the service principal.
- azurerm_
subscription_ strid The subscription Id of the Azure targets.
- azurerm_
subscription_ strname The subscription Name of the targets.
- credentials
Dict[Azure
RMCredentials] A
credentialsblock.- 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_ strname The Service Endpoint name.
Supporting Types
AzureRMCredentials
- Serviceprincipalid string
The service principal application Id
- Serviceprincipalkey string
The service principal secret.
- Serviceprincipalkey
Hash string
- Serviceprincipalid string
The service principal application Id
- Serviceprincipalkey string
The service principal secret.
- Serviceprincipalkey
Hash string
- serviceprincipalid string
The service principal application Id
- serviceprincipalkey string
The service principal secret.
- serviceprincipalkey
Hash string
- serviceprincipalid str
The service principal application Id
- serviceprincipalkey str
The service principal secret.
- serviceprincipalkey
Hash str
Package Details
- Repository
- https://github.com/pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevopsTerraform Provider.