Hi. I have creates an Azure App Service using C# ...
# dotnet
m
Hi. I have creates an Azure App Service using C# and specified the following (abbreviated) args
Copy code
var webApp = new AppService(name, new AppServiceArgs
{
    ClientAffinityEnabled = false,
    HttpsOnly = true,
}
I then wanted to create a deployment slot with the same setting. I was hoping to be able to pass the webApp in and read the settings in its AppServiceArgs and use them to apply to the SlotArgs (to ensure that they ended up identical) e.g.
Copy code
var webAppSlot = new Slot(name, new SlotArgs
{
    ClientAffinityEnabled = webApp.ClientAffinityEnabled,
    HttpsOnly = webApp.HttpsOnly,
}
This seems to work for the ClientAffinityEnabled setting but for the HttpsOnly setting I get an error... Cannot implicitly convert type 'Pulumi.Output<bool?>' to 'Pulumi.Input<bool>' Why are ClientAffinityEnabled and HttpsOnly behaving differently and is there a way to be able to read the HttpsOnly setting from the webApp and apply it to the slot App? Thanks Alan
Looks like this will work
Copy code
HttpsOnly = webApp.HttpsOnly.Apply(v => v!.Value),
but I'm still not sure why ClientAffinityEnabled and HttpsOnly behave differently?
t
That’s a very good question. The duality of nullable types in C# (value vs reference) is getting us here. Maybe we could improve this situation with an extra conversion. Do you mind creating a case in https://github.com/pulumi/pulumi ?
m
Thanks Mikhail here you go...