Hi Pulumi people :wave: I am trying to create an ...
# general
s
Hi Pulumi people 👋 I am trying to create an
App Service Managed Certificate
as part of a deployment of an App Service to Azure. I cannot see where I can do that within the following API's in Pulumi, can someone point me in the right direction? I have looked into the following providers / APIs - maybe I have missed something: • https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapphostnamebinding/ • https://www.pulumi.com/registry/packages/azure/api-docs/appservice/managedcertificate/ • https://www.pulumi.com/registry/packages/azure/api-docs/appservice/customhostnamebinding/ • https://www.pulumi.com/registry/packages/azure/api-docs/appservice/certificate/ • https://www.pulumi.com/registry/packages/azure/api-docs/appservice/certificatebinding/
I have been able to add the Traffic Manager cert to the app service, but the bindings still fail. This is what I am doing currently:
Copy code
WORKS!!
let cert = new azure-native.web.Certificate(`${endpointConfig.name}-cert`, {
                resourceGroupName: rgName, // this should be target app resource group
                canonicalName: `<http://service-api-abc.trafficmanager.net|service-api-abc.trafficmanager.net>`,
                hostNames: [`<http://service-api-abc.trafficmanager.net|service-api-abc.trafficmanager.net>`],
                serverFarmId: pulumi.interpolate `${webApp.serverFarmId}`,
}


FAILS!!
 let binding = new azure-native.web.WebAppHostNameBinding(`${endpointConfig.name}-cert-binding`, {
                name: pulumi.interpolate `${webApp.name}`,
                resourceGroupName: rgName,
                siteName: pulumi.interpolate `${webApp.name}`,
                sslState: "SniEnabled",
                hostNameType: "Verified",
                thumbprint: cert.thumbprint
}
We can see on azure, the app service has the TM managed certificate added. But the binding returns the following failure.
Copy code
error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="A TXT record pointing from asuid.cert-binding to xxxxxxxxxxxx738bbae43cc8b60f509dfce14780220d5188c795486 was not found." Details=[{"Message":"A TXT record pointing from asuid.cert-binding to xxxxxxxxxxxx738bbae43cc8b60f509dfce14780220d5188c795486 was not found."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"04006","Message":"A TXT record pointing from asuid.cert-binding to xxxxxxxxxxxx738bbae43cc8b60f509dfce14780220d5188c795486 was not found.","MessageTemplate":"A TXT record pointing from asuid.{0} to {1} was not found.","Parameters":["cert-binding","xxxxxxxxxxxx738bbae43cc8b60f509dfce14780220d5188c795486"]}}]