Use FTPS to deploy your WebApp using Azure DevOps

It’s obvious, there is a strong relationship between Microsoft Azure and Azure DevOps.

And that is OK.

One of the most used features by my colleagues is the deployment of WebApps using Azure DevOps continuous integration.

The build pipeline has specific tasks to support this great feature.

You can also see it in the Azure portal when checking out the deployment center of a WebApp:

waftp01

There is one thing you need to know though: you need to have access to the Azure portal to get access to a WebApp.

So I checked out FTP. Yes, this is a simple protocol to move files from ‘A’ to ‘B’.

Secure FTP is supported too by an Azure WebApp:

waftp02

And it already provides a ‘generic’ name and password.

Let’s check out how this works in Azure DevOps.

First, we create a new Azure DevOps project:

waftp03

We create an ‘HTML’ folder and pass one file in it:

waftp04

Our goal is to deploy the files (..) in the HTML folder in a web app.

So we need to create a Build pipeline. I want to create one using the classic editor (which works like a wizard) so I skip all the YAML versions:

waftp05

I am not interested in preconfigured pipelines zo I create an empty one:

waftp06

Before we proceed to add a task to the pipeline, we first modify the trigger which triggers the pipeline. We want to have this pipeline triggered every time somebody checks in files (continuous integration):

waftp07

Now we check out the tasks list.

We only need to add one task which implements secure FTP to move over our files. There are several free FTP tasks in the task Market Place. Finally, I went for ‘FTP Uploader’:

waftp08

Once you get it from free from the Market Place and add it to your pipeline, you need to add

  1. The FTP address (URL)
  2. The FTP Credentials (name and password)
  3. The source path (folder) in Azure DevOps (html)
  4. The target path (folder) in the WebApp (site/wwwroot)

Note: To get the FTP Address and the target path, you need to slice-and-dice the WebApp FTP Endpoint (like ‘ftps://waws-prod-am2-111.ftp.azurewebsites.windows.net/site/wwwroot’). Drop the ‘ftps://’

So you fill in the blanks and you get this:

waftp09

Save it and queue it!

If you are in luck, the build succeeds (check out that green indicator):

waftp10

And if you check the website, you will see your latest changes. Just check-in some changes and see how the build succeeds and the website is redeployed:

waftp11

FTP vs secure FTP

We are deploying to a WebApp using FTP/Secure FTP. It’s not exactly clear what this third-party task is doing.

To force secure FTP, go to the settings of our WebApp and manipulate the FTP access:

waftp12

Here you can also disable FTP if you do not need it.

Conclusion

I first tried the other two FTP tasks. One was complaining about the URL/credentials combination. The other one did deploy the first time but the second time it was complaining the target folder was locked (files and/or folder in use).

But in the end, deploying artifacts of static files is not that hard using FTP.

 

Advertenties

Een reactie op “Use FTPS to deploy your WebApp using Azure DevOps

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s