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
7 changes: 4 additions & 3 deletions src/azure-cli/azure/cli/command_modules/vm/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,13 @@ def load_command_table(self, _):
g.custom_command('identity assign', 'assign_vmss_identity', validator=process_assign_identity_namespace)
g.custom_command('identity remove', 'remove_vmss_identity', validator=process_remove_identity_namespace, is_preview=True)
g.custom_show_command('identity show', 'show_vmss_identity')

g.custom_command('deallocate', 'deallocate_vmss', supports_no_wait=True)

with self.command_group('vmss application', operation_group='virtual_machine_scale_sets') as g:
g.custom_command('set', 'set_vmss_applications', validator=process_set_applications_namespace)
g.custom_command('list', 'list_vmss_applications')

with self.command_group('vmss', compute_vmss_sdk, operation_group='virtual_machine_scale_sets') as g:
g.custom_command('application set', 'set_vmss_applications', validator=process_set_applications_namespace, min_api='2021-07-01')
g.custom_command('application list', 'list_vmss_applications', min_api='2021-07-01')
g.custom_command('create', 'create_vmss', transform=DeploymentOutputLongRunningOperation(self.cli_ctx, 'Starting vmss create'), supports_no_wait=True, table_transformer=deployment_validate_table_format, validator=process_vmss_create_namespace, exception_handler=handle_template_based_exception)
g.custom_command('get-instance-view', 'get_vmss_instance_view', table_transformer='{ProvisioningState:statuses[0].displayStatus, PowerState:statuses[1].displayStatus}')
g.custom_command('list-instance-connection-info', 'list_vmss_instance_connection_info')
Expand Down
10 changes: 7 additions & 3 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6343,12 +6343,16 @@ def _output(self, *args, **kwargs):


def list_vmss_applications(cmd, vmss_name, resource_group_name):
client = _compute_client_factory(cmd.cli_ctx)
from .operations.vmss import VMSSShow
try:
vmss = client.virtual_machine_scale_sets.get(resource_group_name, vmss_name)
command_args = {
'resource_group': resource_group_name,
'vm_scale_set_name': vmss_name
}
vmss = VMSSShow(cli_ctx=cmd.cli_ctx)(command_args=command_args)
except ResourceNotFoundError:
raise ResourceNotFoundError('Could not find vmss {}.'.format(vmss_name))
return vmss.virtual_machine_profile.application_profile
return vmss.get('virtualMachineProfile', {}).get('applicationProfile', {})


# region Restore point collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6942,7 +6942,7 @@ interactions:
User-Agent:
- AZURECLI/2.79.0 azsdk-python-core/1.35.0 Python/3.10.11 (Windows-10-10.0.26200-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_test_vm_vmss_application_enable_automatic_upgrade000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000005?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_test_vm_vmss_application_enable_automatic_upgrade000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000005?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_test_vm_vmss_application_enable_automatic_upgrade000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000005\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ interactions:
User-Agent:
- AZURECLI/2.79.0 azsdk-python-core/1.35.0 Python/3.10.11 (Windows-10-10.0.26200-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\",\r\n
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ interactions:
User-Agent:
- AZURECLI/2.79.0 azsdk-python-core/1.35.0 Python/3.10.11 (Windows-10-10.0.26200-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ interactions:
User-Agent:
- AZURECLI/2.79.0 azsdk-python-core/1.35.0 Python/3.10.11 (Windows-10-10.0.26200-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\",\r\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13123,7 +13123,7 @@ def test_vmss_add_application_empty_version_ids(self, resource_group):
})

# Prepare VMSS
self.cmd('vmss create -l eastus -g {rg} -n {vmss} --authentication-type password --admin-username admin123 '
self.cmd('vmss create -l westus -g {rg} -n {vmss} --authentication-type password --admin-username admin123 '
'--admin-password PasswordPassword1! --image Win2022Datacenter --orchestration-mode Flexible --vm-sku Standard_D2s_v3')

self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids')
Expand Down