hashicorp / hashicorp/packer-plugin-azure
Enable Boot Diagnostics with Managed Storage Account
- Dominant language
- Go
- Stars
- 63
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
#### Community Note
Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
#### Description
As recommended by [Microsoft](https://learn.microsoft.com/en-us/azure/virtual-machines/boot-diagnostics#boot-diagnostics-storage-account), using a managed storage account for boot diagnostics provides significant performance improvements when creating Azure VMs, by eliminating the need to create a separate storage account for boot diagnostics data.
Additionally, it simplifies management by removing any consideration for manually cleaning up storage accounts that store the serial console log and screenshot file after the VM build is completed.
#### Potential configuration
The ideal solution would be to implement it the same way it is done for a Virtual Machine in Terraform, using an optional block: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_virtual_machine#boot_diagnostics
```
boot_diagnostics {
storage_account_uri = null
}
```
NOTE: Passing a null value will utilize a Managed Storage Account to store Boot Diagnostics.
#### Potential References
I was hoping this could be as simple as implementing a conditional if statement to make the following property (`StorageUri`) optional: https://github.com/hashicorp/packer-plugin-azure/blob/93909bcb17b16d207ee60207ff50d7cf8809b47d/builder/azure/common/template/template_builder.go#L539
Contributor guide
Research direction
Start in builder/azure/common/template/template_builder.go around the StorageUri property, and compare the optional boot_diagnostics behavior in the Terraform Azure VM resource. Confirm how a null or omitted storage URI is passed to Azure, then verify that VM boot diagnostics use a managed storage account without requiring a separate account.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100