Thread
#general
    s

    sticky-exabyte-94099

    8 months ago
    I have appsettings.json files in my .net project that my project is reading from. But then I´m settings some AppSettings in code. Should I just skip the appSettings.json files completely and just have it all in Pulumi code?
    var App = new AzureNative.Web.WebApp("myapp", new AzureNative.Web.WebAppArgs
    {
        ResourceGroupName = ResourceGroup.Apply(t => t.Name),
        Location = ResourceGroup.Apply(t => t.Location),
        ServerFarmId = AppServicePlan.Id,
        SiteConfig = new AzureNative.Web.Inputs.SiteConfigArgs
        {
            AppSettings = {
                new AzureNative.Web.Inputs.NameValuePairArgs{
                    Name = "WEBSITE_RUN_FROM_PACKAGE",
                    Value = BlazorCodeBlobEndpoint,
                },
                new AzureNative.Web.Inputs.NameValuePairArgs{
                    Name = "ASPNETCORE_ENVIRONMENT",
                    Value = Deployment.Instance.StackName.ToLower(),
                },
                //Abp.io
                    new AzureNative.Web.Inputs.NameValuePairArgs{
                    Name = "App:SelfUrl", //<-- So do this
                    Value = MyEndpoint,
                }
            },
        },
        Tags =
        {
            { "environment", StackName },
        },
    });
    and not in appSettings.json
    {
      "App": {
        "SelfUrl": "<https://me.com>",
       ... etc
    }
    And should I then get rid of every settings in appSettings.json?
    b

    bored-activity-40468

    8 months ago
    You can, great example here, https://github.com/gitfool/Pulumi.Dungeon
    s

    sticky-exabyte-94099

    8 months ago
    Ok kind of lost here. Could you point me to the code part you think will help me with this?
    Ok I think I got this. The AppSettings overide the appsettings.json when they are set. And I originally thought so but things didn´t work so I assumed something else had to be done. But now I see that some values are not set in the portal so something must be wrong with my code. I´ll look into this.. thank you