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
10 changes: 10 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,16 @@
short-summary: Delete a private endpoint connection request for a container registry
long-summary: To create a private endpoint connection use "az network private-endpoint create". For more information see https://aka.ms/acr/private-link
"""

helps['acr private-link-resource'] = """
type: group
short-summary: Manage registry private link resources.
"""

helps['acr private-link-resource list'] = """
type: command
short-summary: list the private link resources supported for a registry
"""
# endregion

# region encryption
Expand Down
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def load_command_table(self, _): # pylint: disable=too-many-statements
g.command('approve', 'approve')
g.command('reject', 'reject')

with self.command_group('acr private-link-resource', acr_custom_util, is_preview=True) as g:
g.command('list', 'list_private_link_resources')

with self.command_group('acr identity', acr_custom_util, is_preview=True) as g:
g.command('show', 'show_identity')
g.command('assign', 'assign_identity')
Expand Down
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,8 @@ def _resolve_identity_client_id(cli_ctx, managed_identity_resource_id):
res = parse_resource_id(managed_identity_resource_id)
client = get_mgmt_service_client(cli_ctx, ManagedServiceIdentityClient, subscription_id=res['subscription'])
return client.user_assigned_identities.get(res['resource_group'], res['name']).client_id


def list_private_link_resources(cmd, client, registry_name, resource_group_name=None):
resource_group_name = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name)
return client.list_private_link_resources(resource_group_name, registry_name)