Skip to content

Delete Azure Monitor workspace: HttpResponseError: Operation returned an invalid status 'Accepted' #39973

Open
@davidkhala

Description

@davidkhala
  • Package Name:
    azure-mgmt-monitor

  • Package Version:
    6.0.2

  • Operating System:
    windows 11

  • Python Version:
    3.12

Describe the bug
When we try to delete a Azure Monitor workspace, it prompts error like

FAILED (errors=1)

Error
Traceback (most recent call last):
  File "C:\Users\User\Documents\GitHub\azure-utils\py\tests\log_test.py", line 40, in test_workspace_delete
    self.workspace.delete(rg, self.name)
  File "C:\Users\User\Documents\GitHub\azure-utils\py\davidkhala\azure\monitor.py", line 55, in delete
    self.azure_monitor_workspaces.delete(resource_group_name, name)
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\azure-utils-7eW6Y8lI-py3.12\Lib\site-packages\azure\core\tracing\decorator.py", line 105, in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\pypoetry\Cache\virtualenvs\azure-utils-7eW6Y8lI-py3.12\Lib\site-packages\azure\mgmt\monitor\v2021_06_03_preview\operations\_azure_monitor_workspaces_operations.py", line 858, in delete
    raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Accepted'

To Reproduce
Steps to reproduce the behavior:

  1. create an Azure Monitor workspace like
azure_monitor_workspaces.create(
            resource_group_name, name,
            AzureMonitorWorkspaceResource(location=location)
        )
  1. delete an Azure Monitor workspace like
azure_monitor_workspaces.delete(resource_group_name, name)

Expected behavior
delete with success

Screenshots

Additional context
I wonder whether the python packages in use are deprecated. They are

from azure.mgmt.monitor import MonitorManagementClient
from azure.mgmt.monitor.v2021_06_03_preview.models import AzureMonitorWorkspaceResource
from azure.mgmt.monitor.v2021_06_03_preview.operations import AzureMonitorWorkspacesOperations
from azure.mgmt.monitor.v2022_06_01.models import KnownColumnDefinitionType

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

MgmtThis issue is related to a management-plane library.MonitorMonitor, Monitor Ingestion, Monitor Querycustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions