pulumi-azure: AppService: Changing AppSettings after initial launch throws error

Set up:

Use one of these azure app service examples: (Although probably any of the azure-XX-appservice examples will show the same issue.)

Launch the stack.

  • Go to Azure console, select the resource group that was created by the stack, select the “App Service” that was created by the stack.
  • In the console panel along the left, find Settings/Configuration and select that.
  • In the Configuration view, you will see a section named “Application settings” and in that section you will see the 4 settings created by the pulumi code. (e.g. APPINSIGHTS_INSTRUMENTATIONKEY, APPLICATIONINSIGHTS_CONNECTION_STRING, etc).

How to cause the error

  • Go to the pulumi code and add an AppSetting, it can be any key:value pair, so for example add MY_NEW_SETTING: "new setting
  • pulumi up to apply the change

This will cause an error like that shown at the bottom.

However, if you refresh the azure console for the App Service (click the refresh button and the continue button in the console), you will see the new setting was added. Furthermore, if you had made other changes as part of the update, and those changes were not executed before this error, those changes are not made. Any pulumi up from this point forward will fail until you do a pulumi refresh.

WORK AROUND

Run pulumi refresh after the error. This will synchronize the AppSettings and allow subsequent updates (for non-AppSettings) to work. Subsequent AppSettings changes will, naturally, throw the error on pulumi up and will require another pulumi refresh

pulumi up error after changing AppSettings

Diagnostics:
  azure:appservice:AppService (mitchts-as):
    error: transport is closing
 
  pulumi:pulumi:Stack (azure-appservice-dev):
    panic: interface conversion: interface {} is nil, not map[string]interface {}
    goroutine 48 [running]:
    github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web.expandAppServiceLogs(0x5310fe0, 0xc0014cb3e0, 0x4, 0x5310fe0, 0xc0014cb3e0, 0x1)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-azurerm@v1.41.1-0.20201016142117-857b1cde95f3/azurerm/internal/services/web/app_service.go:1382 +0xcad
    github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web.resourceArmAppServiceUpdate(0xc000a76770, 0x549e2c0, 0xc000164b00, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-azurerm@v1.41.1-0.20201016142117-857b1cde95f3/azurerm/internal/services/web/resource_arm_app_service.go:487 +0x1c40
    github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0006e9950, 0xc0005e8550, 0xc0015be300, 0x549e2c0, 0xc000164b00, 0x1, 0xffffffffffffffff, 0x0)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.13.1/helper/schema/resource.go:316 +0x263
    github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00019cd80, 0xc0019375e0, 0xc0005e8550, 0xc0015be300, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.13.1/helper/schema/provider.go:294 +0x99
    github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfshim/sdk-v1.v1Provider.Apply(0xc00019cd80, 0x5c05520, 0x13, 0x65cddc0, 0xc0005e8550, 0x65e8be0, 0xc0015be300, 0x0, 0x65e8be0, 0xc0015be300, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v2@v2.11.0/pkg/tfshim/sdk-v1/provider.go:97 +0xe5
    github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge.(*Provider).Update(0xc000a4e380, 0x65ca540, 0xc0008c0930, 0xc0011a2000, 0xc000a4e380, 0x550e201, 0xc000bea300)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v2@v2.11.0/pkg/tfbridge/provider.go:957 +0x959
    github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Update_Handler.func1(0x65ca540, 0xc0008c0930, 0x5911d40, 0xc0011a2000, 0x58f92e0, 0xa074d00, 0x65ca540, 0xc0008c0930)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v2@v2.11.3-0.20201009201355-249140242ebb/proto/go/provider.pb.go:2280 +0x89
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x65ca540, 0xc0008c0000, 0x5911d40, 0xc0011a2000, 0xc001926240, 0xc001926260, 0x0, 0x0, 0x654c7c0, 0xc00027f840)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2eb
    github.com/pulumi/pulumi/sdk/v2/proto/go._ResourceProvider_Update_Handler(0x59c8e80, 0xc000a4e380, 0x65ca540, 0xc0008c0000, 0xc00141e000, 0xc000549760, 0x65ca540, 0xc0008c0000, 0xc0000bc600, 0x12b5)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v2@v2.11.3-0.20201009201355-249140242ebb/proto/go/provider.pb.go:2282 +0x14b
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a4e1c0, 0x6611320, 0xc000782900, 0xc0001aa100, 0xc001132c90, 0xa0378b8, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/server.go:1171 +0x50a
    google.golang.org/grpc.(*Server).handleStream(0xc000a4e1c0, 0x6611320, 0xc000782900, 0xc0001aa100, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/server.go:1494 +0xccd
    google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000dcc050, 0xc000a4e1c0, 0x6611320, 0xc000782900, 0xc0001aa100)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/server.go:834 +0xa1
    created by google.golang.org/grpc.(*Server).serveStreams.func1
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.30.0/server.go:832 +0x204
 
    error: update failed

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 18 (3 by maintainers)

Most upvoted comments

For the web.expandAppServiceLogs panic, the simplest workaround is to specify the httplogs setting:

ie, for C#:

               Logs = new AppServiceLogsArgs
                {
                    HttpLogs = new AppServiceLogsHttpLogsArgs
                    {
                        FileSystem = new AppServiceLogsHttpLogsFileSystemArgs { RetentionInDays = 14, RetentionInMb = 35 }
                    }
                }

This problem has been around for a long time now and really needs to be fixed.

@bascoder Just need to add that Log property to your current AppService description. I did this to a project I’m working on and it works; weeks later, a colleague had this issue and we fixed it with the same workaround.