question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az monitor log-analytics workspace delete force does not work

See original GitHub issue

Describe the bug

When an Azure LogAnalytics workspace is deleted, it gets soft-deleted by default, enabling us to restore it. However, we may want to to a hard delete, which is supported by REST API.

The --force flag should do that, but as you can see running the following commands, the workspace is soft-deleted.

Command Name az monitor log-analytics workspace delete

Errors:

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az monitor log-analytics workspace create --resource-group pepito --workspace-name pepito-logs
  • az monitor log-analytics workspace delete --resource-group pepito --workspace-name pepito-logs --force true --yes
  • az monitor log-analytics workspace list-deleted-workspaces | jq '.[].name'
  • pepito-logs appears on the output

Expected Behavior

The pepito-logs environment shouldn’t appear on the list

Environment Summary

macOS-10.15.4-x86_64-i386-64bit
Python 3.8.3
Installer: HOMEBREW

azure-cli 2.7.0

Extensions:
log-analytics 0.2.1

Additional Context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
yoramsingercommented, Jun 22, 2020

@aarroyoc , thanks for reporting. This is a known issue that was already fixed, and should be available in all regions by tomorrow. All deleted workspaces are kept in the backend for 14 days until the data is purged. The difference between force and soft deletes is that for force we release the workspace name where in soft we keep it for you, since names are globally unique. The bug was that we displayed force delete workspaces in the list instead of hiding them.

0reactions
aarroyoccommented, Jun 25, 2020

It seems to be working right now. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delete and recover Azure Log Analytics workspace
To permanently delete a workspace using the Azure portal, select the Delete the workspace permanently checkbox before clicking the Delete button ...
Read more >
How to delete old Log-analytics-workspace permanently in ...
If you deleted in the portal the default behavior is a soft delete. To delete forcefully you need to run some powershell
Read more >
azurerm_log_analytics_workspace | hashicorp/azurerm
delete - (Defaults to 30 minutes) Used when deleting the Log Analytics Workspace. Import. Log Analytics Workspaces can be imported using the resource...
Read more >
Create a Log Analytics workspace and Manage access to log ...
Azure Monitor, on the other hand, keeps log data in a Log Analytics workspace. ... If you don't have access to customise the...
Read more >
Purging Table Data from a log Analytics Workspace
I was working on a solution recently that uses Log Analytics to store ... It's certainly not as straight-forward as deleting data from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found