l

    little-library-54601

    5 months ago
    For an Azure app service (
    AzureNative.Web.WebApp
    in Pulumi), how do I set some of the critical setting that show up under Configuration->General Settings in the Azure portal? Specifically: • Stack (want ".NET") • .NET Version (.NET 6 (LTS)) • Platform (64 bit) • FTP state (FTPS Only) I have an app service that was created via the Azure CLI as a reference. In the applicable "az" commands, those settings are
    --runtime DOTNET|6.0
    ,
    --use-32bit-worker-process false
    , and
    --ftps-state FtpsOnly
    . In the ARM template for the reference app service, those settings are
    netFrameworkVersion: v6.0
    ,
    use32BitWorkerProcess: false
    , and
    ftpsState: FtpsOnly
    . I've used
    pulumi import
    to generate the C# code for that reference app service, but I don't see anything in that code which seems to specify those settings. I've tried searching the Pulumi AzureNative API docs but haven't had any luck. Can anyone point me in the right direction for this? As it stands, my app won't start (not surprisingly). Thanks.
    m

    modern-quill-17695

    5 months ago
    Not sure how helpful it is, but I've used the example code from this repo in the past: https://github.com/pulumi/examples/tree/master/azure-cs-appservice But the settings you're asking about specifically are inside the SiteConfig property when creating a new instance of WebAppArgs: https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/#siteconfig
    l

    little-library-54601

    5 months ago
    Thank you. I just worked through that documentation, and it seems to cover all the settings that I need to change.
    I've referred to that example quite a bit, but it doesn't set any of those SiteConfigArgs. TBH, I'd be surprised if a recent .net core app would run within an app service created from that example.
    For any Pulumi folks watching this conversation, what threw me off was that the
    pulumi import
    that I did from the reference app service did not include any of those
    SiteConfigArgs
    settings. It also didn't include the
    AppSettings
    values that would be specified within
    SiteConfigArgs
    . That seems like an opportunity to improve the import capabilities.
    Finally, the arm2pulumi tool couldn't convert the arm template from the reference app service.
    m

    modern-quill-17695

    5 months ago
    I think the dotnet runtime part threw me off. I was under the impression that setting was for Full Framework, not Core. Have you tried deploying your app self contained?
    l

    little-library-54601

    5 months ago
    My app is working now. I added these properties to my SiteConfigArgs:
    AlwaysOn = true,
                    FtpsState = FtpsState.FtpsOnly,
                    Http20Enabled = true,
                    NetFrameworkVersion = "v6.0",
                    NumberOfWorkers = 1,
                    Use32BitWorkerProcess = false,
    There was some serendipity from this, in that the PR that merged those changes to main use the pulumi github action to update the environment. The (unchanged) app was deployed, and now it's working. No tweaking of anything within the Azure portal, which is great!
    The only remaining anomaly at this point is that for the reference app service, under "General Settings" in the Azure portal, I see: Stack: .NET .NET Version: .NET 6 (LTS) But for the pulumi-managed app service, "Stack" is empty; and .NET Version doesn't appear. Multiple refreshes haven't changed what it's displaying. But the arm templates now match, so I think it's a portal display issue, not an actual app service configuration issue. Thanks again.