Skip to content

Commit d44ea4e

Browse files
authored
Merge branch 'main' into wenhuang/agentpool-vmsize-resize
2 parents 86348b7 + b878c34 commit d44ea4e

File tree

70 files changed

+6736
-347
lines changed

Some content is hidden

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

70 files changed

+6736
-347
lines changed

src/acrtransfer/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
2.0.0
6+
+++++++
7+
* Add: Breaking change for new required parameter --storage-access-mode for acr export-pipeline create and acr import-pipeline create commands.
8+
59
1.1.1b1
610
+++++++
711
* Add: Breaking change announcement for new required parameter --storage-access-mode for acr export-pipeline create and acr import-pipeline create commands.

src/acrtransfer/azext_acrtransfer/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from azure.cli.core import AzCommandsLoader
77
from azext_acrtransfer._help import helps # pylint: disable=unused-import
8-
import azext_acrtransfer._breaking_change # pylint: disable=unused-import
98

109

1110
class AcrtransferCommandsLoader(AzCommandsLoader):

src/acrtransfer/azext_acrtransfer/_breaking_change.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/acrtransfer/azext_acrtransfer/_client_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
def cf_acrtransfer(cli_ctx, *_):
99
from azure.cli.core.commands.client_factory import get_mgmt_service_client
10-
from azext_acrtransfer.vendored_sdks.containerregistry.v2019_12_01_preview._container_registry_management_client import ContainerRegistryManagementClient
10+
from azext_acrtransfer.vendored_sdks.containerregistry.v2025_06_01_preview._container_registry_management_client import ContainerRegistryManagementClient
1111
return get_mgmt_service_client(cli_ctx, ContainerRegistryManagementClient)

src/acrtransfer/azext_acrtransfer/_help.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
type: command
2727
short-summary: Create an import pipeline.
2828
examples:
29-
- name: Create an import pipeline.
30-
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
31-
- name: Create an import pipeline with a user-assigned identity, all available options, and source trigger disabled.
32-
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options DeleteSourceBlobOnSuccess OverwriteTags ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity --source-trigger-enabled False
29+
- name: Create an import pipeline with SAS token authentication.
30+
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode SasToken --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
31+
- name: Create an import pipeline with system-assigned managed identity (automatic provisioning).
32+
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode ManagedIdentity --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
33+
- name: Create an import pipeline with user-assigned managed identity and all available options.
34+
text: az acr import-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode ManagedIdentity --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options DeleteSourceBlobOnSuccess OverwriteTags ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity --source-trigger-enabled False
3335
"""
3436

3537
helps['acr import-pipeline list'] = """
@@ -60,10 +62,12 @@
6062
type: command
6163
short-summary: Create an export pipeline.
6264
examples:
63-
- name: Create an export pipeline.
64-
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
65-
- name: Create an export pipeline with a user-assigned identity and all available options.
66-
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options OverwriteBlobs ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity
65+
- name: Create an export pipeline with SAS token authentication.
66+
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode SasToken --secret-uri https://$MyKV.vault.azure.net/secrets/$MySecret --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
67+
- name: Create an export pipeline with system-assigned managed identity (automatic provisioning).
68+
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode ManagedIdentity --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer
69+
- name: Create an export pipeline with user-assigned managed identity and all available options.
70+
text: az acr export-pipeline create --resource-group $MyRG --registry $MyReg --name $MyPipeline --storage-access-mode ManagedIdentity --storage-container-uri https://$MyStorage.blob.core.windows.net/$MyContainer --options OverwriteBlobs ContinueOnErrors --assign-identity /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity
6771
"""
6872

6973
helps['acr export-pipeline list'] = """

src/acrtransfer/azext_acrtransfer/_params.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55
# pylint: disable=line-too-long
66

7-
from ._validators import validate_export_options, validate_import_options, validate_keyvault_secret_uri, validate_pipeline_type, validate_storage_account_container_uri, validate_user_assigned_identity_resource_id, validate_top
7+
from ._validators import validate_export_options, validate_import_options, validate_keyvault_secret_uri, validate_pipeline_type, validate_storage_access_mode_and_secret_uri, validate_storage_account_container_uri, validate_user_assigned_identity_resource_id, validate_top
88

99

1010
def load_arguments(self, _):
@@ -16,8 +16,9 @@ def load_arguments(self, _):
1616
c.argument('location', validator=get_default_location_from_resource_group)
1717
c.argument('registry_name', options_list=['--registry', '-r'], help='Name of registry.')
1818
c.argument('storage_account_container_uri', options_list=['--storage-container-uri', '-c'], validator=validate_storage_account_container_uri, help='Storage account container URI of the source or target storage account container of the form https://$MyStorageAccount.blob.core.windows.net/$MyContainer. Note that the URI may be different outside of AzureCloud.')
19-
c.argument('keyvault_secret_uri', options_list=['--secret-uri', '-s'], validator=validate_keyvault_secret_uri, help='Keyvault secret URI containing a valid SAS token to the associated storage account of the form https://$MyKeyvault.vault.azure.net/secrets/$MySecret. Note that the URI may be different outside of AzureCloud.')
20-
c.argument('user_assigned_identity_resource_id', options_list=['--assign-identity', '-i'], validator=validate_user_assigned_identity_resource_id, help='User assigned identity resource ID of the form /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity.')
19+
c.argument('storage_access_mode', options_list=['--storage-access-mode', '-m'], validator=validate_storage_access_mode_and_secret_uri, help='Storage account access mode. Allowed values: ManagedIdentity, SasToken.')
20+
c.argument('keyvault_secret_uri', options_list=['--secret-uri', '-s'], validator=validate_keyvault_secret_uri, help='Keyvault secret URI containing a valid SAS token to the associated storage account of the form https://$MyKeyvault.vault.azure.net/secrets/$MySecret. Note that the URI may be different outside of AzureCloud. Required when --storage-access-mode is SasToken.')
21+
c.argument('user_assigned_identity_resource_id', options_list=['--assign-identity', '-i'], validator=validate_user_assigned_identity_resource_id, help='Managed identity for the pipeline. Provide a user-assigned identity resource ID of the form /subscriptions/$MySubID/resourceGroups/$MyRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$MyIdentity. If not specified, a system-assigned managed identity will be automatically provisioned.')
2122

2223
with self.argument_context('acr import-pipeline') as c:
2324
c.argument('options', options_list=['--options', '-z'], nargs='+', validator=validate_import_options, help='Space-separated list of options. May only contain the following options: DeleteSourceBlobOnSuccess,OverwriteTags,ContinueOnErrors,DisableSourceTrigger.')

src/acrtransfer/azext_acrtransfer/_validators.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,35 @@ def validate_keyvault_secret_uri(namespace):
2525
uri = namespace.keyvault_secret_uri
2626
valid = True
2727

28+
if uri is None:
29+
return
30+
2831
if "https://" not in uri or "/secrets/" not in uri:
2932
valid = False
3033

3134
if not valid:
3235
logger.warning("Invalid keyvault secret URI. Please provide a keyvault secret URI of the form https://$MyKeyvault.vault.azure.net/secrets/$MySecret. Note - The exact URI form may be different outside of AzureCloud.")
3336

3437

38+
def validate_storage_access_mode_and_secret_uri(namespace):
39+
storage_access_mode = namespace.storage_access_mode
40+
secret_uri = namespace.keyvault_secret_uri
41+
42+
allowed_modes = ["ManagedIdentity", "SasToken"]
43+
44+
if storage_access_mode not in allowed_modes:
45+
raise InvalidArgumentValueError(f"Invalid storage access mode '{storage_access_mode}'. Allowed values: {', '.join(allowed_modes)}")
46+
47+
if storage_access_mode == "ManagedIdentity":
48+
# Reject secret-uri when using Managed Identity mode
49+
if secret_uri is not None:
50+
raise InvalidArgumentValueError("The '--secret-uri' flag cannot be supplied when 'ManagedIdentity' is chosen for the flag '--storage-access-mode'.")
51+
elif storage_access_mode == "SasToken":
52+
# Require secret-uri when using SasToken mode
53+
if secret_uri is None:
54+
raise InvalidArgumentValueError("--secret-uri is required when --storage-access-mode is SasToken")
55+
56+
3557
def validate_user_assigned_identity_resource_id(namespace):
3658
identity_id = namespace.user_assigned_identity_resource_id
3759
valid = True
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"azext.isPreview": true,
2+
"azext.isPreview": false,
33
"azext.minCliCoreVersion": "2.0.67"
44
}

src/acrtransfer/azext_acrtransfer/commands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
def load_command_table(self, _):
1313
importpipeline_sdk = CliCommandType(
14-
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2019_12_01_preview.operations#ImportPipelinesOperations.{}',
14+
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2025_06_01_preview.operations#ImportPipelinesOperations.{}',
1515
client_factory=cf_acrtransfer,
16-
min_api='2019-12-01-preview'
16+
min_api='2025-06-01-preview'
1717
)
1818

1919
exportpipeline_sdk = CliCommandType(
20-
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2019_12_01_preview.operations#ExportPipelinesOperations.{}',
20+
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2025_06_01_preview.operations#ExportPipelinesOperations.{}',
2121
client_factory=cf_acrtransfer,
22-
min_api='2019-12-01-preview'
22+
min_api='2025-06-01-preview'
2323
)
2424

2525
pipelinerun_sdk = CliCommandType(
26-
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2019_12_01_preview.operations#PipelineRunsOperations.{}',
26+
operations_tmpl='azext_acrtransfer.vendored_sdks.containerregistry.v2025_06_01_preview.operations#PipelineRunsOperations.{}',
2727
client_factory=cf_acrtransfer,
28-
min_api='2019-12-01-preview'
28+
min_api='2025-06-01-preview'
2929
)
3030

3131
with self.command_group('acr import-pipeline', importpipeline_sdk, table_transformer=import_pipeline_output_format, is_preview=True) as g:

0 commit comments

Comments
 (0)