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

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.appservice.getCertificate

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Use this data source to access information about an App Service Certificate.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.appservice.getCertificate({
        name: "example-app-service-certificate",
        resourceGroupName: "example-rg",
    });
    export const appServiceCertificateId = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.appservice.get_certificate(name="example-app-service-certificate",
        resource_group_name="example-rg")
    pulumi.export("appServiceCertificateId", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := appservice.LookupCertificate(ctx, &appservice.LookupCertificateArgs{
    			Name:              "example-app-service-certificate",
    			ResourceGroupName: "example-rg",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("appServiceCertificateId", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.AppService.GetCertificate.Invoke(new()
        {
            Name = "example-app-service-certificate",
            ResourceGroupName = "example-rg",
        });
    
        return new Dictionary<string, object?>
        {
            ["appServiceCertificateId"] = example.Apply(getCertificateResult => getCertificateResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.appservice.AppserviceFunctions;
    import com.pulumi.azure.appservice.inputs.GetCertificateArgs;
    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) {
            final var example = AppserviceFunctions.getCertificate(GetCertificateArgs.builder()
                .name("example-app-service-certificate")
                .resourceGroupName("example-rg")
                .build());
    
            ctx.export("appServiceCertificateId", example.applyValue(getCertificateResult -> getCertificateResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:appservice:getCertificate
          Arguments:
            name: example-app-service-certificate
            resourceGroupName: example-rg
    outputs:
      appServiceCertificateId: ${example.id}
    

    Using getCertificate

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCertificate(args: GetCertificateArgs, opts?: InvokeOptions): Promise<GetCertificateResult>
    function getCertificateOutput(args: GetCertificateOutputArgs, opts?: InvokeOptions): Output<GetCertificateResult>
    def get_certificate(name: Optional[str] = None,
                        resource_group_name: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetCertificateResult
    def get_certificate_output(name: Optional[pulumi.Input[str]] = None,
                        resource_group_name: Optional[pulumi.Input[str]] = None,
                        tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetCertificateResult]
    func LookupCertificate(ctx *Context, args *LookupCertificateArgs, opts ...InvokeOption) (*LookupCertificateResult, error)
    func LookupCertificateOutput(ctx *Context, args *LookupCertificateOutputArgs, opts ...InvokeOption) LookupCertificateResultOutput

    > Note: This function is named LookupCertificate in the Go SDK.

    public static class GetCertificate 
    {
        public static Task<GetCertificateResult> InvokeAsync(GetCertificateArgs args, InvokeOptions? opts = null)
        public static Output<GetCertificateResult> Invoke(GetCertificateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCertificateResult> getCertificate(GetCertificateArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:appservice/getCertificate:getCertificate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the certificate.
    ResourceGroupName string
    The name of the resource group in which to create the certificate.
    Tags Dictionary<string, string>
    Name string
    Specifies the name of the certificate.
    ResourceGroupName string
    The name of the resource group in which to create the certificate.
    Tags map[string]string
    name String
    Specifies the name of the certificate.
    resourceGroupName String
    The name of the resource group in which to create the certificate.
    tags Map<String,String>
    name string
    Specifies the name of the certificate.
    resourceGroupName string
    The name of the resource group in which to create the certificate.
    tags {[key: string]: string}
    name str
    Specifies the name of the certificate.
    resource_group_name str
    The name of the resource group in which to create the certificate.
    tags Mapping[str, str]
    name String
    Specifies the name of the certificate.
    resourceGroupName String
    The name of the resource group in which to create the certificate.
    tags Map<String>

    getCertificate Result

    The following output properties are available:

    ExpirationDate string
    The expiration date for the certificate.
    FriendlyName string
    The friendly name of the certificate.
    HostNames List<string>
    List of host names the certificate applies to.
    Id string
    The provider-assigned unique ID for this managed resource.
    IssueDate string
    The issue date for the certificate.
    Issuer string
    The name of the certificate issuer.
    Location string
    Name string
    ResourceGroupName string
    SubjectName string
    The subject name of the certificate.
    Thumbprint string
    The thumbprint for the certificate.
    Tags Dictionary<string, string>
    ExpirationDate string
    The expiration date for the certificate.
    FriendlyName string
    The friendly name of the certificate.
    HostNames []string
    List of host names the certificate applies to.
    Id string
    The provider-assigned unique ID for this managed resource.
    IssueDate string
    The issue date for the certificate.
    Issuer string
    The name of the certificate issuer.
    Location string
    Name string
    ResourceGroupName string
    SubjectName string
    The subject name of the certificate.
    Thumbprint string
    The thumbprint for the certificate.
    Tags map[string]string
    expirationDate String
    The expiration date for the certificate.
    friendlyName String
    The friendly name of the certificate.
    hostNames List<String>
    List of host names the certificate applies to.
    id String
    The provider-assigned unique ID for this managed resource.
    issueDate String
    The issue date for the certificate.
    issuer String
    The name of the certificate issuer.
    location String
    name String
    resourceGroupName String
    subjectName String
    The subject name of the certificate.
    thumbprint String
    The thumbprint for the certificate.
    tags Map<String,String>
    expirationDate string
    The expiration date for the certificate.
    friendlyName string
    The friendly name of the certificate.
    hostNames string[]
    List of host names the certificate applies to.
    id string
    The provider-assigned unique ID for this managed resource.
    issueDate string
    The issue date for the certificate.
    issuer string
    The name of the certificate issuer.
    location string
    name string
    resourceGroupName string
    subjectName string
    The subject name of the certificate.
    thumbprint string
    The thumbprint for the certificate.
    tags {[key: string]: string}
    expiration_date str
    The expiration date for the certificate.
    friendly_name str
    The friendly name of the certificate.
    host_names Sequence[str]
    List of host names the certificate applies to.
    id str
    The provider-assigned unique ID for this managed resource.
    issue_date str
    The issue date for the certificate.
    issuer str
    The name of the certificate issuer.
    location str
    name str
    resource_group_name str
    subject_name str
    The subject name of the certificate.
    thumbprint str
    The thumbprint for the certificate.
    tags Mapping[str, str]
    expirationDate String
    The expiration date for the certificate.
    friendlyName String
    The friendly name of the certificate.
    hostNames List<String>
    List of host names the certificate applies to.
    id String
    The provider-assigned unique ID for this managed resource.
    issueDate String
    The issue date for the certificate.
    issuer String
    The name of the certificate issuer.
    location String
    name String
    resourceGroupName String
    subjectName String
    The subject name of the certificate.
    thumbprint String
    The thumbprint for the certificate.
    tags Map<String>

    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.81.0 published on Monday, Jun 24, 2024 by Pulumi