Cannot download files from Internet for a PowerShell based Provisioner other work OK

15 views
Skip to first unread message

richard...@live.co.uk

unread,
Sep 26, 2018, 8:01:03 AM9/26/18
to Packer

Goal

I am trying to install BizTalk 2016 onto to Hyper-V image using Packer, following the model used but the Microsoft Azure Devops Build Agents.


Issue

I have created a custom PowerShell provisioner script that installs the product silently and works without issues from a PowerShell prompt, but when it is runs within a Packer process the download of the files required fails.


Note: that in the same Packer process I am successfully downloading and installing VS2015 and other tools, so there is no fundamental network issue.


Questions

  • Why should I get a different behavior running a provisioner script from a PowerShell from a prompt, as opposed to in the Packer image creation process?
  • And that can I do to fix this difference?

What I have tried

As there is no public 'eval' installer ISO/MSI for BizTalk 2016 I have a ZIP of the developer edition media.

  • I first tried to place this on a web site (that required no authentication), but the download failed with all three PowerShell download methods (cmdlet, webclient and BITS). All these transfer methods worked correctly if the script was run from a command prompt, but failed if run within a Packer image creation process.
  • I moved the ZIP to azure storage and accessed it as a remote drive and this worked, I was hence able to unZIP the file and run the Setup.exe
  • However the setup requires the BTSRedist.cab, a download usually done by the installer, which failed when running in a Packer image creation, but works fine if the same script is run from a command prompt.

Summary

I have been battling against this one for a while so any suggestion would be useful. I know I could make sure all the CABs are in my ZIP file but I would like to know why the download fails within the Packer process for this script but not for other provisioners

Reply all
Reply to author
Forward
0 new messages