This message was deleted.
s
This message was deleted.
f
Hello, I just wanted to let you know that after a few attempts I have now found the solution myself. So first read the pxf-file via fs.readFileSync and then convert it to Base64. The Base64 string can then be assigned to the 'data' propery under 'sslCertificates'. With this you can create the application gateway including the SSL certificate. Attached again the code from before which contains the necessary adjustment...
Copy code
import * as pulumi from "@pulumi/pulumi"; 
import * as azure from "@pulumi/azure-native";
import * as fs from 'fs';
import * as rg from "./resource-group";

//////////////////////////////////////////////////////////////////////////////
// Azure Config variables
//////////////////////////////////////////////////////////////////////////////
const config = new pulumi.Config();
const appGatewayName = config.require("appGatewayName");
const sslCertPassword = config.requireSecret("sslCertPassword");

const sslGetCertData = (() => {
    var bitmap = fs.readFileSync('my-domain.pfx');
    return bitmap.toString('base64');
  })()


//////////////////////////////////////////////////////////////////////////////
// Create Azure AppSettings (for AppServices)
//////////////////////////////////////////////////////////////////////////////
const applicationGateway = new azure.network.ApplicationGateway(appGatewayName, {
    applicationGatewayName: appGatewayName,
    authenticationCertificates: [],
    location: "westeurope",
    resourceGroupName: rg.rgName,
    //....

    sslCertificates: [{
        data: sslGetCertData,
        name: "my-domain",
        password: sslCertPassword,
    }],

    //....
    //....
});
144 Views