azure.mgmt.securityinsight.watchlists.create_or_update() doesn't create the watchlist items
See original GitHub issue- Package Name: azure.mgmt.securityinsight
- Package Version: Latest
- Operating System: Linux
- Python Version:
3.9.12
Describe the bug
This package is using the REST API version: 2022-07-01-preview. When I use
azure.mgmt.securityinsight.watchlists.create_or_update()
, it will create the watchlist, return with 200 response, but it ignores the watchlist items set inraw_content
.
I tried to set the api version to the stable version 2021-10-01
with instance_name.watchlists.api_version = "2021-10-01"
but it doesn’t work.
To Reproduce This is a REST API bug, you can reproduce it by issuing the HTTP api request Steps to reproduce the behavior: 1.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}?api-version=2022-07-01-preview
{
"etag": "\"0300bf09-0000-0000-0000-5c37296e0000\"",
"properties": {
"displayName": "High Value Assets Watchlist",
"source": "Local file",
"provider": "Microsoft",
"description": "Watchlist from CSV content",
"numberOfLinesToSkip": 1,
"rawContent": "This line will be skipped\nheader1,header2\nvalue1,value2",
"itemsSearchKey": "header1",
"contentType": "text/csv"
}
}
This will create the watchlist but the items in the rawContent will be ignored.
- Change the
api-version
to2021-10-01
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}?api-version=2021-10-01
{
"etag": "\"0300bf09-0000-0000-0000-5c37296e0000\"",
"properties": {
"displayName": "High Value Assets Watchlist",
"source": "Local file",
"provider": "Microsoft",
"description": "Watchlist from CSV content",
"numberOfLinesToSkip": 1,
"rawContent": "This line will be skipped\nheader1,header2\nvalue1,value2",
"itemsSearchKey": "header1",
"contentType": "text/csv"
}
}
This will create the watchlist and bulk create the watchlist items
Expected behavior
- when using the method
azure.mgmt.securityinsight.watchlists.create_or_update()
with a watchlist that contains the watchlist items data inraw_content
, it should create/update the watchlist with the watchlist items. - when manually set the api version with
instance_name.watchlists.api_version = "2021-10-01"
, it should use the set api version instead of the default version, which is currently set to2022-07-01-preview
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Watchlist Items - Create Or Update - REST API (Azure Sentinel ...
Learn more about Sentinel service - Create or update a watchlist item. ... A flag that indicates if the watchlist item is deleted...
Read more >Watchlist Items - Create Or Update - REST API (Azure Sentinel)
Learn more about Sentinel service - Creates or updates a watchlist item.
Read more >Watchlists - Create Or Update - REST API (Azure Sentinel)
Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type).
Read more >Watchlists - Create Or Update - REST API (Azure Sentinel)
Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type).
Read more >WatchlistsOperations Class - Microsoft Learn
Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @wanpeng-cds
We will release a new package about
azure.mgmt.securityinsight
2021-10-01Hi @SaurabhSharma-MSFT and @Wzb123456789, thank you so much for the hard work. I can confirm that the new version works!