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

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages an Automation Certificate.

    Example Usage

    using System;
    using System.IO;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
    	private static string ReadFileBase64(string path) {
    		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
    	}
    
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleAccount = new Azure.Automation.Account("exampleAccount", new Azure.Automation.AccountArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                SkuName = "Basic",
            });
            var exampleCertificate = new Azure.Automation.Certificate("exampleCertificate", new Azure.Automation.CertificateArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                AutomationAccountName = exampleAccount.Name,
                Description = "This is an example certificate",
                Base64 = ReadFileBase64("certificate.pfx"),
                Exportable = true,
            });
        }
    
    }
    
    package main
    
    import (
    	"encoding/base64"
    	"io/ioutil"
    
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/automation"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func filebase64OrPanic(path string) pulumi.StringPtrInput {
    	if fileData, err := ioutil.ReadFile(path); err == nil {
    		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
    	} else {
    		panic(err.Error())
    	}
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			SkuName:           pulumi.String("Basic"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = automation.NewCertificate(ctx, "exampleCertificate", &automation.CertificateArgs{
    			ResourceGroupName:     exampleResourceGroup.Name,
    			AutomationAccountName: exampleAccount.Name,
    			Description:           pulumi.String("This is an example certificate"),
    			Base64:                filebase64OrPanic("certificate.pfx"),
    			Exportable:            pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * from "fs";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleAccount = new azure.automation.Account("exampleAccount", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        skuName: "Basic",
    });
    const exampleCertificate = new azure.automation.Certificate("exampleCertificate", {
        resourceGroupName: exampleResourceGroup.name,
        automationAccountName: exampleAccount.name,
        description: "This is an example certificate",
        base64: Buffer.from(fs.readFileSync("certificate.pfx"), 'binary').toString('base64'),
        exportable: true,
    });
    
    import pulumi
    import base64
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_account = azure.automation.Account("exampleAccount",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        sku_name="Basic")
    example_certificate = azure.automation.Certificate("exampleCertificate",
        resource_group_name=example_resource_group.name,
        automation_account_name=example_account.name,
        description="This is an example certificate",
        base64=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"),
        exportable=True)
    

    Example coming soon!

    Create Certificate Resource

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

    Constructor syntax

    new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
    @overload
    def Certificate(resource_name: str,
                    args: CertificateArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Certificate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    automation_account_name: Optional[str] = None,
                    base64: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    description: Optional[str] = None,
                    exportable: Optional[bool] = None,
                    name: Optional[str] = None)
    func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
    public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
    public Certificate(String name, CertificateArgs args)
    public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
    
    type: azure:automation:Certificate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CertificateArgs
    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 CertificateArgs
    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 CertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateArgs
    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 examplecertificateResourceResourceFromAutomationcertificate = new Azure.Automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate", new()
    {
        AutomationAccountName = "string",
        Base64 = "string",
        ResourceGroupName = "string",
        Description = "string",
        Exportable = false,
        Name = "string",
    });
    
    example, err := automation.NewCertificate(ctx, "examplecertificateResourceResourceFromAutomationcertificate", &automation.CertificateArgs{
    	AutomationAccountName: pulumi.String("string"),
    	Base64:                pulumi.String("string"),
    	ResourceGroupName:     pulumi.String("string"),
    	Description:           pulumi.String("string"),
    	Exportable:            pulumi.Bool(false),
    	Name:                  pulumi.String("string"),
    })
    
    var examplecertificateResourceResourceFromAutomationcertificate = new com.pulumi.azure.automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate", com.pulumi.azure.automation.CertificateArgs.builder()
        .automationAccountName("string")
        .base64("string")
        .resourceGroupName("string")
        .description("string")
        .exportable(false)
        .name("string")
        .build());
    
    examplecertificate_resource_resource_from_automationcertificate = azure.automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate",
        automation_account_name="string",
        base64="string",
        resource_group_name="string",
        description="string",
        exportable=False,
        name="string")
    
    const examplecertificateResourceResourceFromAutomationcertificate = new azure.automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate", {
        automationAccountName: "string",
        base64: "string",
        resourceGroupName: "string",
        description: "string",
        exportable: false,
        name: "string",
    });
    
    type: azure:automation:Certificate
    properties:
        automationAccountName: string
        base64: string
        description: string
        exportable: false
        name: string
        resourceGroupName: string
    

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

    AutomationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    Base64 string
    Base64 encoded value of the certificate.
    ResourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    Description string
    The description of this Automation Certificate.
    Exportable bool
    The is exportable flag of the certificate.
    Name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    AutomationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    Base64 string
    Base64 encoded value of the certificate.
    ResourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    Description string
    The description of this Automation Certificate.
    Exportable bool
    The is exportable flag of the certificate.
    Name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 String
    Base64 encoded value of the certificate.
    resourceGroupName String
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    description String
    The description of this Automation Certificate.
    exportable Boolean
    The is exportable flag of the certificate.
    name String
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    automationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 string
    Base64 encoded value of the certificate.
    resourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    description string
    The description of this Automation Certificate.
    exportable boolean
    The is exportable flag of the certificate.
    name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    automation_account_name str
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 str
    Base64 encoded value of the certificate.
    resource_group_name str
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    description str
    The description of this Automation Certificate.
    exportable bool
    The is exportable flag of the certificate.
    name str
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 String
    Base64 encoded value of the certificate.
    resourceGroupName String
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    description String
    The description of this Automation Certificate.
    exportable Boolean
    The is exportable flag of the certificate.
    name String
    Specifies the name of the Certificate. Changing this forces a new resource to be created.

    Outputs

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

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

    Look up Existing Certificate Resource

    Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            automation_account_name: Optional[str] = None,
            base64: Optional[str] = None,
            description: Optional[str] = None,
            exportable: Optional[bool] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            thumbprint: Optional[str] = None) -> Certificate
    func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
    public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
    public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
    resources:  _:    type: azure:automation:Certificate    get:      id: ${id}
    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:
    AutomationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    Base64 string
    Base64 encoded value of the certificate.
    Description string
    The description of this Automation Certificate.
    Exportable bool
    The is exportable flag of the certificate.
    Name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    Thumbprint string
    The thumbprint for the certificate.
    AutomationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    Base64 string
    Base64 encoded value of the certificate.
    Description string
    The description of this Automation Certificate.
    Exportable bool
    The is exportable flag of the certificate.
    Name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    Thumbprint string
    The thumbprint for the certificate.
    automationAccountName String
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 String
    Base64 encoded value of the certificate.
    description String
    The description of this Automation Certificate.
    exportable Boolean
    The is exportable flag of the certificate.
    name String
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    thumbprint String
    The thumbprint for the certificate.
    automationAccountName string
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 string
    Base64 encoded value of the certificate.
    description string
    The description of this Automation Certificate.
    exportable boolean
    The is exportable flag of the certificate.
    name string
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    thumbprint string
    The thumbprint for the certificate.
    automation_account_name str
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 str
    Base64 encoded value of the certificate.
    description str
    The description of this Automation Certificate.
    exportable bool
    The is exportable flag of the certificate.
    name str
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    thumbprint str
    The thumbprint for the certificate.
    automationAccountName String
    The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
    base64 String
    Base64 encoded value of the certificate.
    description String
    The description of this Automation Certificate.
    exportable Boolean
    The is exportable flag of the certificate.
    name String
    Specifies the name of the Certificate. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
    thumbprint String
    The thumbprint for the certificate.

    Import

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

     $ pulumi import azure:automation/certificate:Certificate certificate1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/certificates/certificate1
    

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

    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.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.