Skip to content

Commit 30dbdde

Browse files
author
SDKAuto
committed
CodeGen from PR 34006 in Azure/azure-rest-api-specs
Merge 6cc659de67576bdedf53855ec4dcad2ed42a03ed into 877f166d9819e61625338a9ebb9922e1fc646636
1 parent 90ca562 commit 30dbdde

File tree

135 files changed

+665
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+665
-689
lines changed

sdk/kusto/azure-mgmt-kusto/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 4.0.0 (2025-04-18)
4+
5+
### Breaking Changes
6+
7+
- Method `KustoManagementClient.__init__` parameter `base_url` changed default value from `str` to `none`
8+
39
## 3.4.0 (2024-01-24)
410

511
### Features Added

sdk/kusto/azure-mgmt-kusto/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Kusto Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "63d36000794ed89006cda8588861a2ae7ed96bdc",
2+
"commit": "2e99511bfd9ef9cf31ecd616bc9c0af63dfc6808",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.27.4",
6+
"@autorest/python@6.33.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.33.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/azure-kusto/resource-manager/readme.md"
1111
}

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import KustoManagementClientConfiguration
@@ -88,7 +90,7 @@ class KustoManagementClient: # pylint: disable=too-many-instance-attributes
8890
:type credential: ~azure.core.credentials.TokenCredential
8991
:param subscription_id: The ID of the target subscription. Required.
9092
:type subscription_id: str
91-
:param base_url: Service URL. Default value is "https://management.azure.com".
93+
:param base_url: Service URL. Default value is None.
9294
:type base_url: str
9395
:keyword api_version: Api Version. Default value is "2024-04-13". Note that overriding this
9496
default value may result in unsupported behavior.
@@ -98,15 +100,17 @@ class KustoManagementClient: # pylint: disable=too-many-instance-attributes
98100
"""
99101

100102
def __init__(
101-
self,
102-
credential: "TokenCredential",
103-
subscription_id: str,
104-
base_url: str = "https://management.azure.com",
105-
**kwargs: Any
103+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
106104
) -> None:
105+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
106+
_endpoints = get_arm_endpoints(_cloud)
107+
if not base_url:
108+
base_url = _endpoints["resource_manager"]
109+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
107110
self._config = KustoManagementClientConfiguration(
108-
credential=credential, subscription_id=subscription_id, **kwargs
111+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
109112
)
113+
110114
_policies = kwargs.pop("policies", None)
111115
if _policies is None:
112116
_policies = [
@@ -125,7 +129,7 @@ def __init__(
125129
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
126130
self._config.http_logging_policy,
127131
]
128-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
132+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
129133

130134
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
131135
self._serialize = Serializer(client_models)

0 commit comments

Comments
 (0)