Output from azd version
% docker run --rm mcr.microsoft.com/azure-dev-cli-apps:1.3.1 azd version
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
azd version 1.3.1 (commit b5030da0f29ffe98664c40450187fd8a4cb0d157)
Describe the bug
An go error is thrown when azd provision is ran:
2023-09-26T16:53:41.6892285Z Provisioning Azure resources (azd provision)
2023-09-26T16:53:41.6892558Z Provisioning Azure resources can take some time
2023-09-26T16:53:41.6892661Z
2023-09-26T16:53:41.7108538Z Downloading Bicep
2023-09-26T16:53:47.9599014Z Creating a deployment plan
2023-09-26T16:53:53.0771984Z Retrieving subscriptions...
2023-09-26T16:54:00.7781200Z panic: unexpected bicep type: ''
2023-09-26T16:54:00.7781714Z
2023-09-26T16:54:00.7782015Z goroutine 1 [running]:
2023-09-26T16:54:00.7790655Z github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).mapBicepTypeToInterfaceType(0x564cbb4c1780?, {0x0?, 0xc000015180?})
2023-09-26T16:54:00.7791329Z /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:1348 +0x22c
2023-09-26T16:54:00.7792572Z github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).ensureParameters(0xc0003dd110, {0x564cbb6379c8, 0xc0004d45d0}, {{0xc000044660, 0x5b}, {0xc000014dd0, 0x7}, 0xc0002ec450, 0xc0002ec840}, 0xc000207650)
2023-09-26T16:54:00.7793141Z /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:1575 +0x75d
2023-09-26T16:54:00.7793777Z github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).plan(0xc0003dd110, {0x564cbb6379c8, 0xc0004d45d0})
2023-09-26T16:54:00.7794244Z /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:354 +0x25a
2023-09-26T16:54:00.7795029Z github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).Deploy(0xc0003dd110, {0x564cbb6379c8?, 0xc0004d45d0?})
2023-09-26T16:54:00.7795496Z /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:417 +0x6b
2023-09-26T16:54:00.7796106Z github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning.(*Manager).Deploy(0xc0004745b0, {0x564cbb6379c8, 0xc0004d45d0})
2023-09-26T16:54:00.7796549Z /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/manager.go:56 +0x32
2023-09-26T16:54:00.7797019Z github.com/azure/azure-dev/cli/azd/cmd.(*provisionAction).Run.func1()
2023-09-26T16:54:00.7797396Z /mnt/vss/_work/1/s/cli/azd/cmd/provision.go:148 +0x71
2023-09-26T16:54:00.7798102Z github.com/azure/azure-dev/cli/azd/pkg/ext.(*EventDispatcher[...]).Invoke(0x564cbb641a80?, {0x564cbb6379c8, 0xc0004d45d0}, {0x564cbaf9896c, 0x9}, {0xc0004a86e0, 0x0?}, 0xc000340be8?)
2023-09-26T16:54:00.7798591Z /mnt/vss/_work/1/s/cli/azd/pkg/ext/event_dispatcher.go:113 +0x24b
2023-09-26T16:54:00.7799160Z github.com/azure/azure-dev/cli/azd/cmd.(*provisionAction).Run(0xc000474690, {0x564cbb6379c8, 0xc0004d45d0})
2023-09-26T16:54:00.7799568Z /mnt/vss/_work/1/s/cli/azd/cmd/provision.go:143 +0x3f7
2023-09-26T16:54:00.7800136Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x564cbb6379c8?, 0xc0004d45d0?})
2023-09-26T16:54:00.7800577Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:127 +0x2e8
2023-09-26T16:54:00.7801327Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*HooksMiddleware).registerCommandHooks(0xc00048dcc0?, {0x564cbb6379c8, 0xc0004d45d0}, 0x564cba717fa5?, 0xc0004a86e0?, 0xc00048d9c0)
2023-09-26T16:54:00.7801809Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/hooks.go:83 +0x2f5
2023-09-26T16:54:00.7802409Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*HooksMiddleware).Run(0xc00048dcc0, {0x564cbb6379c8?, 0xc0004d4450?}, 0xc00048d9c0)
2023-09-26T16:54:00.7802851Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/hooks.go:67 +0x1d8
2023-09-26T16:54:00.7803444Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x564cbb6379c8, 0xc0004d4450})
2023-09-26T16:54:00.7803878Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
2023-09-26T16:54:00.7804522Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*TelemetryMiddleware).Run(0xc00006eff0, {0x564cbb6379c8, 0xc000497b30}, 0xc00048d9c0)
2023-09-26T16:54:00.7805184Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/telemetry.go:75 +0x759
2023-09-26T16:54:00.7805759Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x564cbb6379c8, 0xc000497b30})
2023-09-26T16:54:00.7806189Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
2023-09-26T16:54:00.7841878Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*ExperimentationMiddleware).Run(0x564cbaf9f71e?, {0x564cbb6379c8, 0xc000497b30}, 0xc00048d9c0)
2023-09-26T16:54:00.7842567Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/experimentation.go:64 +0x4d6
2023-09-26T16:54:00.7843189Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x564cbb6379c8, 0xc000497b30})
2023-09-26T16:54:00.7843626Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
2023-09-26T16:54:00.7844253Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*DebugMiddleware).Run(0xc00048eb70, {0x564cbb6379c8, 0xc000497b30}, 0xc00048d9c0)
2023-09-26T16:54:00.7845791Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/debug.go:48 +0x311
2023-09-26T16:54:00.7846525Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction.func1({0x564cbb6379c8, 0xc000497b30})
2023-09-26T16:54:00.7847484Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:125 +0x2a2
2023-09-26T16:54:00.7848115Z github.com/azure/azure-dev/cli/azd/cmd/middleware.(*MiddlewareRunner).RunAction(0xc000415230, {0x564cbb6379c8, 0xc000497b30}, 0x564cbb403ce0?, {0x564cbb62d098?, 0xc000474690})
2023-09-26T16:54:00.7848506Z /mnt/vss/_work/1/s/cli/azd/cmd/middleware/middleware.go:131 +0x226
2023-09-26T16:54:00.7849146Z github.com/azure/azure-dev/cli/azd/cmd.(*CobraBuilder).configureActionResolver.func1(0xc00040e500, {0xc0004af6a0?, 0x0, 0x1})
2023-09-26T16:54:00.7849487Z /mnt/vss/_work/1/s/cli/azd/cmd/cobra_builder.go:143 +0x4ef
2023-09-26T16:54:00.7849767Z github.com/spf13/cobra.(*Command).execute(0xc00040e500, {0xc0004af690, 0x1, 0x1})
2023-09-26T16:54:00.7850081Z /home/cloudtest/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:856 +0x694
2023-09-26T16:54:00.7850371Z github.com/spf13/cobra.(*Command).ExecuteC(0xc0003b9900)
2023-09-26T16:54:00.7850658Z /home/cloudtest/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x38d
2023-09-26T16:54:00.7850931Z github.com/spf13/cobra.(*Command).Execute(...)
2023-09-26T16:54:00.7851191Z /home/cloudtest/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
2023-09-26T16:54:00.7851516Z github.com/spf13/cobra.(*Command).ExecuteContext(0x564cbb108400?, {0x564cbb637990?, 0x564cbbc8da00?})
2023-09-26T16:54:00.7851843Z /home/cloudtest/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:895 +0x47
2023-09-26T16:54:00.7852083Z main.main()
2023-09-26T16:54:00.7852291Z /mnt/vss/_work/1/s/cli/azd/main.go:61 +0x1f0
2023-09-26T16:54:00.7942524Z ##[error]Script failed with exit code: 2
2023-09-26T16:54:00.7993788Z [command]/usr/bin/az account clear
2023-09-26T16:54:01.6658122Z ##[section]Finishing: Provision Infrastructure
To Reproduce
I'm currently trying to provision infrastructure via the azd provision command using the new feature, "user defined types", enabled via bicepconfig.json:
{
// See https://aka.ms/bicep/config for more information on Bicep configuration options
// Press CTRL+SPACE/CMD+SPACE at any location to see Intellisense suggestions
"analyzers": {
"core": {
"rules": {
"no-unused-params": {
"level": "error"
}
}
}
},
"experimentalFeaturesEnabled": {
"extensibility": true,
"userDefinedTypes": true,
"compileTimeImports": true
}
}
Here is the simple user defined type I created:
@export()
type environmentTypes = 'sandbox' | 'dev' | 'test' | 'prod'
Expected behavior
The stack trace isn't very helpful and I don't know where in my bicep code is causing the crash. At least tell me the line number in the compiled ARM json file where it throws the error.
Output from
azd versionDescribe the bug
An go error is thrown when
azd provisionis ran:To Reproduce
I'm currently trying to provision infrastructure via the
azd provisioncommand using the new feature, "user defined types", enabled viabicepconfig.json:{ // See https://aka.ms/bicep/config for more information on Bicep configuration options // Press CTRL+SPACE/CMD+SPACE at any location to see Intellisense suggestions "analyzers": { "core": { "rules": { "no-unused-params": { "level": "error" } } } }, "experimentalFeaturesEnabled": { "extensibility": true, "userDefinedTypes": true, "compileTimeImports": true } }Here is the simple user defined type I created:
Expected behavior
The stack trace isn't very helpful and I don't know where in my bicep code is causing the crash. At least tell me the line number in the compiled ARM json file where it throws the error.