1. Packages
  2. Azure Classic
  3. API Docs
  4. appservice
  5. PublicCertificate

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

azure.appservice.PublicCertificate

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

    Manages an App Service Public Certificate.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as std from "@pulumi/std";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const examplePlan = new azure.appservice.Plan("example", {
        name: "example-app-service-plan",
        location: example.location,
        resourceGroupName: example.name,
        sku: {
            tier: "Standard",
            size: "S1",
        },
    });
    const exampleAppService = new azure.appservice.AppService("example", {
        name: "example-app-service",
        location: example.location,
        resourceGroupName: example.name,
        appServicePlanId: examplePlan.id,
    });
    const examplePublicCertificate = new azure.appservice.PublicCertificate("example", {
        resourceGroupName: example.name,
        appServiceName: exampleAppService.name,
        certificateName: "example-public-certificate",
        certificateLocation: "Unknown",
        blob: std.filebase64({
            input: "app_service_public_certificate.cer",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_azure as azure
    import pulumi_std as std
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_plan = azure.appservice.Plan("example",
        name="example-app-service-plan",
        location=example.location,
        resource_group_name=example.name,
        sku=azure.appservice.PlanSkuArgs(
            tier="Standard",
            size="S1",
        ))
    example_app_service = azure.appservice.AppService("example",
        name="example-app-service",
        location=example.location,
        resource_group_name=example.name,
        app_service_plan_id=example_plan.id)
    example_public_certificate = azure.appservice.PublicCertificate("example",
        resource_group_name=example.name,
        app_service_name=example_app_service.name,
        certificate_name="example-public-certificate",
        certificate_location="Unknown",
        blob=std.filebase64(input="app_service_public_certificate.cer").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
    	"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 {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
    			Name:              pulumi.String("example-app-service-plan"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Sku: &appservice.PlanSkuArgs{
    				Tier: pulumi.String("Standard"),
    				Size: pulumi.String("S1"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleAppService, err := appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
    			Name:              pulumi.String("example-app-service"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			AppServicePlanId:  examplePlan.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
    			Input: "app_service_public_certificate.cer",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = appservice.NewPublicCertificate(ctx, "example", &appservice.PublicCertificateArgs{
    			ResourceGroupName:   example.Name,
    			AppServiceName:      exampleAppService.Name,
    			CertificateName:     pulumi.String("example-public-certificate"),
    			CertificateLocation: pulumi.String("Unknown"),
    			Blob:                invokeFilebase64.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 example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var examplePlan = new Azure.AppService.Plan("example", new()
        {
            Name = "example-app-service-plan",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Sku = new Azure.AppService.Inputs.PlanSkuArgs
            {
                Tier = "Standard",
                Size = "S1",
            },
        });
    
        var exampleAppService = new Azure.AppService.AppService("example", new()
        {
            Name = "example-app-service",
            Location = example.Location,
            ResourceGroupName = example.Name,
            AppServicePlanId = examplePlan.Id,
        });
    
        var examplePublicCertificate = new Azure.AppService.PublicCertificate("example", new()
        {
            ResourceGroupName = example.Name,
            AppServiceName = exampleAppService.Name,
            CertificateName = "example-public-certificate",
            CertificateLocation = "Unknown",
            Blob = Std.Filebase64.Invoke(new()
            {
                Input = "app_service_public_certificate.cer",
            }).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.appservice.Plan;
    import com.pulumi.azure.appservice.PlanArgs;
    import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
    import com.pulumi.azure.appservice.AppService;
    import com.pulumi.azure.appservice.AppServiceArgs;
    import com.pulumi.azure.appservice.PublicCertificate;
    import com.pulumi.azure.appservice.PublicCertificateArgs;
    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 ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var examplePlan = new Plan("examplePlan", PlanArgs.builder()        
                .name("example-app-service-plan")
                .location(example.location())
                .resourceGroupName(example.name())
                .sku(PlanSkuArgs.builder()
                    .tier("Standard")
                    .size("S1")
                    .build())
                .build());
    
            var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()        
                .name("example-app-service")
                .location(example.location())
                .resourceGroupName(example.name())
                .appServicePlanId(examplePlan.id())
                .build());
    
            var examplePublicCertificate = new PublicCertificate("examplePublicCertificate", PublicCertificateArgs.builder()        
                .resourceGroupName(example.name())
                .appServiceName(exampleAppService.name())
                .certificateName("example-public-certificate")
                .certificateLocation("Unknown")
                .blob(StdFunctions.filebase64(Filebase64Args.builder()
                    .input("app_service_public_certificate.cer")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      examplePlan:
        type: azure:appservice:Plan
        name: example
        properties:
          name: example-app-service-plan
          location: ${example.location}
          resourceGroupName: ${example.name}
          sku:
            tier: Standard
            size: S1
      exampleAppService:
        type: azure:appservice:AppService
        name: example
        properties:
          name: example-app-service
          location: ${example.location}
          resourceGroupName: ${example.name}
          appServicePlanId: ${examplePlan.id}
      examplePublicCertificate:
        type: azure:appservice:PublicCertificate
        name: example
        properties:
          resourceGroupName: ${example.name}
          appServiceName: ${exampleAppService.name}
          certificateName: example-public-certificate
          certificateLocation: Unknown
          blob:
            fn::invoke:
              Function: std:filebase64
              Arguments:
                input: app_service_public_certificate.cer
              Return: result
    

    Create PublicCertificate Resource

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

    Constructor syntax

    new PublicCertificate(name: string, args: PublicCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def PublicCertificate(resource_name: str,
                          args: PublicCertificateArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def PublicCertificate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          app_service_name: Optional[str] = None,
                          blob: Optional[str] = None,
                          certificate_location: Optional[str] = None,
                          certificate_name: Optional[str] = None,
                          resource_group_name: Optional[str] = None)
    func NewPublicCertificate(ctx *Context, name string, args PublicCertificateArgs, opts ...ResourceOption) (*PublicCertificate, error)
    public PublicCertificate(string name, PublicCertificateArgs args, CustomResourceOptions? opts = null)
    public PublicCertificate(String name, PublicCertificateArgs args)
    public PublicCertificate(String name, PublicCertificateArgs args, CustomResourceOptions options)
    
    type: azure:appservice:PublicCertificate
    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 PublicCertificateArgs
    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 PublicCertificateArgs
    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 PublicCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PublicCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PublicCertificateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var publicCertificateResource = new Azure.AppService.PublicCertificate("publicCertificateResource", new()
    {
        AppServiceName = "string",
        Blob = "string",
        CertificateLocation = "string",
        CertificateName = "string",
        ResourceGroupName = "string",
    });
    
    example, err := appservice.NewPublicCertificate(ctx, "publicCertificateResource", &appservice.PublicCertificateArgs{
    	AppServiceName:      pulumi.String("string"),
    	Blob:                pulumi.String("string"),
    	CertificateLocation: pulumi.String("string"),
    	CertificateName:     pulumi.String("string"),
    	ResourceGroupName:   pulumi.String("string"),
    })
    
    var publicCertificateResource = new PublicCertificate("publicCertificateResource", PublicCertificateArgs.builder()        
        .appServiceName("string")
        .blob("string")
        .certificateLocation("string")
        .certificateName("string")
        .resourceGroupName("string")
        .build());
    
    public_certificate_resource = azure.appservice.PublicCertificate("publicCertificateResource",
        app_service_name="string",
        blob="string",
        certificate_location="string",
        certificate_name="string",
        resource_group_name="string")
    
    const publicCertificateResource = new azure.appservice.PublicCertificate("publicCertificateResource", {
        appServiceName: "string",
        blob: "string",
        certificateLocation: "string",
        certificateName: "string",
        resourceGroupName: "string",
    });
    
    type: azure:appservice:PublicCertificate
    properties:
        appServiceName: string
        blob: string
        certificateLocation: string
        certificateName: string
        resourceGroupName: string
    

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

    AppServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    Blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    CertificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    CertificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    ResourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    AppServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    Blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    CertificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    CertificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    ResourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    appServiceName String
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob String
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation String
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName String
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName String
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    appServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    app_service_name str
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob str
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificate_location str
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificate_name str
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resource_group_name str
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    appServiceName String
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob String
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation String
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName String
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName String
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.

    Outputs

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

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

    Look up Existing PublicCertificate Resource

    Get an existing PublicCertificate 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?: PublicCertificateState, opts?: CustomResourceOptions): PublicCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_service_name: Optional[str] = None,
            blob: Optional[str] = None,
            certificate_location: Optional[str] = None,
            certificate_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            thumbprint: Optional[str] = None) -> PublicCertificate
    func GetPublicCertificate(ctx *Context, name string, id IDInput, state *PublicCertificateState, opts ...ResourceOption) (*PublicCertificate, error)
    public static PublicCertificate Get(string name, Input<string> id, PublicCertificateState? state, CustomResourceOptions? opts = null)
    public static PublicCertificate get(String name, Output<String> id, PublicCertificateState 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:
    AppServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    Blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    CertificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    CertificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    ResourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    Thumbprint string
    The thumbprint of the public certificate.
    AppServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    Blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    CertificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    CertificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    ResourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    Thumbprint string
    The thumbprint of the public certificate.
    appServiceName String
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob String
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation String
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName String
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName String
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    thumbprint String
    The thumbprint of the public certificate.
    appServiceName string
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob string
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation string
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName string
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName string
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    thumbprint string
    The thumbprint of the public certificate.
    app_service_name str
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob str
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificate_location str
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificate_name str
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resource_group_name str
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    thumbprint str
    The thumbprint of the public certificate.
    appServiceName String
    The name of the App Service. Changing this forces a new App Service Public Certificate to be created.
    blob String
    The base64-encoded contents of the certificate. Changing this forces a new App Service Public Certificate to be created.
    certificateLocation String
    The location of the certificate. Possible values are CurrentUserMy, LocalMachineMy and Unknown. Changing this forces a new App Service Public Certificate to be created.
    certificateName String
    The name of the public certificate. Changing this forces a new App Service Public Certificate to be created.
    resourceGroupName String
    The name of the Resource Group where the App Service Public Certificate should exist. Changing this forces a new App Service Public Certificate to be created.
    thumbprint String
    The thumbprint of the public certificate.

    Import

    App Service Public Certificates can be imported using the resource id, e.g.

    $ pulumi import azure:appservice/publicCertificate:PublicCertificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Web/sites/site1/publicCertificates/publicCertificate1
    

    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.

    Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi