This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.53k
stars
2.76k
forks
source link
Wrong request build when validating EASM discovery groups #35658
Describe the bug
There is an error in the url the SDK construction at the method build_discovery_groups_validate_request . According to the docs the correspondent path should be {endpoint}/discoGroups:validate but the implementation is like the following{endpoint}/discoGroups/{groupName}:validate. Please not that the groupName is being sent in the request path.
To Reproduce
Steps to reproduce the behavior, fill in with your environment variables:
from azure.defender.easm import EasmClient
from azure.identity import DefaultAzureCredential
subscription_id = "<SUBSCRIPTION_ID>"
resource_group = "<RESOURCE_GROUP>"
discovery_group = {'name': 'test', 'frequencyMilliseconds': 604800000, 'seeds': [{'name': 'thisisatest.microsoft.com', 'kind': 'host'}], 'tier': 'advanced', 'description': 'This is a disco group'}
endpoint = '<LOCATION>.easm.defender.microsoft.com'
client = EasmClient(endpoint, resource_group, subscription_id, workspace["name"], credential=DefaultAzureCredential())
response = client.discovery_groups.validate("test", discovery_group)
Expected behavior
Whenever someone validates a discovery group it should do what the API specifies, validate it.
Curl command working
Screenshots
SDK Failing
Curl command failing:
API Failing when there is no name in the body with internal server error, code 500
Additional context
The following code works to solve this but since the code seems to be autogenerated I will only create an issue here.
Describe the bug There is an error in the url the SDK construction at the method build_discovery_groups_validate_request . According to the docs the correspondent path should be {endpoint}/discoGroups:validate but the implementation is like the following {endpoint}/discoGroups/{groupName}:validate. Please not that the groupName is being sent in the request path.
To Reproduce Steps to reproduce the behavior, fill in with your environment variables:
Expected behavior Whenever someone validates a discovery group it should do what the API specifies, validate it.
Curl command working
Screenshots SDK Failing
Curl command failing:
API Failing when there is no name in the body with internal server error, code 500
Additional context The following code works to solve this but since the code seems to be autogenerated I will only create an issue here.