Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/managedcleanroom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ Release History
1.0.0b2
++++++
* Add frontend commandlets
* Add MSAL device code flow authentication
* Add MSAL device code flow authentication

1.0.0b3
++++++
* Update commands to reflect new API version 2026-03-31-preview
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"managedcleanroom",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Clean Room
"""Manage Azure Confidential Clean Room
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
class AddCollaborator(AAZCommand):
"""Adds a collaborator to a collaboration.

:example: Add Collaborator
az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --email alice@example.com
:example: Add Collaborator(User)
az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --user-identifier "alice@contoso.com"

:example: Add Collaborator(Service Principal)
az managedcleanroom collaboration add-collaborator --resource-group testrg --collaboration-name ContosoCollaboration --user-identifier "0d6b305c-85ee-419f-9c87-d3405c24aab6" --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47" --object-id "0f8fad5b-d9cb-469f-a165-70867728950e"
"""

_aaz_info = {
"version": "2025-10-31-preview",
"version": "2026-03-31-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator", "2025-10-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator", "2026-03-31-preview"],
]
}

Expand Down Expand Up @@ -59,14 +62,23 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)

# define Arg Group "Body"
# define Arg Group "Collaborator"

_args_schema = cls._args_schema
_args_schema.email = AAZStrArg(
options=["--email"],
arg_group="Body",
help="Email of the collaborator to be added.",
required=True,
_args_schema.object_id = AAZStrArg(
options=["--object-id"],
arg_group="Collaborator",
help="Object ID of the collaborator.",
)
_args_schema.tenant_id = AAZStrArg(
options=["--tenant-id"],
arg_group="Collaborator",
help="Tenant ID of the collaborator.",
)
_args_schema.user_identifier = AAZStrArg(
options=["--user-identifier"],
arg_group="Collaborator",
help="User identifier of the collaborator. This can be specified as an email (no OID/TID should be specified) or an SPN (OID/TID required).",
)
return cls._args_schema

Expand Down Expand Up @@ -151,7 +163,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-10-31-preview",
"api-version", "2026-03-31-preview",
required=True,
),
}
Expand All @@ -176,7 +188,13 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("email", AAZStrType, ".email", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("collaborator", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})

collaborator = _builder.get(".collaborator")
if collaborator is not None:
collaborator.set_prop("objectId", AAZStrType, ".object_id")
collaborator.set_prop("tenantId", AAZStrType, ".tenant_id")
collaborator.set_prop("userIdentifier", AAZStrType, ".user_identifier")

return self.serialize_content(_content_value)

Expand Down Expand Up @@ -225,14 +243,15 @@ def _build_schema_on_200(cls):
serialized_name="clusterEndpoint",
flags={"read_only": True},
)
properties.collaboration_state = AAZStrType(
serialized_name="collaborationState",
flags={"read_only": True},
)
properties.collaborators = AAZListType()
properties.consortium_arm_id = AAZStrType(
serialized_name="consortiumArmId",
flags={"read_only": True},
)
properties.consortium_type = AAZStrType(
serialized_name="consortiumType",
flags={"required": True},
)
properties.health = AAZObjectType(
flags={"read_only": True},
)
Expand All @@ -244,14 +263,28 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.user_identity = AAZObjectType(
serialized_name="userIdentity",
flags={"required": True},
)
properties.workloads = AAZListType(
flags={"read_only": True},
)

collaborators = cls._schema_on_200.properties.collaborators
collaborators.Element = AAZObjectType()

_element = cls._schema_on_200.properties.collaborators.Element
_element.is_collaboration_owner = AAZBoolType(
serialized_name="isCollaborationOwner",
flags={"read_only": True},
)
_element.object_id = AAZStrType(
serialized_name="objectId",
)
_element.tenant_id = AAZStrType(
serialized_name="tenantId",
)
_element.user_identifier = AAZStrType(
serialized_name="userIdentifier",
)

health = cls._schema_on_200.properties.health
health.health_issues = AAZListType(
serialized_name="healthIssues",
Expand Down Expand Up @@ -283,20 +316,6 @@ def _build_schema_on_200(cls):
_element = cls._schema_on_200.properties.managed_on_behalf_of_configuration.mobo_broker_resources.Element
_element.id = AAZStrType()

user_identity = cls._schema_on_200.properties.user_identity
user_identity.account_type = AAZStrType(
serialized_name="accountType",
flags={"required": True},
)
user_identity.object_id = AAZStrType(
serialized_name="objectId",
flags={"required": True},
)
user_identity.tenant_id = AAZStrType(
serialized_name="tenantId",
flags={"required": True},
)

workloads = cls._schema_on_200.properties.workloads
workloads.Element = AAZObjectType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ class Create(AAZCommand):
"""Create a collaboration.

