diff --git a/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py b/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py index 80b66f9834b..7dffe76b56c 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py +++ b/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py @@ -13,12 +13,14 @@ class Update(AAZCommand): """Update operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + + Please note some properties can be set only during virtual machine creation """ _aaz_info = { - "version": "2024-11-01", + "version": "2025-04-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}", "2024-11-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}", "2025-04-01"], ] } @@ -54,7 +56,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ) _args_schema.vm_name = AAZStrArg( options=["-n", "--name", "--vm-name"], - help="The name of the virtual machine.", + help="The name of the Virtual Machine. You can configure the default using `az configure --defaults vm=`", required=True, id_part="name", ) @@ -70,13 +72,6 @@ def _build_arguments_schema(cls, *args, **kwargs): help="The extended location of the Virtual Machine.", nullable=True, ) - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Resource location", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) _args_schema.placement = AAZObjectArg( options=["--placement"], arg_group="Parameters", @@ -130,7 +125,7 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["zone-placement-policy"], help="Specifies the policy for virtual machine's placement in availability zone. Possible values are: **Any** - An availability zone will be automatically picked by system as part of virtual machine creation.", nullable=True, - enum={"Any": "Any"}, + enum={"Any": "Any", "Auto": "Auto"}, ) exclude_zones = cls._args_schema.placement.exclude_zones @@ -320,6 +315,11 @@ def _build_arguments_schema(cls, *args, **kwargs): cls._build_args_sub_resource_update(_args_schema.virtual_machine_scale_set) additional_capabilities = cls._args_schema.additional_capabilities + additional_capabilities.enable_fips1403_encryption = AAZBoolArg( + options=["enable-fips1403-encryption"], + help="The flag enables the usage of FIPS 140-3 compliant cryptography on the protectedSettings of an extension. Learn more at: https://aka.ms/linuxagentfipssupport.", + nullable=True, + ) additional_capabilities.hibernation_enabled = AAZBoolArg( options=["hibernation-enabled"], help="The flag that enables or disables hibernation capability on the VM.", @@ -521,6 +521,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Specifies the primary network interface in case the virtual machine has more than 1 network interface.", nullable=True, ) + _element.tags = AAZDictArg( + options=["tags"], + help="Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration", + nullable=True, + ) dns_settings = cls._args_schema.network_profile.network_interface_configurations.Element.dns_settings dns_settings.dns_servers = AAZListArg( @@ -641,6 +646,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.", nullable=True, ) + public_ip_address_configuration.tags = AAZDictArg( + options=["tags"], + help="Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration", + nullable=True, + ) dns_settings = cls._args_schema.network_profile.network_interface_configurations.Element.ip_configurations.Element.public_ip_address_configuration.dns_settings dns_settings.domain_name_label = AAZStrArg( @@ -685,6 +695,16 @@ def _build_arguments_schema(cls, *args, **kwargs): enum={"Global": "Global", "Regional": "Regional"}, ) + tags = cls._args_schema.network_profile.network_interface_configurations.Element.ip_configurations.Element.public_ip_address_configuration.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + tags = cls._args_schema.network_profile.network_interface_configurations.Element.tags + tags.Element = AAZStrArg( + nullable=True, + ) + network_interfaces = cls._args_schema.network_profile.network_interfaces network_interfaces.Element = AAZObjectArg( nullable=True, @@ -709,10 +729,13 @@ def _build_arguments_schema(cls, *args, **kwargs): ) os_profile = cls._args_schema.os_profile - os_profile.admin_password = AAZStrArg( + os_profile.admin_password = AAZPasswordArg( options=["admin-password"], help="Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

**Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\\W_])

**Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", \"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\", \"Password22\", \"iloveyou!\"

For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)", nullable=True, + blank=AAZPromptPasswordInput( + msg="Password:", + ), ) os_profile.admin_username = AAZStrArg( options=["admin-username"], @@ -997,6 +1020,11 @@ def _build_arguments_schema(cls, *args, **kwargs): ) scheduled_events_policy = cls._args_schema.scheduled_events_policy + scheduled_events_policy.all_instances_down = AAZObjectArg( + options=["all-instances-down"], + help="The configuration parameters used while creating AllInstancesDown scheduled event setting creation.", + nullable=True, + ) scheduled_events_policy.scheduled_events_additional_publishing_targets = AAZObjectArg( options=["scheduled-events-additional-publishing-targets"], help="The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets.", @@ -1013,6 +1041,13 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + all_instances_down = cls._args_schema.scheduled_events_policy.all_instances_down + all_instances_down.automatically_approve = AAZBoolArg( + options=["automatically-approve"], + help="Specifies if Scheduled Events should be auto-approved when all instances are down. its default value is true", + nullable=True, + ) + scheduled_events_additional_publishing_targets = cls._args_schema.scheduled_events_policy.scheduled_events_additional_publishing_targets scheduled_events_additional_publishing_targets.event_grid_and_resource_graph = AAZObjectArg( options=["event-grid-and-resource-graph"], @@ -1026,6 +1061,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Specifies if event grid and resource graph is enabled for Scheduled event related configurations.", nullable=True, ) + event_grid_and_resource_graph.scheduled_events_api_version = AAZStrArg( + options=["scheduled-events-api-version"], + help="Specifies the api-version to determine which Scheduled Events configuration schema version will be delivered.", + nullable=True, + ) user_initiated_reboot = cls._args_schema.scheduled_events_policy.user_initiated_reboot user_initiated_reboot.automatically_approve = AAZBoolArg( @@ -1113,6 +1153,11 @@ def _build_arguments_schema(cls, *args, **kwargs): ) proxy_agent_settings = cls._args_schema.security_profile.proxy_agent_settings + proxy_agent_settings.add_proxy_agent_extension = AAZBoolArg( + options=["add-proxy-agent-extension"], + help="Specify whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for Linux Os.", + nullable=True, + ) proxy_agent_settings.enabled = AAZBoolArg( options=["enabled"], help="Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set.", @@ -1211,6 +1256,16 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, enum={"ForceDetach": "ForceDetach"}, ) + _element.disk_iops_read_write = AAZIntArg( + options=["disk-iops-read-write"], + help="Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.", + nullable=True, + ) + _element.disk_m_bps_read_write = AAZIntArg( + options=["disk-m-bps-read-write"], + help="Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.", + nullable=True, + ) _element.disk_size_gb = AAZIntArg( options=["disk-size-gb"], help="Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.", @@ -1651,7 +1706,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-11-01", + "api-version", "2025-04-01", required=True, ), } @@ -1698,7 +1753,7 @@ def __call__(self, *args, **kwargs): session, self.on_200_201, self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, + lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: @@ -1707,7 +1762,7 @@ def __call__(self, *args, **kwargs): session, self.on_200_201, self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, + lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) @@ -1750,7 +1805,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-11-01", + "api-version", "2025-04-01", required=True, ), } @@ -1816,7 +1871,6 @@ def _update_instance(self, instance): ) _builder.set_prop("extendedLocation", AAZObjectType, ".extended_location") _builder.set_prop("identity", AAZIdentityObjectType) - _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("placement", AAZObjectType, ".placement") _builder.set_prop("plan", AAZObjectType, ".plan") _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) @@ -1877,6 +1931,7 @@ def _update_instance(self, instance): additional_capabilities = _builder.get(".properties.additionalCapabilities") if additional_capabilities is not None: + additional_capabilities.set_prop("enableFips1403Encryption", AAZBoolType, ".enable_fips1403_encryption") additional_capabilities.set_prop("hibernationEnabled", AAZBoolType, ".hibernation_enabled") additional_capabilities.set_prop("ultraSSDEnabled", AAZBoolType, ".ultra_ssd_enabled") @@ -1938,6 +1993,7 @@ def _update_instance(self, instance): if _elements is not None: _elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _elements.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties.networkProfile.networkInterfaceConfigurations[].properties") if properties is not None: @@ -1998,6 +2054,7 @@ def _update_instance(self, instance): public_ip_address_configuration.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) public_ip_address_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) public_ip_address_configuration.set_prop("sku", AAZObjectType, ".sku") + public_ip_address_configuration.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties.networkProfile.networkInterfaceConfigurations[].properties.ipConfigurations[].properties.publicIPAddressConfiguration.properties") if properties is not None: @@ -2028,6 +2085,14 @@ def _update_instance(self, instance): sku.set_prop("name", AAZStrType, ".name") sku.set_prop("tier", AAZStrType, ".tier") + tags = _builder.get(".properties.networkProfile.networkInterfaceConfigurations[].properties.ipConfigurations[].properties.publicIPAddressConfiguration.tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + tags = _builder.get(".properties.networkProfile.networkInterfaceConfigurations[].tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + network_interfaces = _builder.get(".properties.networkProfile.networkInterfaces") if network_interfaces is not None: network_interfaces.set_elements(AAZObjectType, ".") @@ -2151,10 +2216,15 @@ def _update_instance(self, instance): scheduled_events_policy = _builder.get(".properties.scheduledEventsPolicy") if scheduled_events_policy is not None: + scheduled_events_policy.set_prop("allInstancesDown", AAZObjectType, ".all_instances_down") scheduled_events_policy.set_prop("scheduledEventsAdditionalPublishingTargets", AAZObjectType, ".scheduled_events_additional_publishing_targets") scheduled_events_policy.set_prop("userInitiatedReboot", AAZObjectType, ".user_initiated_reboot") scheduled_events_policy.set_prop("userInitiatedRedeploy", AAZObjectType, ".user_initiated_redeploy") + all_instances_down = _builder.get(".properties.scheduledEventsPolicy.allInstancesDown") + if all_instances_down is not None: + all_instances_down.set_prop("automaticallyApprove", AAZBoolType, ".automatically_approve") + scheduled_events_additional_publishing_targets = _builder.get(".properties.scheduledEventsPolicy.scheduledEventsAdditionalPublishingTargets") if scheduled_events_additional_publishing_targets is not None: scheduled_events_additional_publishing_targets.set_prop("eventGridAndResourceGraph", AAZObjectType, ".event_grid_and_resource_graph") @@ -2162,6 +2232,7 @@ def _update_instance(self, instance): event_grid_and_resource_graph = _builder.get(".properties.scheduledEventsPolicy.scheduledEventsAdditionalPublishingTargets.eventGridAndResourceGraph") if event_grid_and_resource_graph is not None: event_grid_and_resource_graph.set_prop("enable", AAZBoolType, ".enable") + event_grid_and_resource_graph.set_prop("scheduledEventsApiVersion", AAZStrType, ".scheduled_events_api_version") user_initiated_reboot = _builder.get(".properties.scheduledEventsPolicy.userInitiatedReboot") if user_initiated_reboot is not None: @@ -2200,6 +2271,7 @@ def _update_instance(self, instance): proxy_agent_settings = _builder.get(".properties.securityProfile.proxyAgentSettings") if proxy_agent_settings is not None: + proxy_agent_settings.set_prop("addProxyAgentExtension", AAZBoolType, ".add_proxy_agent_extension") proxy_agent_settings.set_prop("enabled", AAZBoolType, ".enabled") _UpdateHelper._build_schema_host_endpoint_settings_update(proxy_agent_settings.set_prop("imds", AAZObjectType, ".imds")) proxy_agent_settings.set_prop("keyIncarnationId", AAZIntType, ".key_incarnation_id") @@ -2229,6 +2301,8 @@ def _update_instance(self, instance): _elements.set_prop("createOption", AAZStrType, ".create_option", typ_kwargs={"flags": {"required": True}}) _elements.set_prop("deleteOption", AAZStrType, ".delete_option") _elements.set_prop("detachOption", AAZStrType, ".detach_option") + _elements.set_prop("diskIOPSReadWrite", AAZIntType, ".disk_iops_read_write") + _elements.set_prop("diskMBpsReadWrite", AAZIntType, ".disk_m_bps_read_write") _elements.set_prop("diskSizeGB", AAZIntType, ".disk_size_gb") _UpdateHelper._build_schema_virtual_hard_disk_update(_elements.set_prop("image", AAZObjectType, ".image")) _elements.set_prop("lun", AAZIntType, ".lun", typ_kwargs={"flags": {"required": True}}) @@ -2572,6 +2646,50 @@ def _build_schema_sub_resource_read(cls, _schema): _schema.id = cls._schema_sub_resource_read.id + _schema_system_data_read = None + + @classmethod + def _build_schema_system_data_read(cls, _schema): + if cls._schema_system_data_read is not None: + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + return + + cls._schema_system_data_read = _schema_system_data_read = AAZObjectType( + flags={"read_only": True} + ) + + system_data_read = _schema_system_data_read + system_data_read.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data_read.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data_read.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data_read.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data_read.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data_read.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.created_at = cls._schema_system_data_read.created_at + _schema.created_by = cls._schema_system_data_read.created_by + _schema.created_by_type = cls._schema_system_data_read.created_by_type + _schema.last_modified_at = cls._schema_system_data_read.last_modified_at + _schema.last_modified_by = cls._schema_system_data_read.last_modified_by + _schema.last_modified_by_type = cls._schema_system_data_read.last_modified_by_type + _schema_virtual_hard_disk_read = None @classmethod @@ -2640,6 +2758,7 @@ def _build_schema_virtual_machine_read(cls, _schema): _schema.plan = cls._schema_virtual_machine_read.plan _schema.properties = cls._schema_virtual_machine_read.properties _schema.resources = cls._schema_virtual_machine_read.resources + _schema.system_data = cls._schema_virtual_machine_read.system_data _schema.tags = cls._schema_virtual_machine_read.tags _schema.type = cls._schema_virtual_machine_read.type _schema.zones = cls._schema_virtual_machine_read.zones @@ -2676,6 +2795,11 @@ def _build_schema_virtual_machine_read(cls, _schema): virtual_machine_read.resources = AAZListType( flags={"read_only": True}, ) + virtual_machine_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cls._build_schema_system_data_read(virtual_machine_read.system_data) virtual_machine_read.tags = AAZDictType() virtual_machine_read.type = AAZStrType( flags={"read_only": True}, @@ -2827,6 +2951,9 @@ def _build_schema_virtual_machine_read(cls, _schema): ) additional_capabilities = _schema_virtual_machine_read.properties.additional_capabilities + additional_capabilities.enable_fips1403_encryption = AAZBoolType( + serialized_name="enableFips1403Encryption", + ) additional_capabilities.hibernation_enabled = AAZBoolType( serialized_name="hibernationEnabled", ) @@ -3155,6 +3282,7 @@ def _build_schema_virtual_machine_read(cls, _schema): _element.properties = AAZObjectType( flags={"client_flatten": True}, ) + _element.tags = AAZDictType() properties = _schema_virtual_machine_read.properties.network_profile.network_interface_configurations.Element.properties properties.auxiliary_mode = AAZStrType( @@ -3254,6 +3382,7 @@ def _build_schema_virtual_machine_read(cls, _schema): flags={"client_flatten": True}, ) public_ip_address_configuration.sku = AAZObjectType() + public_ip_address_configuration.tags = AAZDictType() properties = _schema_virtual_machine_read.properties.network_profile.network_interface_configurations.Element.properties.ip_configurations.Element.properties.public_ip_address_configuration.properties properties.delete_option = AAZStrType( @@ -3301,6 +3430,12 @@ def _build_schema_virtual_machine_read(cls, _schema): sku.name = AAZStrType() sku.tier = AAZStrType() + tags = _schema_virtual_machine_read.properties.network_profile.network_interface_configurations.Element.properties.ip_configurations.Element.properties.public_ip_address_configuration.tags + tags.Element = AAZStrType() + + tags = _schema_virtual_machine_read.properties.network_profile.network_interface_configurations.Element.tags + tags.Element = AAZStrType() + network_interfaces = _schema_virtual_machine_read.properties.network_profile.network_interfaces network_interfaces.Element = AAZObjectType() @@ -3489,6 +3624,9 @@ def _build_schema_virtual_machine_read(cls, _schema): _element.protocol = AAZStrType() scheduled_events_policy = _schema_virtual_machine_read.properties.scheduled_events_policy + scheduled_events_policy.all_instances_down = AAZObjectType( + serialized_name="allInstancesDown", + ) scheduled_events_policy.scheduled_events_additional_publishing_targets = AAZObjectType( serialized_name="scheduledEventsAdditionalPublishingTargets", ) @@ -3499,6 +3637,11 @@ def _build_schema_virtual_machine_read(cls, _schema): serialized_name="userInitiatedRedeploy", ) + all_instances_down = _schema_virtual_machine_read.properties.scheduled_events_policy.all_instances_down + all_instances_down.automatically_approve = AAZBoolType( + serialized_name="automaticallyApprove", + ) + scheduled_events_additional_publishing_targets = _schema_virtual_machine_read.properties.scheduled_events_policy.scheduled_events_additional_publishing_targets scheduled_events_additional_publishing_targets.event_grid_and_resource_graph = AAZObjectType( serialized_name="eventGridAndResourceGraph", @@ -3506,6 +3649,9 @@ def _build_schema_virtual_machine_read(cls, _schema): event_grid_and_resource_graph = _schema_virtual_machine_read.properties.scheduled_events_policy.scheduled_events_additional_publishing_targets.event_grid_and_resource_graph event_grid_and_resource_graph.enable = AAZBoolType() + event_grid_and_resource_graph.scheduled_events_api_version = AAZStrType( + serialized_name="scheduledEventsApiVersion", + ) user_initiated_reboot = _schema_virtual_machine_read.properties.scheduled_events_policy.user_initiated_reboot user_initiated_reboot.automatically_approve = AAZBoolType( @@ -3560,6 +3706,9 @@ def _build_schema_virtual_machine_read(cls, _schema): ) proxy_agent_settings = _schema_virtual_machine_read.properties.security_profile.proxy_agent_settings + proxy_agent_settings.add_proxy_agent_extension = AAZBoolType( + serialized_name="addProxyAgentExtension", + ) proxy_agent_settings.enabled = AAZBoolType() proxy_agent_settings.imds = AAZObjectType() cls._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds) @@ -3614,11 +3763,9 @@ def _build_schema_virtual_machine_read(cls, _schema): ) _element.disk_iops_read_write = AAZIntType( serialized_name="diskIOPSReadWrite", - flags={"read_only": True}, ) _element.disk_m_bps_read_write = AAZIntType( serialized_name="diskMBpsReadWrite", - flags={"read_only": True}, ) _element.disk_size_gb = AAZIntType( serialized_name="diskSizeGB", @@ -3711,13 +3858,20 @@ def _build_schema_virtual_machine_read(cls, _schema): _element.id = AAZStrType( flags={"read_only": True}, ) - _element.location = AAZStrType() + _element.location = AAZStrType( + flags={"required": True}, + ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"client_flatten": True}, ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + cls._build_schema_system_data_read(_element.system_data) _element.tags = AAZDictType() _element.type = AAZStrType( flags={"read_only": True}, @@ -3737,7 +3891,7 @@ def _build_schema_virtual_machine_read(cls, _schema): serialized_name="instanceView", ) cls._build_schema_virtual_machine_extension_instance_view_read(properties.instance_view) - properties.protected_settings = AAZDictType( + properties.protected_settings = AAZAnyType( serialized_name="protectedSettings", ) properties.protected_settings_from_key_vault = AAZObjectType( @@ -3752,7 +3906,7 @@ def _build_schema_virtual_machine_read(cls, _schema): flags={"read_only": True}, ) properties.publisher = AAZStrType() - properties.settings = AAZDictType() + properties.settings = AAZAnyType() properties.suppress_failures = AAZBoolType( serialized_name="suppressFailures", ) @@ -3761,15 +3915,9 @@ def _build_schema_virtual_machine_read(cls, _schema): serialized_name="typeHandlerVersion", ) - protected_settings = _schema_virtual_machine_read.resources.Element.properties.protected_settings - protected_settings.Element = AAZAnyType() - provision_after_extensions = _schema_virtual_machine_read.resources.Element.properties.provision_after_extensions provision_after_extensions.Element = AAZStrType() - settings = _schema_virtual_machine_read.resources.Element.properties.settings - settings.Element = AAZAnyType() - tags = _schema_virtual_machine_read.resources.Element.tags tags.Element = AAZStrType() @@ -3790,6 +3938,7 @@ def _build_schema_virtual_machine_read(cls, _schema): _schema.plan = cls._schema_virtual_machine_read.plan _schema.properties = cls._schema_virtual_machine_read.properties _schema.resources = cls._schema_virtual_machine_read.resources + _schema.system_data = cls._schema_virtual_machine_read.system_data _schema.tags = cls._schema_virtual_machine_read.tags _schema.type = cls._schema_virtual_machine_read.type _schema.zones = cls._schema_virtual_machine_read.zones diff --git a/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_update.py b/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_update.py index f1cd19c2713..e9578cc33ef 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_update.py +++ b/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_update.py @@ -16,9 +16,9 @@ class Update(AAZCommand): """ _aaz_info = { - "version": "2024-11-01", + "version": "2025-04-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachinescalesets/{}", "2024-11-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachinescalesets/{}", "2025-04-01"], ] } @@ -74,6 +74,12 @@ def _build_arguments_schema(cls, *args, **kwargs): help="The identity of the virtual machine scale set, if configured.", nullable=True, ) + _args_schema.placement = AAZObjectArg( + options=["--placement"], + arg_group="Parameters", + help="Placement section specifies the user-defined constraints for virtual machine scale set hardware placement. This property cannot be changed once VMSS is provisioned. Minimum api-version: 2025-04-01.", + nullable=True, + ) _args_schema.plan = AAZObjectArg( options=["--plan"], arg_group="Parameters", @@ -131,6 +137,34 @@ def _build_arguments_schema(cls, *args, **kwargs): blank={}, ) + placement = cls._args_schema.placement + placement.exclude_zones = AAZListArg( + options=["exclude-zones"], + help="This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection.", + nullable=True, + ) + placement.include_zones = AAZListArg( + options=["include-zones"], + help="This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection.", + nullable=True, + ) + placement.zone_placement_policy = AAZStrArg( + options=["zone-placement-policy"], + help="Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation.", + nullable=True, + enum={"Any": "Any", "Auto": "Auto"}, + ) + + exclude_zones = cls._args_schema.placement.exclude_zones + exclude_zones.Element = AAZStrArg( + nullable=True, + ) + + include_zones = cls._args_schema.placement.include_zones + include_zones.Element = AAZStrArg( + nullable=True, + ) + plan = cls._args_schema.plan plan.name = AAZStrArg( options=["name"], @@ -207,6 +241,13 @@ def _build_arguments_schema(cls, *args, **kwargs): help="When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs.", nullable=True, ) + _args_schema.high_speed_interconnect_placement = AAZStrArg( + options=["--high-speed-interconnect-placement"], + arg_group="Properties", + help="Specifies the high speed interconnect placement for the virtual machine scale set.", + nullable=True, + enum={"None": "None", "Trunk": "Trunk"}, + ) _args_schema.host_group = AAZObjectArg( options=["--host-group"], arg_group="Properties", @@ -309,6 +350,11 @@ def _build_arguments_schema(cls, *args, **kwargs): ) additional_capabilities = cls._args_schema.additional_capabilities + additional_capabilities.enable_fips1403_encryption = AAZBoolArg( + options=["enable-fips1403-encryption"], + help="The flag enables the usage of FIPS 140-3 compliant cryptography on the protectedSettings of an extension. Learn more at: https://aka.ms/linuxagentfipssupport.", + nullable=True, + ) additional_capabilities.hibernation_enabled = AAZBoolArg( options=["hibernation-enabled"], help="The flag that enables or disables hibernation capability on the VM.", @@ -343,9 +389,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["base-regular-priority-count"], help="The base number of regular priority VMs that will be created in this scale set as it scales out.", nullable=True, - fmt=AAZIntArgFormat( - minimum=0, - ), ) priority_mix_policy.regular_priority_percentage_above_base = AAZIntArg( options=["regular-priority-percentage-above-base"], @@ -353,7 +396,6 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, fmt=AAZIntArgFormat( maximum=100, - minimum=0, ), ) @@ -373,6 +415,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="The configuration parameters used while performing resilient VM deletion.", nullable=True, ) + resiliency_policy.zone_allocation_policy = AAZObjectArg( + options=["zone-allocation-policy"], + help="The configuration parameters used while performing zone allocation.", + nullable=True, + ) automatic_zone_rebalancing_policy = cls._args_schema.resiliency_policy.automatic_zone_rebalancing_policy automatic_zone_rebalancing_policy.enabled = AAZBoolArg( @@ -407,6 +454,33 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + zone_allocation_policy = cls._args_schema.resiliency_policy.zone_allocation_policy + zone_allocation_policy.max_instance_percent_per_zone_policy = AAZObjectArg( + options=["max-instance-percent-per-zone-policy"], + help="The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set.", + nullable=True, + ) + zone_allocation_policy.max_zone_count = AAZIntArg( + options=["max-zone-count"], + help="The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'. If not specified, all availability zones will be used.", + nullable=True, + ) + + max_instance_percent_per_zone_policy = cls._args_schema.resiliency_policy.zone_allocation_policy.max_instance_percent_per_zone_policy + max_instance_percent_per_zone_policy.enabled = AAZBoolArg( + options=["enabled"], + help="Specifies whether maxInstancePercentPerZonePolicy should be enabled on the virtual machine scale set.", + nullable=True, + ) + max_instance_percent_per_zone_policy.value = AAZIntArg( + options=["value"], + help="Limit on the number of instances in each zone as a percentage of the total capacity of the virtual machine scale set.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=100, + ), + ) + scale_in_policy = cls._args_schema.scale_in_policy scale_in_policy.force_deletion = AAZBoolArg( options=["force-deletion"], @@ -431,6 +505,11 @@ def _build_arguments_schema(cls, *args, **kwargs): ) scheduled_events_policy = cls._args_schema.scheduled_events_policy + scheduled_events_policy.all_instances_down = AAZObjectArg( + options=["all-instances-down"], + help="The configuration parameters used while creating AllInstancesDown scheduled event setting creation.", + nullable=True, + ) scheduled_events_policy.scheduled_events_additional_publishing_targets = AAZObjectArg( options=["scheduled-events-additional-publishing-targets"], help="The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets.", @@ -447,6 +526,13 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + all_instances_down = cls._args_schema.scheduled_events_policy.all_instances_down + all_instances_down.automatically_approve = AAZBoolArg( + options=["automatically-approve"], + help="Specifies if Scheduled Events should be auto-approved when all instances are down. its default value is true", + nullable=True, + ) + scheduled_events_additional_publishing_targets = cls._args_schema.scheduled_events_policy.scheduled_events_additional_publishing_targets scheduled_events_additional_publishing_targets.event_grid_and_resource_graph = AAZObjectArg( options=["event-grid-and-resource-graph"], @@ -460,6 +546,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Specifies if event grid and resource graph is enabled for Scheduled event related configurations.", nullable=True, ) + event_grid_and_resource_graph.scheduled_events_api_version = AAZStrArg( + options=["scheduled-events-api-version"], + help="Specifies the api-version to determine which Scheduled Events configuration schema version will be delivered.", + nullable=True, + ) user_initiated_reboot = cls._args_schema.scheduled_events_policy.user_initiated_reboot user_initiated_reboot.automatically_approve = AAZBoolArg( @@ -503,9 +594,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["rank"], help="Specifies the rank (a.k.a priority) associated with the VM Size.", nullable=True, - fmt=AAZIntArgFormat( - minimum=0, - ), ) spot_restore_policy = cls._args_schema.spot_restore_policy @@ -595,7 +683,6 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, fmt=AAZIntArgFormat( maximum=100, - minimum=0, ), ) rolling_upgrade_policy.pause_time_between_batches = AAZStrArg( @@ -818,7 +905,7 @@ def _build_arguments_schema(cls, *args, **kwargs): help="If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.", nullable=True, ) - _element.protected_settings = AAZFreeFormDictArg( + _element.protected_settings = AAZAnyTypeArg( options=["protected-settings"], help="The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", nullable=True, @@ -839,7 +926,7 @@ def _build_arguments_schema(cls, *args, **kwargs): help="The name of the extension handler publisher.", nullable=True, ) - _element.settings = AAZFreeFormDictArg( + _element.settings = AAZAnyTypeArg( options=["settings"], help="Json formatted public settings for the extension.", nullable=True, @@ -984,6 +1071,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Specifies the primary network interface in case the virtual machine has more than 1 network interface.", nullable=True, ) + _element.tags = AAZDictArg( + options=["tags"], + help="Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration", + nullable=True, + ) dns_settings = cls._args_schema.virtual_machine_profile.network_profile.network_interface_configurations.Element.dns_settings dns_settings.dns_servers = AAZListArg( @@ -1117,6 +1209,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.", nullable=True, ) + public_ip_address_configuration.tags = AAZDictArg( + options=["tags"], + help="Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration", + nullable=True, + ) dns_settings = cls._args_schema.virtual_machine_profile.network_profile.network_interface_configurations.Element.ip_configurations.Element.public_ip_address_configuration.dns_settings dns_settings.domain_name_label = AAZStrArg( @@ -1161,11 +1258,24 @@ def _build_arguments_schema(cls, *args, **kwargs): enum={"Global": "Global", "Regional": "Regional"}, ) + tags = cls._args_schema.virtual_machine_profile.network_profile.network_interface_configurations.Element.ip_configurations.Element.public_ip_address_configuration.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + tags = cls._args_schema.virtual_machine_profile.network_profile.network_interface_configurations.Element.tags + tags.Element = AAZStrArg( + nullable=True, + ) + os_profile = cls._args_schema.virtual_machine_profile.os_profile - os_profile.admin_password = AAZStrArg( + os_profile.admin_password = AAZPasswordArg( options=["admin-password"], help="Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

**Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\\W_])

**Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", \"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\", \"Password22\", \"iloveyou!\"

For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)", nullable=True, + blank=AAZPromptPasswordInput( + msg="Password:", + ), ) os_profile.admin_username = AAZStrArg( options=["admin-username"], @@ -1543,6 +1653,11 @@ def _build_arguments_schema(cls, *args, **kwargs): ) proxy_agent_settings = cls._args_schema.virtual_machine_profile.security_profile.proxy_agent_settings + proxy_agent_settings.add_proxy_agent_extension = AAZBoolArg( + options=["add-proxy-agent-extension"], + help="Specify whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for Linux Os.", + nullable=True, + ) proxy_agent_settings.enabled = AAZBoolArg( options=["enabled"], help="Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set.", @@ -1599,7 +1714,9 @@ def _build_arguments_schema(cls, *args, **kwargs): ) storage_profile.disk_controller_type = AAZStrArg( options=["disk-controller-type"], + help="Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01", nullable=True, + enum={"NVMe": "NVMe", "SCSI": "SCSI"}, ) storage_profile.image_reference = AAZObjectArg( options=["image-reference"], @@ -2017,7 +2134,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-11-01", + "api-version", "2025-04-01", required=True, ), } @@ -2064,7 +2181,7 @@ def __call__(self, *args, **kwargs): session, self.on_200_201, self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, + lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: @@ -2073,7 +2190,7 @@ def __call__(self, *args, **kwargs): session, self.on_200_201, self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, + lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) @@ -2116,7 +2233,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-11-01", + "api-version", "2025-04-01", required=True, ), } @@ -2182,6 +2299,7 @@ def _update_instance(self, instance): ) _builder.set_prop("extendedLocation", AAZObjectType, ".extended_location") _builder.set_prop("identity", AAZIdentityObjectType, ".identity") + _builder.set_prop("placement", AAZObjectType, ".placement") _builder.set_prop("plan", AAZObjectType, ".plan") _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) _builder.set_prop("sku", AAZObjectType, ".sku") @@ -2202,6 +2320,20 @@ def _update_instance(self, instance): if user_assigned_identities is not None: user_assigned_identities.set_elements(AAZObjectType, ".") + placement = _builder.get(".placement") + if placement is not None: + placement.set_prop("excludeZones", AAZListType, ".exclude_zones") + placement.set_prop("includeZones", AAZListType, ".include_zones") + placement.set_prop("zonePlacementPolicy", AAZStrType, ".zone_placement_policy") + + exclude_zones = _builder.get(".placement.excludeZones") + if exclude_zones is not None: + exclude_zones.set_elements(AAZStrType, ".") + + include_zones = _builder.get(".placement.includeZones") + if include_zones is not None: + include_zones.set_elements(AAZStrType, ".") + plan = _builder.get(".plan") if plan is not None: plan.set_prop("name", AAZStrType, ".name") @@ -2215,6 +2347,7 @@ def _update_instance(self, instance): properties.set_prop("automaticRepairsPolicy", AAZObjectType, ".automatic_repairs_policy") properties.set_prop("constrainedMaximumCapacity", AAZBoolType, ".constrained_maximum_capacity") properties.set_prop("doNotRunExtensionsOnOverprovisionedVMs", AAZBoolType, ".do_not_run_extensions_on_overprovisioned_v_ms") + properties.set_prop("highSpeedInterconnectPlacement", AAZStrType, ".high_speed_interconnect_placement") _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("hostGroup", AAZObjectType, ".host_group")) properties.set_prop("orchestrationMode", AAZStrType, ".orchestration_mode") properties.set_prop("overprovision", AAZBoolType, ".overprovision") @@ -2234,6 +2367,7 @@ def _update_instance(self, instance): additional_capabilities = _builder.get(".properties.additionalCapabilities") if additional_capabilities is not None: + additional_capabilities.set_prop("enableFips1403Encryption", AAZBoolType, ".enable_fips1403_encryption") additional_capabilities.set_prop("hibernationEnabled", AAZBoolType, ".hibernation_enabled") additional_capabilities.set_prop("ultraSSDEnabled", AAZBoolType, ".ultra_ssd_enabled") @@ -2253,6 +2387,7 @@ def _update_instance(self, instance): resiliency_policy.set_prop("automaticZoneRebalancingPolicy", AAZObjectType, ".automatic_zone_rebalancing_policy") resiliency_policy.set_prop("resilientVMCreationPolicy", AAZObjectType, ".resilient_vm_creation_policy") resiliency_policy.set_prop("resilientVMDeletionPolicy", AAZObjectType, ".resilient_vm_deletion_policy") + resiliency_policy.set_prop("zoneAllocationPolicy", AAZObjectType, ".zone_allocation_policy") automatic_zone_rebalancing_policy = _builder.get(".properties.resiliencyPolicy.automaticZoneRebalancingPolicy") if automatic_zone_rebalancing_policy is not None: @@ -2268,6 +2403,16 @@ def _update_instance(self, instance): if resilient_vm_deletion_policy is not None: resilient_vm_deletion_policy.set_prop("enabled", AAZBoolType, ".enabled") + zone_allocation_policy = _builder.get(".properties.resiliencyPolicy.zoneAllocationPolicy") + if zone_allocation_policy is not None: + zone_allocation_policy.set_prop("maxInstancePercentPerZonePolicy", AAZObjectType, ".max_instance_percent_per_zone_policy") + zone_allocation_policy.set_prop("maxZoneCount", AAZIntType, ".max_zone_count") + + max_instance_percent_per_zone_policy = _builder.get(".properties.resiliencyPolicy.zoneAllocationPolicy.maxInstancePercentPerZonePolicy") + if max_instance_percent_per_zone_policy is not None: + max_instance_percent_per_zone_policy.set_prop("enabled", AAZBoolType, ".enabled") + max_instance_percent_per_zone_policy.set_prop("value", AAZIntType, ".value") + scale_in_policy = _builder.get(".properties.scaleInPolicy") if scale_in_policy is not None: scale_in_policy.set_prop("forceDeletion", AAZBoolType, ".force_deletion") @@ -2280,10 +2425,15 @@ def _update_instance(self, instance): scheduled_events_policy = _builder.get(".properties.scheduledEventsPolicy") if scheduled_events_policy is not None: + scheduled_events_policy.set_prop("allInstancesDown", AAZObjectType, ".all_instances_down") scheduled_events_policy.set_prop("scheduledEventsAdditionalPublishingTargets", AAZObjectType, ".scheduled_events_additional_publishing_targets") scheduled_events_policy.set_prop("userInitiatedReboot", AAZObjectType, ".user_initiated_reboot") scheduled_events_policy.set_prop("userInitiatedRedeploy", AAZObjectType, ".user_initiated_redeploy") + all_instances_down = _builder.get(".properties.scheduledEventsPolicy.allInstancesDown") + if all_instances_down is not None: + all_instances_down.set_prop("automaticallyApprove", AAZBoolType, ".automatically_approve") + scheduled_events_additional_publishing_targets = _builder.get(".properties.scheduledEventsPolicy.scheduledEventsAdditionalPublishingTargets") if scheduled_events_additional_publishing_targets is not None: scheduled_events_additional_publishing_targets.set_prop("eventGridAndResourceGraph", AAZObjectType, ".event_grid_and_resource_graph") @@ -2291,6 +2441,7 @@ def _update_instance(self, instance): event_grid_and_resource_graph = _builder.get(".properties.scheduledEventsPolicy.scheduledEventsAdditionalPublishingTargets.eventGridAndResourceGraph") if event_grid_and_resource_graph is not None: event_grid_and_resource_graph.set_prop("enable", AAZBoolType, ".enable") + event_grid_and_resource_graph.set_prop("scheduledEventsApiVersion", AAZStrType, ".scheduled_events_api_version") user_initiated_reboot = _builder.get(".properties.scheduledEventsPolicy.userInitiatedReboot") if user_initiated_reboot is not None: @@ -2416,19 +2567,15 @@ def _update_instance(self, instance): properties.set_prop("autoUpgradeMinorVersion", AAZBoolType, ".auto_upgrade_minor_version") properties.set_prop("enableAutomaticUpgrade", AAZBoolType, ".enable_automatic_upgrade") properties.set_prop("forceUpdateTag", AAZStrType, ".force_update_tag") - properties.set_prop("protectedSettings", AAZFreeFormDictType, ".protected_settings") + properties.set_prop("protectedSettings", AAZAnyType, ".protected_settings") properties.set_prop("protectedSettingsFromKeyVault", AAZObjectType, ".protected_settings_from_key_vault") properties.set_prop("provisionAfterExtensions", AAZListType, ".provision_after_extensions") properties.set_prop("publisher", AAZStrType, ".publisher") - properties.set_prop("settings", AAZFreeFormDictType, ".settings") + properties.set_prop("settings", AAZAnyType, ".settings") properties.set_prop("suppressFailures", AAZBoolType, ".suppress_failures") properties.set_prop("type", AAZStrType, ".type") properties.set_prop("typeHandlerVersion", AAZStrType, ".type_handler_version") - protected_settings = _builder.get(".properties.virtualMachineProfile.extensionProfile.extensions[].properties.protectedSettings") - if protected_settings is not None: - protected_settings.set_anytype_elements(".") - protected_settings_from_key_vault = _builder.get(".properties.virtualMachineProfile.extensionProfile.extensions[].properties.protectedSettingsFromKeyVault") if protected_settings_from_key_vault is not None: protected_settings_from_key_vault.set_prop("secretUrl", AAZStrType, ".secret_url", typ_kwargs={"flags": {"required": True}}) @@ -2438,10 +2585,6 @@ def _update_instance(self, instance): if provision_after_extensions is not None: provision_after_extensions.set_elements(AAZStrType, ".") - settings = _builder.get(".properties.virtualMachineProfile.extensionProfile.extensions[].properties.settings") - if settings is not None: - settings.set_anytype_elements(".") - hardware_profile = _builder.get(".properties.virtualMachineProfile.hardwareProfile") if hardware_profile is not None: hardware_profile.set_prop("vmSizeProperties", AAZObjectType, ".vm_size_properties") @@ -2465,6 +2608,7 @@ def _update_instance(self, instance): if _elements is not None: _elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _elements.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[].properties") if properties is not None: @@ -2529,6 +2673,7 @@ def _update_instance(self, instance): public_ip_address_configuration.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}}) public_ip_address_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) public_ip_address_configuration.set_prop("sku", AAZObjectType, ".sku") + public_ip_address_configuration.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[].properties.ipConfigurations[].properties.publicIPAddressConfiguration.properties") if properties is not None: @@ -2558,6 +2703,14 @@ def _update_instance(self, instance): sku.set_prop("name", AAZStrType, ".name") sku.set_prop("tier", AAZStrType, ".tier") + tags = _builder.get(".properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[].properties.ipConfigurations[].properties.publicIPAddressConfiguration.tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + tags = _builder.get(".properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[].tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + os_profile = _builder.get(".properties.virtualMachineProfile.osProfile") if os_profile is not None: os_profile.set_prop("adminPassword", AAZStrType, ".admin_password", typ_kwargs={"flags": {"secret": True}}) @@ -2704,6 +2857,7 @@ def _update_instance(self, instance): proxy_agent_settings = _builder.get(".properties.virtualMachineProfile.securityProfile.proxyAgentSettings") if proxy_agent_settings is not None: + proxy_agent_settings.set_prop("addProxyAgentExtension", AAZBoolType, ".add_proxy_agent_extension") proxy_agent_settings.set_prop("enabled", AAZBoolType, ".enabled") _UpdateHelper._build_schema_host_endpoint_settings_update(proxy_agent_settings.set_prop("imds", AAZObjectType, ".imds")) proxy_agent_settings.set_prop("keyIncarnationId", AAZIntType, ".key_incarnation_id") @@ -2959,9 +3113,11 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): _schema.identity = cls._schema_virtual_machine_scale_set_read.identity _schema.location = cls._schema_virtual_machine_scale_set_read.location _schema.name = cls._schema_virtual_machine_scale_set_read.name + _schema.placement = cls._schema_virtual_machine_scale_set_read.placement _schema.plan = cls._schema_virtual_machine_scale_set_read.plan _schema.properties = cls._schema_virtual_machine_scale_set_read.properties _schema.sku = cls._schema_virtual_machine_scale_set_read.sku + _schema.system_data = cls._schema_virtual_machine_scale_set_read.system_data _schema.tags = cls._schema_virtual_machine_scale_set_read.tags _schema.type = cls._schema_virtual_machine_scale_set_read.type _schema.zones = cls._schema_virtual_machine_scale_set_read.zones @@ -2986,11 +3142,16 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): virtual_machine_scale_set_read.name = AAZStrType( flags={"read_only": True}, ) + virtual_machine_scale_set_read.placement = AAZObjectType() virtual_machine_scale_set_read.plan = AAZObjectType() virtual_machine_scale_set_read.properties = AAZObjectType( flags={"client_flatten": True}, ) virtual_machine_scale_set_read.sku = AAZObjectType() + virtual_machine_scale_set_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) virtual_machine_scale_set_read.tags = AAZDictType() virtual_machine_scale_set_read.type = AAZStrType( flags={"read_only": True}, @@ -3028,6 +3189,23 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): flags={"read_only": True}, ) + placement = _schema_virtual_machine_scale_set_read.placement + placement.exclude_zones = AAZListType( + serialized_name="excludeZones", + ) + placement.include_zones = AAZListType( + serialized_name="includeZones", + ) + placement.zone_placement_policy = AAZStrType( + serialized_name="zonePlacementPolicy", + ) + + exclude_zones = _schema_virtual_machine_scale_set_read.placement.exclude_zones + exclude_zones.Element = AAZStrType() + + include_zones = _schema_virtual_machine_scale_set_read.placement.include_zones + include_zones.Element = AAZStrType() + plan = _schema_virtual_machine_scale_set_read.plan plan.name = AAZStrType() plan.product = AAZStrType() @@ -3049,6 +3227,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): properties.do_not_run_extensions_on_overprovisioned_v_ms = AAZBoolType( serialized_name="doNotRunExtensionsOnOverprovisionedVMs", ) + properties.high_speed_interconnect_placement = AAZStrType( + serialized_name="highSpeedInterconnectPlacement", + ) properties.host_group = AAZObjectType( serialized_name="hostGroup", ) @@ -3111,6 +3292,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): ) additional_capabilities = _schema_virtual_machine_scale_set_read.properties.additional_capabilities + additional_capabilities.enable_fips1403_encryption = AAZBoolType( + serialized_name="enableFips1403Encryption", + ) additional_capabilities.hibernation_enabled = AAZBoolType( serialized_name="hibernationEnabled", ) @@ -3145,6 +3329,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): resiliency_policy.resilient_vm_deletion_policy = AAZObjectType( serialized_name="resilientVMDeletionPolicy", ) + resiliency_policy.zone_allocation_policy = AAZObjectType( + serialized_name="zoneAllocationPolicy", + ) automatic_zone_rebalancing_policy = _schema_virtual_machine_scale_set_read.properties.resiliency_policy.automatic_zone_rebalancing_policy automatic_zone_rebalancing_policy.enabled = AAZBoolType() @@ -3161,6 +3348,18 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): resilient_vm_deletion_policy = _schema_virtual_machine_scale_set_read.properties.resiliency_policy.resilient_vm_deletion_policy resilient_vm_deletion_policy.enabled = AAZBoolType() + zone_allocation_policy = _schema_virtual_machine_scale_set_read.properties.resiliency_policy.zone_allocation_policy + zone_allocation_policy.max_instance_percent_per_zone_policy = AAZObjectType( + serialized_name="maxInstancePercentPerZonePolicy", + ) + zone_allocation_policy.max_zone_count = AAZIntType( + serialized_name="maxZoneCount", + ) + + max_instance_percent_per_zone_policy = _schema_virtual_machine_scale_set_read.properties.resiliency_policy.zone_allocation_policy.max_instance_percent_per_zone_policy + max_instance_percent_per_zone_policy.enabled = AAZBoolType() + max_instance_percent_per_zone_policy.value = AAZIntType() + scale_in_policy = _schema_virtual_machine_scale_set_read.properties.scale_in_policy scale_in_policy.force_deletion = AAZBoolType( serialized_name="forceDeletion", @@ -3174,6 +3373,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): rules.Element = AAZStrType() scheduled_events_policy = _schema_virtual_machine_scale_set_read.properties.scheduled_events_policy + scheduled_events_policy.all_instances_down = AAZObjectType( + serialized_name="allInstancesDown", + ) scheduled_events_policy.scheduled_events_additional_publishing_targets = AAZObjectType( serialized_name="scheduledEventsAdditionalPublishingTargets", ) @@ -3184,6 +3386,11 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): serialized_name="userInitiatedRedeploy", ) + all_instances_down = _schema_virtual_machine_scale_set_read.properties.scheduled_events_policy.all_instances_down + all_instances_down.automatically_approve = AAZBoolType( + serialized_name="automaticallyApprove", + ) + scheduled_events_additional_publishing_targets = _schema_virtual_machine_scale_set_read.properties.scheduled_events_policy.scheduled_events_additional_publishing_targets scheduled_events_additional_publishing_targets.event_grid_and_resource_graph = AAZObjectType( serialized_name="eventGridAndResourceGraph", @@ -3191,6 +3398,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): event_grid_and_resource_graph = _schema_virtual_machine_scale_set_read.properties.scheduled_events_policy.scheduled_events_additional_publishing_targets.event_grid_and_resource_graph event_grid_and_resource_graph.enable = AAZBoolType() + event_grid_and_resource_graph.scheduled_events_api_version = AAZStrType( + serialized_name="scheduledEventsApiVersion", + ) user_initiated_reboot = _schema_virtual_machine_scale_set_read.properties.scheduled_events_policy.user_initiated_reboot user_initiated_reboot.automatically_approve = AAZBoolType( @@ -3405,7 +3615,7 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): properties.force_update_tag = AAZStrType( serialized_name="forceUpdateTag", ) - properties.protected_settings = AAZFreeFormDictType( + properties.protected_settings = AAZAnyType( serialized_name="protectedSettings", ) properties.protected_settings_from_key_vault = AAZObjectType( @@ -3419,7 +3629,7 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): flags={"read_only": True}, ) properties.publisher = AAZStrType() - properties.settings = AAZFreeFormDictType() + properties.settings = AAZAnyType() properties.suppress_failures = AAZBoolType( serialized_name="suppressFailures", ) @@ -3477,6 +3687,7 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): _element.properties = AAZObjectType( flags={"client_flatten": True}, ) + _element.tags = AAZDictType() properties = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.network_profile.network_interface_configurations.Element.properties properties.auxiliary_mode = AAZStrType( @@ -3579,6 +3790,7 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): flags={"client_flatten": True}, ) public_ip_address_configuration.sku = AAZObjectType() + public_ip_address_configuration.tags = AAZDictType() properties = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.network_profile.network_interface_configurations.Element.properties.ip_configurations.Element.properties.public_ip_address_configuration.properties properties.delete_option = AAZStrType( @@ -3623,6 +3835,12 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): sku.name = AAZStrType() sku.tier = AAZStrType() + tags = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.network_profile.network_interface_configurations.Element.properties.ip_configurations.Element.properties.public_ip_address_configuration.tags + tags.Element = AAZStrType() + + tags = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.network_profile.network_interface_configurations.Element.tags + tags.Element = AAZStrType() + os_profile = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.os_profile os_profile.admin_password = AAZStrType( serialized_name="adminPassword", @@ -3852,6 +4070,9 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): ) proxy_agent_settings = _schema_virtual_machine_scale_set_read.properties.virtual_machine_profile.security_profile.proxy_agent_settings + proxy_agent_settings.add_proxy_agent_extension = AAZBoolType( + serialized_name="addProxyAgentExtension", + ) proxy_agent_settings.enabled = AAZBoolType() proxy_agent_settings.imds = AAZObjectType() cls._build_schema_host_endpoint_settings_read(proxy_agent_settings.imds) @@ -3985,6 +4206,26 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): sku.name = AAZStrType() sku.tier = AAZStrType() + system_data = _schema_virtual_machine_scale_set_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + tags = _schema_virtual_machine_scale_set_read.tags tags.Element = AAZStrType() @@ -3997,9 +4238,11 @@ def _build_schema_virtual_machine_scale_set_read(cls, _schema): _schema.identity = cls._schema_virtual_machine_scale_set_read.identity _schema.location = cls._schema_virtual_machine_scale_set_read.location _schema.name = cls._schema_virtual_machine_scale_set_read.name + _schema.placement = cls._schema_virtual_machine_scale_set_read.placement _schema.plan = cls._schema_virtual_machine_scale_set_read.plan _schema.properties = cls._schema_virtual_machine_scale_set_read.properties _schema.sku = cls._schema_virtual_machine_scale_set_read.sku + _schema.system_data = cls._schema_virtual_machine_scale_set_read.system_data _schema.tags = cls._schema_virtual_machine_scale_set_read.tags _schema.type = cls._schema_virtual_machine_scale_set_read.type _schema.zones = cls._schema_virtual_machine_scale_set_read.zones