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:
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:
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:
We create an ‘HTML’ folder and pass one file in it:
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:
I am not interested in preconfigured pipelines zo I create an empty one:
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):
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’:
Once you get it from free from the Market Place and add it to your pipeline, you need to add
- The FTP address (URL)
- The FTP Credentials (name and password)
- The source path (folder) in Azure DevOps (html)
- 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:
Save it and queue it!
If you are in luck, the build succeeds (check out that green indicator):
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:
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:
Here you can also disable FTP if you do not need it.
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.