Does anyone know why when I create a webapp my app...
# general
w
Does anyone know why when I create a webapp my appsettings are not showing in the JSON for my web app in the portal? Under siteconfigs in the json view the app settings is null here is how I am creating the webapp
Copy code
var standardLogicApp = new Pulumi.AzureNative.Web.WebApp($"Instanda-{sn}-logic-", new()
    {
        Kind = "functionapp,workflowapp",
        ResourceGroupName = resourceGroup.Name,
        Location = resourceGroup.Location,
        ServerFarmId = appServicePlace.Id,
        SiteConfig = new SiteConfigArgs
        {
            AppSettings = new[]{

                    new NameValuePairArgs
                    {
                        Name = "FUNCTIONS_EXTENSION_VERSION",
                        Value = "~4"

                    },
                    new NameValuePairArgs
                    {
                        Name = "FUNCTIONS_WORKER_RUNTIME",
                        Value = "node"

                    },
                    new NameValuePairArgs
                    {
                        Name = "WEBSITE_NODE_DEFAULT_VERSION",
                        Value = "~14"

                    },
                    new NameValuePairArgs
                    {
                        Name = "WEBSITE_CONTENTSHARE",
                        Value = Output.Format($"{workflowfolder}")

                    },
                    new NameValuePairArgs
                    {
                        Name = "AzureWebJobsStorage",
                        Value = Output.Format($"DefaultEndpointsProtocol=https;AccountName={storageAccount.Name};AccountKey={primaryStorageKey};EndpointSuffix=<http://core.windows.net|core.windows.net>"),
                    },
                    new NameValuePairArgs
                    {
                        Name = "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
                        Value = Output.Format($"DefaultEndpointsProtocol=https;AccountName={storageAccount.Name};AccountKey={primaryStorageKey};EndpointSuffix=<http://core.windows.net|core.windows.net>"),
                    },
                    new NameValuePairArgs
                    {
                        Name = "AzureFunctionsJobHost__extensionBundle__id",
                        Value = "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
                    },
                    new NameValuePairArgs
                    {
                        Name = "AzureFunctionsJobHost__extensionBundle__version",
                        Value = "[1.*, 2.0.0)",
                    },

                    new NameValuePairArgs
                    {
                        Name = "APP_KIND",
                        Value = "workflowapp",
                    },
                },
        },
i
try doing them as a separate resource…
AzureNative.Web.WebAppApplicationSettings
They wont show in your JSON View … you can see them in App Service > Settings > Configuration > Application Settings. If they aren’t showing up there either, try creating
AzureNative.Web.WebAppApplicationSettings
resource and attach it to your app service
w
@icy-doctor-13719 thanks! thatll do it, I am trying to retrieve one of the app settings but when I do var webAppConfigs = GetWebApp.Invoke(new GetWebAppInvokeArgs { Name = standardLogicApp.Name, ResourceGroupName = resourceGroup.Name }).Apply(config => { var data = config.SiteConfig?.AppSettings[0].Value; return Output.Format($"{data}"); }); it comes back null, any idea what I could be doing wrong?
which I guess does make sense now, any idea how I can get those values
i
for use in Pulumi code? or how were you thinking?
w
yes in pulumi code
i
all values? or only certain ones?
w
only one
i
what I do (and replicate at your own risk) … I create every individual app setting as a separate variable, and then create a List of the settings that I want to push to the app, and then send that list to the WebAppApplicationSettings resource. Then if you want the value of an individual setting, reference the original variable
I reference those variable in my Pulumi Outputs e.g. during my CI/CD pipeline on GitHub