Azure / Azure/azure-cli

Issue with `az monitor data-collection rule create` when updating existing DCR rule

Open
#29,038 2 comments 0 reactions 1 assignee Claimed by @AllyW View on GitHub
act-observability-squad Auto-Assign Azure CLI Team customer-reported Monitor question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Followed the [guide](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/data-collection-rule-create-edit?tabs=CLI) to update an existing DCR. Modified JSON accordingly and attempted pushing using CLI in Cloud shell. It kept returning error

### Related command

`az monitor data-collection rule create`

### Errors

The command claims DCR kind is different, and blank, while it indeed is not. It is further confirmed as using the API variant from the docs, with the same JSON file, worked with no issue.

```
(InvalidPayload) The new DCR kind `` is different from the previous one `Linux`. The kind is immutable.
Code: InvalidPayload
Message: The new DCR kind `` is different from the previous one `Linux`. The kind is immutable.
Exception Details: (InvalidPayload) The new DCR kind `` is different from the previous one `Linux`. The kind is immutable.
Code: InvalidPayload
Message: The new DCR kind `` is different from the previous one `Linux`. The kind is immutable.
```

### Issue script & Debug output

N/A

### Expected behavior

DCR is pushed successfully

### Environment Summary

azure-cli 2.61.0

core 2.61.0
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
ml 2.26.0
monitor-control-service 1.0.2
ssh 2.0.3

Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.