SSIS Package to Connect to HTTP Source and Download File – How to Create

ssis

I'm new to SSIS. I can see "FTP Task" in the SSIS toolbox in VS2015 Community edition. Is there an HTTP equivalent?

I have a HTTP url and some user credentials. Shared via the HTTP url is a .sql file. I want to login and download the file every Sunday @ 1am.

Can anyone point me in the right direction please?

Best Answer

Your only option is going to be calling a script. Either using PowerShell script via Execute Process task, or using C# in a Script Task to download it.

For the PowerShell script you would use Invoke-WebRequest as it supports passing in credentials. A good example of this can be found here. The example from the article:

$Credentials = Get-Credential
Invoke-WebRequest -Uri "https://www.contoso.com" -OutFile "C:\path\file" -Credential $Credentials

To keep from being prompted you can use various ways to encrypt it, just depends on if the password has to be kept secure. If not just modify it to be something like this:

$pwd = ConvertTo-SecureString "MyT0pSecr3tP@ssw0rd" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential (“username”, $pwd)
Invoke-WebRequest -Uri "https://www.contoso.com" -OutFile "C:\path\file" -Credential $creds