1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. ConnectionServicePrincipal

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.automation.ConnectionServicePrincipal

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Manages an Automation Connection with type AzureServicePrincipal.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as std from "@pulumi/std";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("example", {
        name: "resourceGroup-example",
        location: "West Europe",
    });
    const example = azure.core.getClientConfig({});
    const exampleAccount = new azure.automation.Account("example", {
        name: "account-example",
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        skuName: "Basic",
    });
    const exampleConnectionServicePrincipal = new azure.automation.ConnectionServicePrincipal("example", {
        name: "connection-example",
        resourceGroupName: exampleResourceGroup.name,
        automationAccountName: exampleAccount.name,
        applicationId: "00000000-0000-0000-0000-000000000000",
        tenantId: example.then(example => example.tenantId),
        subscriptionId: example.then(example => example.subscriptionId),
        certificateThumbprint: std.file({
            input: "automation_certificate_test.thumb",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_azure as azure
    import pulumi_std as std
    
    example_resource_group = azure.core.ResourceGroup("example",
        name="resourceGroup-example",
        location="West Europe")
    example = azure.core.get_client_config()
    example_account = azure.automation.Account("example",
        name="account-example",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        sku_name="Basic")
    example_connection_service_principal = azure.automation.ConnectionServicePrincipal("example",
        name="connection-example",
        resource_group_name=example_resource_group.name,
        automation_account_name=example_account.name,
        application_id="00000000-0000-0000-0000-000000000000",
        tenant_id=example.tenant_id,
        subscription_id=example.subscription_id,
        certificate_thumbprint=std.file(input="automation_certificate_test.thumb").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("resourceGroup-example"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		example, err := core.GetClientConfig(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
    			Name:              pulumi.String("account-example"),
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			SkuName:           pulumi.String("Basic"),
    		})
    		if err != nil {
    			return err
    		}
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "automation_certificate_test.thumb",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = automation.NewConnectionServicePrincipal(ctx, "example", &automation.ConnectionServicePrincipalArgs{
    			Name:                  pulumi.String("connection-example"),
    			ResourceGroupName:     exampleResourceGroup.Name,
    			AutomationAccountName: exampleAccount.Name,
    			ApplicationId:         pulumi.String("00000000-0000-0000-0000-000000000000"),
    			TenantId:              pulumi.String(example.TenantId),
    			SubscriptionId:        pulumi.String(example.SubscriptionId),
    			CertificateThumbprint: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "resourceGroup-example",
            Location = "West Europe",
        });
    
        var example = Azure.Core.GetClientConfig.Invoke();
    
        var exampleAccount = new Azure.Automation.Account("example", new()
        {
            Name = "account-example",
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            SkuName = "Basic",
        });
    
        var exampleConnectionServicePrincipal = new Azure.Automation.ConnectionServicePrincipal("example", new()
        {
            Name = "connection-example",
            ResourceGroupName = exampleResourceGroup.Name,
            AutomationAccountName = exampleAccount.Name,
            ApplicationId = "00000000-0000-0000-0000-000000000000",
            TenantId = example.Apply(getClientConfigResult => getClientConfigResult.TenantId),
            SubscriptionId = example.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId),
            CertificateThumbprint = Std.File.Invoke(new()
            {
                Input = "automation_certificate_test.thumb",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.core.CoreFunctions;
    import com.pulumi.azure.automation.Account;
    import com.pulumi.azure.automation.AccountArgs;
    import com.pulumi.azure.automation.ConnectionServicePrincipal;
    import com.pulumi.azure.automation.ConnectionServicePrincipalArgs;
    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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
                .name("resourceGroup-example")
                .location("West Europe")
                .build());
    
            final var example = CoreFunctions.getClientConfig();
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
                .name("account-example")
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .skuName("Basic")
                .build());
    
            var exampleConnectionServicePrincipal = new ConnectionServicePrincipal("exampleConnectionServicePrincipal", ConnectionServicePrincipalArgs.builder()        
                .name("connection-example")
                .resourceGroupName(exampleResourceGroup.name())
                .automationAccountName(exampleAccount.name())
                .applicationId("00000000-0000-0000-0000-000000000000")
                .tenantId(example.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                .subscriptionId(example.applyValue(getClientConfigResult -> getClientConfigResult.subscriptionId()))
                .certificateThumbprint(StdFunctions.file(FileArgs.builder()
                    .input("automation_certificate_test.thumb")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        name: example
        properties:
          name: resourceGroup-example
          location: West Europe
      exampleAccount:
        type: azure:automation:Account
        name: example
        properties:
          name: account-example
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          skuName: Basic
      exampleConnectionServicePrincipal:
        type: azure:automation:ConnectionServicePrincipal
        name: example
        properties:
          name: connection-example
          resourceGroupName: ${exampleResourceGroup.name}
          automationAccountName: ${exampleAccount.name}
          applicationId: 00000000-0000-0000-0000-000000000000
          tenantId: ${example.tenantId}
          subscriptionId: ${example.subscriptionId}
          certificateThumbprint:
            fn::invoke:
              Function: std:file
              Arguments:
                input: automation_certificate_test.thumb
              Return: result
    variables:
      example:
        fn::invoke:
          Function: azure:core:getClientConfig
          Arguments: {}
    

    Create ConnectionServicePrincipal Resource

    new ConnectionServicePrincipal(name: string, args: ConnectionServicePrincipalArgs, opts?: CustomResourceOptions);
    @overload
    def ConnectionServicePrincipal(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   application_id: Optional[str] = None,
                                   automation_account_name: Optional[str] = None,
                                   certificate_thumbprint: Optional[str] = None,
                                   description: Optional[str] = None,
                                   name: Optional[str] = None,
                                   resource_group_name: Optional[str] = None,
                                   subscription_id: Optional[str] = None,
                                   tenant_id: Optional[str] = None)
    @overload
    def ConnectionServicePrincipal(resource_name: str,
                                   args: ConnectionServicePrincipalArgs,
                                   opts: Optional[ResourceOptions] = None)
    func NewConnectionServicePrincipal(ctx *Context, name string, args ConnectionServicePrincipalArgs, opts ...ResourceOption) (*ConnectionServicePrincipal, error)
    public ConnectionServicePrincipal(string name, ConnectionServicePrincipalArgs args, CustomResourceOptions? opts = null)
    public ConnectionServicePrincipal(String name, ConnectionServicePrincipalArgs args)
    public ConnectionServicePrincipal(String name, ConnectionServicePrincipalArgs args, CustomResourceOptions options)
    
    type: azure:automation:ConnectionServicePrincipal
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ConnectionServicePrincipalArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConnectionServicePrincipalArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConnectionServicePrincipalArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConnectionServicePrincipalArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConnectionServicePrincipalArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ConnectionServicePrincipal Resource Properties

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

    Inputs

    The ConnectionServicePrincipal resource accepts the following input properties:

    ApplicationId string
    The (Client) ID of the Service Principal.
    AutomationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    CertificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    ResourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    SubscriptionId string
    The subscription GUID.
    TenantId string
    The ID of the Tenant the Service Principal is assigned in.
    Description string
    A description for this Connection.
    Name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    ApplicationId string
    The (Client) ID of the Service Principal.
    AutomationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    CertificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    ResourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    SubscriptionId string
    The subscription GUID.
    TenantId string
    The ID of the Tenant the Service Principal is assigned in.
    Description string
    A description for this Connection.
    Name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    applicationId String
    The (Client) ID of the Service Principal.
    automationAccountName String
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint String
    The thumbprint of the Service Principal Certificate.
    resourceGroupName String
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId String
    The subscription GUID.
    tenantId String
    The ID of the Tenant the Service Principal is assigned in.
    description String
    A description for this Connection.
    name String
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    applicationId string
    The (Client) ID of the Service Principal.
    automationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    resourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId string
    The subscription GUID.
    tenantId string
    The ID of the Tenant the Service Principal is assigned in.
    description string
    A description for this Connection.
    name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    application_id str
    The (Client) ID of the Service Principal.
    automation_account_name str
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificate_thumbprint str
    The thumbprint of the Service Principal Certificate.
    resource_group_name str
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscription_id str
    The subscription GUID.
    tenant_id str
    The ID of the Tenant the Service Principal is assigned in.
    description str
    A description for this Connection.
    name str
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    applicationId String
    The (Client) ID of the Service Principal.
    automationAccountName String
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint String
    The thumbprint of the Service Principal Certificate.
    resourceGroupName String
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId String
    The subscription GUID.
    tenantId String
    The ID of the Tenant the Service Principal is assigned in.
    description String
    A description for this Connection.
    name String
    Specifies the name of the Connection. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ConnectionServicePrincipal 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 ConnectionServicePrincipal Resource

    Get an existing ConnectionServicePrincipal 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?: ConnectionServicePrincipalState, opts?: CustomResourceOptions): ConnectionServicePrincipal
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_id: Optional[str] = None,
            automation_account_name: Optional[str] = None,
            certificate_thumbprint: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            subscription_id: Optional[str] = None,
            tenant_id: Optional[str] = None) -> ConnectionServicePrincipal
    func GetConnectionServicePrincipal(ctx *Context, name string, id IDInput, state *ConnectionServicePrincipalState, opts ...ResourceOption) (*ConnectionServicePrincipal, error)
    public static ConnectionServicePrincipal Get(string name, Input<string> id, ConnectionServicePrincipalState? state, CustomResourceOptions? opts = null)
    public static ConnectionServicePrincipal get(String name, Output<String> id, ConnectionServicePrincipalState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    ApplicationId string
    The (Client) ID of the Service Principal.
    AutomationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    CertificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    Description string
    A description for this Connection.
    Name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    SubscriptionId string
    The subscription GUID.
    TenantId string
    The ID of the Tenant the Service Principal is assigned in.
    ApplicationId string
    The (Client) ID of the Service Principal.
    AutomationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    CertificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    Description string
    A description for this Connection.
    Name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    SubscriptionId string
    The subscription GUID.
    TenantId string
    The ID of the Tenant the Service Principal is assigned in.
    applicationId String
    The (Client) ID of the Service Principal.
    automationAccountName String
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint String
    The thumbprint of the Service Principal Certificate.
    description String
    A description for this Connection.
    name String
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId String
    The subscription GUID.
    tenantId String
    The ID of the Tenant the Service Principal is assigned in.
    applicationId string
    The (Client) ID of the Service Principal.
    automationAccountName string
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint string
    The thumbprint of the Service Principal Certificate.
    description string
    A description for this Connection.
    name string
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId string
    The subscription GUID.
    tenantId string
    The ID of the Tenant the Service Principal is assigned in.
    application_id str
    The (Client) ID of the Service Principal.
    automation_account_name str
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificate_thumbprint str
    The thumbprint of the Service Principal Certificate.
    description str
    A description for this Connection.
    name str
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscription_id str
    The subscription GUID.
    tenant_id str
    The ID of the Tenant the Service Principal is assigned in.
    applicationId String
    The (Client) ID of the Service Principal.
    automationAccountName String
    The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
    certificateThumbprint String
    The thumbprint of the Service Principal Certificate.
    description String
    A description for this Connection.
    name String
    Specifies the name of the Connection. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
    subscriptionId String
    The subscription GUID.
    tenantId String
    The ID of the Tenant the Service Principal is assigned in.

    Import

    Automation Connection can be imported using the resource id, e.g.

    $ pulumi import azure:automation/connectionServicePrincipal:ConnectionServicePrincipal conn1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1
    

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi