Skip to content

Commit 1e67514

Browse files
author
Saksham Garg
committed
update ManagedCleanroom frontend cmdlets
1 parent fafb390 commit 1e67514

File tree

18 files changed

+581
-97
lines changed

18 files changed

+581
-97
lines changed

src/managedcleanroom/HISTORY.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Release History
55

66
1.0.0b4
77
+++++++
8+
* Regenerated analytics_frontend_api SDK from V2026_03_01_Preview OpenAPI specification
9+
* BREAKING CHANGE: All frontend API endpoints now require api-version=2026-03-01-preview query parameter
10+
* Added: --api-version parameter to all frontend commands (default: 2026-03-01-preview)
11+
* Updated: SDK client now automatically injects api-version into all API requests
812
* BREAKING CHANGE: Removed deprecated commands (APIs no longer supported in SDK):
913
- `az managedcleanroom frontend workloads list`
1014
- `az managedcleanroom frontend analytics deploymentinfo`
@@ -24,7 +28,6 @@ Release History
2428
* Updated: Added --pending-only filter to invitation list command
2529
* Updated: Added --scope, --from-seqno, --to-seqno filters to audit event list command
2630
* Updated: Response structures modernized (many list endpoints now return structured objects with value arrays)
27-
* Updated: Regenerated frontend SDK from OpenAPI spec to support new APIs
2831

2932
1.0.0b3
3033
+++++++

src/managedcleanroom/azext_managedcleanroom/_frontend_auth.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ def get_frontend_token(cmd):
3030
profile = Profile(cli_ctx=cmd.cli_ctx)
3131
subscription = get_subscription_id(cmd.cli_ctx)
3232

33-
# Priority 0: explicit token via environment variable (for local/test envs only)
33+
# Priority 0: explicit token via environment variable (for local/test envs
34+
# only)
3435
env_token = os.environ.get('MANAGEDCLEANROOM_ACCESS_TOKEN')
3536
if env_token:
36-
logger.warning("Using token from MANAGEDCLEANROOM_ACCESS_TOKEN env var FOR TESTING PURPOSES ONLY")
37+
logger.warning(
38+
"Using token from MANAGEDCLEANROOM_ACCESS_TOKEN env var FOR TESTING PURPOSES ONLY")
3739
from collections import namedtuple
3840
AccessToken = namedtuple('AccessToken', ['token', 'expires_on'])
3941
token_obj = AccessToken(token=env_token, expires_on=0)
@@ -87,7 +89,7 @@ def set_frontend_config(cmd, endpoint):
8789
endpoint)
8890

8991

90-
def get_frontend_client(cmd, endpoint=None):
92+
def get_frontend_client(cmd, endpoint=None, api_version=None):
9193
"""Create Analytics Frontend API client with Azure authentication
9294
9395
Uses Profile.get_raw_token() to fetch access token from Azure context.
@@ -96,12 +98,18 @@ def get_frontend_client(cmd, endpoint=None):
9698
:param cmd: CLI command context
9799
:param endpoint: Optional explicit endpoint URL (overrides config)
98100
:type endpoint: str
101+
:param api_version: Optional API version (defaults to 2026-03-01-preview)
102+
:type api_version: str
99103
:return: Configured AnalyticsFrontendAPI client
100104
:raises: CLIError if token fetch fails or endpoint not configured
101105
"""
102106
from .analytics_frontend_api import AnalyticsFrontendAPI
103107
from azure.core.pipeline.policies import BearerTokenCredentialPolicy, SansIOHTTPPolicy
104108

109+
# Use provided api_version or default
110+
if api_version is None:
111+
api_version = '2026-03-01-preview'
112+
105113
api_endpoint = endpoint or get_frontend_config(cmd)
106114
if not api_endpoint:
107115
raise CLIError(
@@ -172,5 +180,6 @@ def on_request(self, request):
172180
# Return configured client
173181
return AnalyticsFrontendAPI(
174182
endpoint=api_endpoint,
183+
api_version=api_version,
175184
authentication_policy=auth_policy
176185
)

src/managedcleanroom/azext_managedcleanroom/_frontend_commands.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def load_frontend_command_table(loader, _):
3737

3838
# OIDC commands
3939
with loader.command_group('managedcleanroom frontend oidc', custom_command_type=frontend_custom) as g:
40-
g.custom_command('set-issuer-url', 'frontend_collaboration_oidc_set_issuer_url')
40+
g.custom_command(
41+
'set-issuer-url',
42+
'frontend_collaboration_oidc_set_issuer_url')
4143
g.custom_show_command('keys', 'frontend_collaboration_oidc_keys_show')
4244

4345
# Keep issuerinfo for backwards compatibility
@@ -56,7 +58,9 @@ def load_frontend_command_table(loader, _):
5658
g.custom_command('list', 'frontend_collaboration_dataset_list')
5759
g.custom_show_command('show', 'frontend_collaboration_dataset_show')
5860
g.custom_command('publish', 'frontend_collaboration_dataset_publish')
59-
g.custom_command('queries', 'frontend_collaboration_dataset_queries_list')
61+
g.custom_command(
62+
'queries',
63+
'frontend_collaboration_dataset_queries_list')
6064

6165
# Consent commands
6266
with loader.command_group('managedcleanroom frontend consent', custom_command_type=frontend_custom) as g:

0 commit comments

Comments
 (0)