Provide an Azure-native web certificate code snippet.
TypeScriptThe following code will create an Azure Web Certificate using the azure-native provider in Pulumi. The Azure Web Certificate is a managed certificate, specifically for App Service.
In this code,
pfxBlob
andpassword
are secrets that should be provided as actual values.resourceGroupName
refers to the Resource Group under which you want the certificate to be created. Thename
parameter is needed to give a unique name for the certificate within the Azure environment.import * as pulumi from "@pulumi/pulumi"; import * as azure_native from "@pulumi/azure-native"; // Replace these variables with actual values const pfxBlobSecret = new pulumi.Config("azure-native:web:Certificate").requireSecret("pfxBlob") const passwordSecret = new pulumi.Config("azure-native:web:Certificate").requireSecret("password") const webCertificate = new azure_native.web.Certificate("webCertificate", { location: "Central US", // Choose the location according to your preference name: "webCertificate1", // The unique name of the certificate password: passwordSecret, pfxBlob: pfxBlobSecret, resourceGroupName: "rg", // Provide the Resource Group Name tags: { tag1: "value1", // Add the tags that you want to apply }, });
Make sure you replace the placeholders for the
pfxBlobSecret
andpasswordSecret
with actual secret values from your environment. Thelocation
andresourceGroupName
should be according to your setup on Azure.The highlighted line of
new azure_native.web.Certificate
is where the new Azure Web Application Managed Certificate is being created.Please note that the
pfxBlob
parameter is a base64-encoded Public-Key Cryptography Standards (PKCS): PKCS#12-formatted certificate blob.Visit the following link for more detailed information: Azure Native: Web Certificate