简体   繁体   中英

Azure DevOps AzureFileCopy@4 task copy files to VM with no Public IP

I have a DevOps pipeline AzureFileCopy@4 task which I need to copy files to a VM. The task setup is straightforward:

    - task: AzureFileCopy@4
      inputs:
        azureSubscription: '<subscription>'
        storage: '<storagename>'
        SourcePath: 'testfile.txt'
        Destination: 'AzureVMs'
        resourceGroup: 'test-rg'
        MachineNames: 'TEST-VM'
        vmsAdminUserName: 'testAdmin'
        vmsAdminPassword: '$(TestAdminPassword)'
        TargetPath: 'c:\destination'

The file is uploaded to storage, but the log then shows the following error:

##[error]Unable to get FQDN for all resources in ResourceGroup : 'test-rg'

I assume this is because the VM does not have a Public IP associated with it, as requirements are that this VM not be publicly exposed. I know the fairly obvious answer would seem to be it needs a public IP, but in other steps in this pipeline there are Powershell tasks that are executed on the same VM using az vm run-command and supplying machine name and resource group, just as this step does, so I'm hoping there is a way to still use this.

Is it possible to use AzureFileCopy in DevOps to copy files to a VM without a Public IP?

According to this thread : No it is not possible to use Azure file copy without public IP. Public IP address of the VM is must for Azure File Copy task. This is required to establish connection to the machine from Agent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM