Certificate

class Certificate : KotlinCustomResource

Manages an App Service certificate.

Example Usage

This example provisions an App Service Certificate from a Local File.

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 exampleCertificate = new azure.appservice.Certificate("example", {
name: "example-cert",
resourceGroupName: example.name,
location: example.location,
pfxBlob: std.filebase64({
input: "certificate.pfx",
}).then(invoke => invoke.result),
password: "password123!",
});
import pulumi
import pulumi_azure as azure
import pulumi_std as std
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_certificate = azure.appservice.Certificate("example",
name="example-cert",
resource_group_name=example.name,
location=example.location,
pfx_blob=std.filebase64(input="certificate.pfx").result,
password="password123!")
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 exampleCertificate = new Azure.AppService.Certificate("example", new()
{
Name = "example-cert",
ResourceGroupName = example.Name,
Location = example.Location,
PfxBlob = Std.Filebase64.Invoke(new()
{
Input = "certificate.pfx",
}).Apply(invoke => invoke.Result),
Password = "password123!",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appservice"
"github.com/pulumi/pulumi-azure/sdk/v6/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
}
invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
Input: "certificate.pfx",
}, nil)
if err != nil {
return err
}
_, err = appservice.NewCertificate(ctx, "example", &appservice.CertificateArgs{
Name: pulumi.String("example-cert"),
ResourceGroupName: example.Name,
Location: example.Location,
PfxBlob: pulumi.String(invokeFilebase64.Result),
Password: pulumi.String("password123!"),
})
if err != nil {
return err
}
return nil
})
}
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.Certificate;
import com.pulumi.azure.appservice.CertificateArgs;
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 exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
.name("example-cert")
.resourceGroupName(example.name())
.location(example.location())
.pfxBlob(StdFunctions.filebase64(Filebase64Args.builder()
.input("certificate.pfx")
.build()).result())
.password("password123!")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleCertificate:
type: azure:appservice:Certificate
name: example
properties:
name: example-cert
resourceGroupName: ${example.name}
location: ${example.location}
pfxBlob:
fn::invoke:
function: std:filebase64
arguments:
input: certificate.pfx
return: result
password: password123!

Import

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

$ pulumi import azure:appservice/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/certificates/certificate1

Properties

Link copied to clipboard
val appServicePlanId: Output<String>?

The ID of the associated App Service plan. Must be specified when the certificate is used inside an App Service Environment hosted App Service or with Basic and Premium App Service plans. Changing this forces a new resource to be created.

Link copied to clipboard
val expirationDate: Output<String>

The expiration date for the certificate.

Link copied to clipboard
val friendlyName: Output<String>

The friendly name of the certificate.

Link copied to clipboard

The ID of the App Service Environment where the certificate is in use.

Link copied to clipboard
val hostNames: Output<List<String>>

List of host names the certificate applies to.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val issueDate: Output<String>

The issue date for the certificate.

Link copied to clipboard
val issuer: Output<String>

The name of the certificate issuer.

Link copied to clipboard
val keyVaultId: Output<String>?
Link copied to clipboard
val keyVaultSecretId: Output<String>?

The ID of the Key Vault secret. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>

Specifies the name of the certificate. Changing this forces a new resource to be created.

Link copied to clipboard
val password: Output<String>?

The password to access the certificate's private key. Changing this forces a new resource to be created.

Link copied to clipboard
val pfxBlob: Output<String>?

The base64-encoded contents of the certificate. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which to create the certificate. Changing this forces a new resource to be created.

Link copied to clipboard
val subjectName: Output<String>

The subject name of the certificate.

Link copied to clipboard
val tags: Output<Map<String, String>>?
Link copied to clipboard
val thumbprint: Output<String>

The thumbprint for the certificate.

Link copied to clipboard
val urn: Output<String>