:example: Create Collaboration
az managedcleanroom collaboration create --resource-group testrg --collaboration-name ContosoCollaboration --location northeurope --consortium-type ConfidentialACI --user-identity "{tenant-id:fd3c3665-1729-4b7b-9a38-238e83b0f98b,object-id:fd3c3665-1729-4b7b-9a38-238e83b0f98b,account-type:microsoft}"
az managedcleanroom collaboration create --resource-group testrg --collaboration-name ContosoCollaboration --location northeurope
"""

_aaz_info = {
"version": "2025-10-31-preview",
"version": "2026-03-31-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2025-10-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-03-31-preview"],
]
}

Expand Down Expand Up @@ -61,36 +61,27 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.consortium_type = AAZStrArg(
options=["--consortium-type"],
_args_schema.collaborators = AAZListArg(
options=["--collaborators"],
arg_group="Properties",
help="Gets or sets the consortium type.",
required=True,
enum={"ConfidentialACI": "ConfidentialACI"},
)
_args_schema.user_identity = AAZObjectArg(
options=["--user-identity"],
arg_group="Properties",
help="Gets or sets the user identity.",
required=True,
help="Gets or sets the collaborators.",
)

user_identity = cls._args_schema.user_identity
user_identity.account_type = AAZStrArg(
options=["account-type"],
help="Account type of the user identity.",
required=True,
enum={"microsoft": "microsoft"},
)
user_identity.object_id = AAZStrArg(
collaborators = cls._args_schema.collaborators
collaborators.Element = AAZObjectArg()

_element = cls._args_schema.collaborators.Element
_element.object_id = AAZStrArg(
options=["object-id"],
help="Object ID of the user identity.",
required=True,
help="Object ID of the collaborator.",
)
user_identity.tenant_id = AAZStrArg(
_element.tenant_id = AAZStrArg(
options=["tenant-id"],
help="Tenant ID of the user identity.",
required=True,
help="Tenant ID of the collaborator.",
)
_element.user_identifier = AAZStrArg(
options=["user-identifier"],
help="User identifier of the collaborator. This can be specified as an email (no OID/TID should be specified) or an SPN (OID/TID required).",
)

# define Arg Group "Resource"
Expand Down Expand Up @@ -203,7 +194,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-10-31-preview",
"api-version", "2026-03-31-preview",
required=True,
),
}
Expand Down Expand Up @@ -235,14 +226,17 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("consortiumType", AAZStrType, ".consortium_type", typ_kwargs={"flags": {"required": True}})
properties.set_prop("userIdentity", AAZObjectType, ".user_identity", typ_kwargs={"flags": {"required": True}})
properties.set_prop("collaborators", AAZListType, ".collaborators")

collaborators = _builder.get(".properties.collaborators")
if collaborators is not None:
collaborators.set_elements(AAZObjectType, ".")

user_identity = _builder.get(".properties.userIdentity")
if user_identity is not None:
user_identity.set_prop("accountType", AAZStrType, ".account_type", typ_kwargs={"flags": {"required": True}})
user_identity.set_prop("objectId", AAZStrType, ".object_id", typ_kwargs={"flags": {"required": True}})
user_identity.set_prop("tenantId", AAZStrType, ".tenant_id", typ_kwargs={"flags": {"required": True}})
_elements = _builder.get(".properties.collaborators[]")
if _elements is not None:
_elements.set_prop("objectId", AAZStrType, ".object_id")
_elements.set_prop("tenantId", AAZStrType, ".tenant_id")
_elements.set_prop("userIdentifier", AAZStrType, ".user_identifier")

tags = _builder.get(".tags")
if tags is not None:
Expand Down Expand Up @@ -295,14 +289,15 @@ def _build_schema_on_200_201(cls):
serialized_name="clusterEndpoint",
flags={"read_only": True},
)
properties.collaboration_state = AAZStrType(
serialized_name="collaborationState",
flags={"read_only": True},
)
properties.collaborators = AAZListType()
properties.consortium_arm_id = AAZStrType(
serialized_name="consortiumArmId",
flags={"read_only": True},
)
properties.consortium_type = AAZStrType(
serialized_name="consortiumType",
flags={"required": True},
)
properties.health = AAZObjectType(
flags={"read_only": True},
)
Expand All @@ -314,14 +309,28 @@ def _build_schema_on_200_201(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.user_identity = AAZObjectType(
serialized_name="userIdentity",
flags={"required": True},
)
properties.workloads = AAZListType(
flags={"read_only": True},
)

collaborators = cls._schema_on_200_201.properties.collaborators
collaborators.Element = AAZObjectType()

_element = cls._schema_on_200_201.properties.collaborators.Element
_element.is_collaboration_owner = AAZBoolType(
serialized_name="isCollaborationOwner",
flags={"read_only": True},
)
_element.object_id = AAZStrType(
serialized_name="objectId",
)
_element.tenant_id = AAZStrType(
serialized_name="tenantId",
)
_element.user_identifier = AAZStrType(
serialized_name="userIdentifier",
)

health = cls._schema_on_200_201.properties.health
health.health_issues = AAZListType(
serialized_name="healthIssues",
Expand Down Expand Up @@ -353,20 +362,6 @@ def _build_schema_on_200_201(cls):
_element = cls._schema_on_200_201.properties.managed_on_behalf_of_configuration.mobo_broker_resources.Element
_element.id = AAZStrType()

user_identity = cls._schema_on_200_201.properties.user_identity
user_identity.account_type = AAZStrType(
serialized_name="accountType",
flags={"required": True},
)
user_identity.object_id = AAZStrType(
serialized_name="objectId",
flags={"required": True},
)
user_identity.tenant_id = AAZStrType(
serialized_name="tenantId",
flags={"required": True},
)

workloads = cls._schema_on_200_201.properties.workloads
workloads.Element = AAZObjectType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2025-10-31-preview",
"version": "2026-03-31-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2025-10-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-03-31-preview"],
]
}

Expand Down Expand Up @@ -147,7 +147,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-10-31-preview",
"api-version", "2026-03-31-preview",
required=True,
),
}
Expand Down
Loading
Loading