Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
412 stars 200 forks source link

azd provision segfault with bicep extension microsoftGraph #4169

Closed scrocquesel-ml150 closed 3 months ago

scrocquesel-ml150 commented 3 months ago

Output from azd version azd version 1.9.5 (commit cd2b7af9995d358aab33c782614f801ac1997dde)

Describe the bug

  (✓) Done: Resource group: rg-test-identity
  (✓) Done: Key Vault: kv-otcapmyy7z4tq
  (✓) Done: Storage account: stotcapmyy7z4tq
  (✓) Done: App Service plan: plan-otcapmyy7z4tq
  (✓) Done: Log Analytics workspace: log-otcapmyy7z4tq
  |=======| Creating/Updating resourcespanic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x558496283dbd]

goroutine 68 [running]:
github.com/azure/azure-dev/cli/azd/pkg/infra.(*AzureResourceManager).GetDeploymentResourceOperations(0xc0004b7c30?, {0x558496f25168, 0xc0002126f0}, {0x558496f2acc0, 0xc000435e40}, 0xc0004b7c98?)
        /mnt/vss/_work/1/s/cli/azd/pkg/infra/azure_resource_manager.go:72 +0x6dd
github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning.(*ProvisioningProgressDisplay).ReportProgress(0xc0004b7f90, {0x558496f25168, 0xc0002126f0}, 0x0?)
        /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/provisioning_progress_display.go:84 +0x37c
github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).Deploy.func2()
        /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:633 +0x485
created by github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).Deploy in goroutine 1
        /mnt/vss/_work/1/s/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go:610 +0x465

To Reproduce From a quickstart sample, try to provision a graph resource from main.bicep

extension microsoftGraph

resource app 'Microsoft.Graph/applications@v1.0' = {
  displayName: 'test'
  uniqueName: 'test'

}

Expected behavior No error

Additional context

ellismg commented 3 months ago

Thanks for opening this, @scrocquesel-ml150. I opened #4187 which should address this issue. I did a deployment that included an Microsoft.Graph/applications@v1.0 resource with the changes and they addressed the panic. There should be privates shortly if you want to pick them up and play around with them as well.