Hi everyone :wave: I am created an Azure Web app ...
# azure
s
Hi everyone πŸ‘‹ I am created an Azure Web app with C# and can't find anyway of setting the Stack or .Net version for the App Am I missing something obvious? πŸ€”
c
Under site config, there is a LinuxFxVersion that gets set. For me, it β€œDOTNETCORE|6.0”. If you running Windows, it netFrameworkVersion with a value. Example: β€œv6.0”. https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/#siteconfig
s
Thanks! Unfortunately this isn't working for me I've tried "v6.0", "v6.0" "6.0.0", "v6.0.0"
I even tried your Linux settings and I get an error This is strange πŸ€”
c
Yeah, I just tested this on a Windows app service; the stack and .net version do not get set. I deployed a control via the portal and diffed the ARM template and didn't see anything that would cause this behavior. I then manually enabled the stack and .net version on the app service deployed by Pulumi. I again diffed the two ARM templates and the only difference was RemoteDebuggingVersion. I deleted the app service, updated the Pulumi template with remote debugging, but again the Pulumi didn't set the stack. We use Linux so we never encountered this problem. Maybe someone from Pulumi Inc will test and see what we missing.
I will also add that Pulumi is setting phpVersion: β€œ5.6” even though I not defining PHP in the template. Not sure if that confusing ARM, so the .net stack is not setting.
s
That's so weird Thank you so much Nahlian Do you know how we could escalate this? Is there any convention for contacting the Pulumi team for issues like this?
c
On here seems hit or miss if someone from Pulimi Inc has time. If you have a support plan, I would go through that. Maybe try a GitHub issue or another forum to see if anyone else can help.
Found something about web app meta data. Give me a few to test.
Copy code
using System.Collections.Generic;
using Pulumi.AzureNative.Resources;
using Pulumi.AzureNative.Web;
using Pulumi.AzureNative.Web.Inputs;

return await Pulumi.Deployment.RunAsync(() =>
{
    // Create an Azure Resource Group
    var resourceGroup = new ResourceGroup("resourceGroup", new ResourceGroupArgs
    {
        Location = "SouthCentralUs",
        ResourceGroupName = "scu-dev-pulumi-rg"
    });

    var appServicePlan = new AppServicePlan("appServicePlan", new AppServicePlanArgs
    {
        Location = "SouthCentralUs",
        ResourceGroupName = resourceGroup.Name,
        Name = "scu-dev-pulumi-asp",
        HyperV = false,
        IsSpot = false,
        IsXenon = false,
        Kind = "app",
        MaximumElasticWorkerCount = 1,
        PerSiteScaling = false,
        Reserved = false,
        TargetWorkerCount = 0,
        Sku = new SkuDescriptionArgs
        {
            Capacity = 1,
            Family = "B",
            Name = "B1",
            Size = "B1",
            Tier = "Basic"
        }
    });

    var appService = new WebApp("appService", new WebAppArgs
    {
        Location = "SouthCentralUs",
        ResourceGroupName = resourceGroup.Name,
        Name = "scu-dev-pulumi-web",
        ServerFarmId = appServicePlan.Id,
        HyperV = false,
        IsXenon = false,
        Kind = "app",
        Reserved = false,
        SiteConfig = new SiteConfigArgs
        {
            NetFrameworkVersion = "v6.0",
            Use32BitWorkerProcess = false,
            WindowsFxVersion = "v6.0"
        }
    });

    var metaData = new WebAppMetadata("metaData", new WebAppMetadataArgs
    {
        ResourceGroupName = resourceGroup.Name,
        Name = appService.Name,
        Properties = new Dictionary<string, string>
        {
            {"CURRENT_STACK", "dotnetcore"},
        }
    });

});
@swift-apple-26877 Got it, have to add some obscure meta data. Found it on stack overflow about a bicep problem with the same behavior.
πŸ™Œ 1
s
Just tried it and it works!!!! βœ… βœ… βœ… βœ… Thank you so much
Looks like they've changed it again @clean-truck-93285 😱 https://pulumi-community.slack.com/archives/CRVK66N5U/p1672837980139049