I am testing the differences between using the Hosted2017 agents and using my own private agent. However, I'm seeing some differences between them and I'm wondering why.
I am running the same Release deployment on each agent and am seeing the following:
Hosted Agent
Time to complete: 12 minutes 5 seconds
2018-04-30T07:54:59.6024079Z ##[section]Starting: AzureBlob File Copy
2018-04-30T07:54:59.6030890Z ==============================================================================
2018-04-30T07:54:59.6031191Z Task : Azure File Copy
2018-04-30T07:54:59.6031605Z Description : Copy files to Azure blob or VM(s)
2018-04-30T07:54:59.6031911Z Version : 1.0.113
2018-04-30T07:54:59.6032148Z Author : Microsoft Corporation
2018-04-30T07:54:59.6032489Z Help : [More Information](https://aka.ms/azurefilecopyreadme)
2018-04-30T07:54:59.6032796Z ==============================================================================
2018-04-30T07:55:02.3941789Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\2.1.0\AzureRM.psd1 -Global
2018-04-30T07:55:23.1329012Z ##[warning]The names of some imported commands from the module 'AzureRM.Websites' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
2018-04-30T07:55:23.1387167Z ##[warning]The names of some imported commands from the module 'AzureRM' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
2018-04-30T07:55:23.1744219Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM.Profile\2.1.0\AzureRM.Profile.psm1 -Global
2018-04-30T07:55:23.2698889Z ##[command]Add-AzureRMAccount -ServicePrincipal -Tenant ******** -Credential System.Management.Automation.PSCredential -EnvironmentName AzureCloud
2018-04-30T07:55:25.2215351Z ##[command] Select-AzureRMSubscription -SubscriptionId c629991b-869a-43aa-aa02-acfe4cda7627 -TenantId ********
2018-04-30T07:55:34.1760503Z Uploading files from source path: 'D:\a\r1\a\Staged' to storage account: 'xxx' in container: 'xxx' with blob prefix: 'xxx'
2018-04-30T08:07:04.2055191Z Uploaded files successfully from source path: 'D:\a\r1\a\Staged' to storage account: 'xxx' in container: 'xxx' with blob prefix: 'xxx'
2018-04-30T08:07:04.2526366Z ##[section]Finishing: AzureBlob File Copy
Private Agent
Time to complete: 01 minute 48 seconds
2018-04-30T08:14:23.3441233Z ##[section]Starting: AzureBlob File Copy
2018-04-30T08:14:23.3471235Z ==============================================================================
2018-04-30T08:14:23.3471235Z Task : Azure File Copy
2018-04-30T08:14:23.3471235Z Description : Copy files to Azure blob or VM(s)
2018-04-30T08:14:23.3481236Z Version : 1.0.113
2018-04-30T08:14:23.3481236Z Author : Microsoft Corporation
2018-04-30T08:14:23.3481236Z Help : [More Information](https://aka.ms/azurefilecopyreadme)
2018-04-30T08:14:23.3481236Z ==============================================================================
2018-04-30T08:14:25.3242366Z Added TLS 1.2 in session.
2018-04-30T08:14:26.8353230Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\4.1.0\AzureRM.psd1 -Global
2018-04-30T08:14:40.1420841Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM.Profile\3.1.0\AzureRM.Profile.psm1 -Global
2018-04-30T08:14:40.7431185Z ##[command]Add-AzureRMAccount -ServicePrincipal -Tenant ******** -Credential System.Management.Automation.PSCredential -Environment AzureCloud
2018-04-30T08:14:41.9971902Z ##[command] Select-AzureRMSubscription -SubscriptionId c629991b-869a-43aa-aa02-acfe4cda7627 -TenantId ********
2018-04-30T08:14:47.6425131Z Uploading files from source path: 'D:\Agents\vsts-agent-master\_work\r1\a\Staged' to storage account: 'updatesystemstorage' in container: 'xxx' with blob prefix: 'xxx'
2018-04-30T08:16:11.0402832Z Uploaded files successfully from source path: 'D:\Agents\vsts-agent-master\_work\r1\a\Staged' to storage account: 'xxx' in container: 'xxx' with blob prefix: 'xxx'
2018-04-30T08:16:11.0912861Z ##[section]Finishing: AzureBlob File Copy
Why is the hosted agent using AzureRM 2.1.0 and the private agent using 4.1.0?
Is this normal?
This task uses the AzureRm Modules that are present on the system running the agent. Your private agent uses 4.1.0 because someone/something installed the modules in that version on the machine and the hosted agent is not that up to date. That difference is normal.
Thanks - Is there a way to force this on the hosted agents? Is there a task to force install the lastest AzureRM PS module?
Please add a Powershell script to your release definition before the azure file copy task:
Install-Module -Name AzureRM -AllowClobber -Force
It will install 5.7.0 (which is latest).
If you want to use 4.1.0
Install-Module -Name AzureRM -RequiredVersion 5.5.0 -AllowClobber -Force
use this script in your Powershell task .
Feel free to contact us If you still face any issue.
Most helpful comment
Please add a Powershell script to your release definition before the azure file copy task:
Install-Module -Name AzureRM -AllowClobber -Force
It will install 5.7.0 (which is latest).
If you want to use 4.1.0
Install-Module -Name AzureRM -RequiredVersion 5.5.0 -AllowClobber -Force
use this script in your Powershell task .
Feel free to contact us If you still face any issue.