Skip to content

Configure observability for the vnet-app Storage Account - #615

Open
Roger Doherty (MSFT) (doherty100) wants to merge 2 commits into
vnextfrom
feature/608-storage-observability
Open

Configure observability for the vnet-app Storage Account#615
Roger Doherty (MSFT) (doherty100) wants to merge 2 commits into
vnextfrom
feature/608-storage-observability

Conversation

@doherty100

Copy link
Copy Markdown
Contributor

Summary

Integrates the vnet-app Storage Account with the observability framework (shared Log Analytics workspace), closing the gap where the storage account emitted no diagnostics while sibling resources (Container Registry, Application Insights) already did.

Fixes #608.

Changes

  • modules/vnet-app/storage.tf — Add azurerm_monitor_diagnostic_setting.storage_blob and .storage_file targeting the blobServices/default and fileServices/default sub-resources, emitting StorageRead, StorageWrite, StorageDelete logs and Transaction metrics to var.log_analytics_workspace_id. StorageRead/Write/Delete logs live at the sub-service scope, so both sub-services are targeted. Queue/table are intentionally omitted since the account only uses blob and file.
  • modules/vnet-app/main.tf — Include the two diagnostic setting IDs in the storage_operations_complete barrier signal so the public-access barrier waits for them before disabling public network access.
  • modules/vnet-app/scripts/Test-VnetApp.ps1 — Add Test 19 verifying the blob and file diagnostic settings stream the expected logs + Transaction metrics to a Log Analytics workspace (via ARM diagnosticSettings GET on each sub-resource).
  • READMEs — Update modules/vnet-app/README.md resources table and the root README.md storage bullets.

Acceptance criteria

  • Blob/file diagnostic logs + transaction metrics flow to the shared Log Analytics workspace.
  • Unit test added to verify the diagnostic settings exist.
  • modules/vnet-app/README.md and root README.md resources tables updated.
  • ./scripts/Invoke-CIChecks.sh terraform markdown passes (also ran powershell).

Notes

The existing log_analytics_workspace_id module input is reused — no new variables or root wiring required. No terraform apply was run; validation is via local CI checks (terraform fmt, tflint, markdownlint, PSScriptAnalyzer — all pass).

Wire the observability framework (diagnostic settings to the shared Log
Analytics workspace) into the vnet-app storage account, mirroring the
container registry.

- Add azurerm_monitor_diagnostic_setting resources on the blob and file
  sub-services emitting StorageRead/StorageWrite/StorageDelete logs and
  Transaction metrics to the shared Log Analytics workspace. Queue and
  table services are omitted since the account only uses blob and file.
- Include the new diagnostic settings in the storage_operations_complete
  barrier signal so the public-access barrier waits for them before
  disabling public network access.
- Add a unit test verifying the blob and file diagnostic settings stream
  the expected logs and metrics to Log Analytics.
- Update module and root README documentation.

Fixes #608

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Diagnostic settings are control-plane resources and their log/metric
delivery flows service-to-service on the Azure backend, so they do not
traverse the storage account's public_network_access boundary. They do
not need to gate the public-access barrier; revert the
storage_operations_complete signal to its original blob/share writes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant