code: def _get_vm_public_ip(
      network_client: network_mgmt.NetworkManagementClient,
      resource_group: str,
      vm: VirtualMachine,
  ) -> str:
      nic_id = vm.network_profile.network_interfaces[0].id
      nic_name = azure_utils.get_resource_name_from_resource_id(nic_id)
      nic = network_client.network_interfaces.get(
          resource_group_name=resource_group,
          network_interface_name=nic_name,
      )
      public_ip_id = nic.ip_configurations[0].public_ip_address.id
      public_ip_name = azure_utils.get_resource_name_from_resource_id(
          public_ip_id
      )
      public_ip = network_client.public_ip_addresses.get(
          resource_group, public_ip_name
      )
      return public_ip.ip_address
  
imports: import base64
  import re
  from typing import List, Optional
  from azure.core.credentials import TokenCredential
  from azure.core.exceptions import ResourceExistsError
  from azure.mgmt import compute
  from azure.mgmt import network
  from azure.mgmt.compute.models import DiskCreateOptionTypes, HardwareProfile, ImageReference, LinuxConfiguration, ManagedDiskParameters, NetworkProfile, OSDisk, OSProfile, ResourceIdentityType, ResourceSku, SshConfiguration, SshPublicKey, StorageAccountTypes, StorageProfile, SubResource, UserAssignedIdentitiesValue, VirtualMachine, VirtualMachineIdentity, VirtualMachineNetworkInterfaceConfiguration, VirtualMachineNetworkInterfaceIPConfiguration, VirtualMachinePublicIPAddressConfiguration
  from dstack import version
  from dstack._internal.core.backends.azure import utils
  from dstack._internal.core.backends.azure.config import AzureConfig
  from dstack._internal.core.backends.base.compute import Compute, get_gateway_user_data, get_instance_name, get_user_data
  from dstack._internal.core.backends.base.offers import get_catalog_offers
  from dstack._internal.core.errors import NoCapacityError
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceAvailability, InstanceOffer, InstanceOfferWithAvailability, LaunchedGatewayInfo, LaunchedInstanceInfo
  from dstack._internal.core.models.runs import Job, Requirements, Run
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 7 for calling a global function with example usage: _get_vm_public_ip(network_client, resource_group, vm) and returns: public_ip