Hi! I am trying to add a custom domain with a certificate to a WebApp. I have a
WebAppHostnameBinding
and a
Certificate
and it works, but I have to go into the portal to assign the certificate to the binding. How can I do this with pulumi?
l
little-library-54601
08/16/2024, 1:07 PM
That sounds like the issue addressed here: https://github.com/pulumi/pulumi-azure-native/issues/578
As far as I know there's still no good answer because the Azure native API doesn't expose a mechanism to avoid the circular dependency.
c
colossal-carpenter-63998
08/16/2024, 1:12 PM
Funny how the issues discussing this has a circular link
l
little-library-54601
08/16/2024, 1:12 PM
🤷♂️
a
adventurous-butcher-54166
08/16/2024, 5:29 PM
For assigning a free managed certificate to an app service hostname binding you'll have to do two consecutive pulumi updates.
First update:
• Creates the required required TXT and Cname DNS records
• Creates WebAppHostnameBinding with SSL disabled
• Creates Certificate
Second pass:
• Now the
cert.thumbprint
output should be available so now you can pass in the required parameters for enabling the SSL binding on the
WebAppHostnameBinding
resource
Copy code
ssl_state=web.SslState.SNI_ENABLED if cert.thumbprint else web.SslState.DISABLED
ssl_thumbprint=cert.thumbprint
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.