Azure app Service is a service-as-a-platform (PaaS) solution that the Azure cloud offers us among its vast number of solutions, from being able to develop our web applications, upload an API, work even with third-party applications, without worrying about the management of your infrastructure. Traditionally, deployment of any web application should not only require planning its architecture from the development point of view, but also consider the part of the entire infrastructure that must be developed or created, such as networks, load balancing, fault tolerance, having high availability among some things that must be considered that we must handle in our applications. Once these systems or these web applications or APIs, in general, are deployed under a production environment, it needs to be maintained, that is where our infrastructure personnel comes in, which monitor the health of these applications. All that responsibility is summarized with this solution that came to developers as a fall from the sky called Azure App Service, where it gives us the ease of creating applications and deploying them in a super easy way without having to worry about all that maintenance layer and vital infrastructure to have our applications turned on and fully functional.
What you will learn in this article,
- You will learn to create an App Service directly from the Azure portal
- You will be able to connect through the FTP protocol to the App Service web app through the Filezilla application
- Be able to backup and manage files and folders in that instance of App Service through Filezilla through the FTP protocol
Creating an App Service
The first thing we must do to put this article into practice is to start preparing all the necessary resources in the Azure cloud but for this, we must first create our Azure account, if you already have it then you can skip this step and enter to the main Azure portal (https://portal.azure.com) where we are going to select the hamburger button in the upper left corner of the main portal we are going to click on the first option as it appears in the following image.
Azure establishes a series of common elements to create in its resources, for this article we are going to click on the Web App option as shown below.
Once we have gone to the form for creating a web app for App Services we are going to select the subscription as the first option, then we are going to create a new resource, in my case, I call it Demos, as the next option we give a name to the web app, This at the same time will be the URL to which we are going to access from the internet I call it demoappservicefilezilla, in publication we leave in the Code option, then in the Runtime option you can really choose any, the interest of this demo is to access the files that are in this space reserved to host our app, in my case select .NET 5, in the operating system option we leave it as it is by default, in this case Windows and in the region, add the one that makes sense to you, to this demo select South Central US.
In the App service plan section, since I did not have any new one, I gave him to create a new plan and on the right side a page will be displayed where the different price schemes offered by the app service to host will appear, first select in its different environments (Dev / Test – Production – Isolated), for the purposes of this demo we are going to click on the first option (Dev / Test) and select the tier F1 which is free where it offers us 1 GB of memory and 60 minutes a day of computation, this means that between each transaction, whether request or response, it will consume us within our range of time offered daily by this tier that does not exceed 60 minutes which for tests and we give this more than enough, more It is not an instance that we must leave later when we want to go to production or more public environments.
After selecting or creating the app service plan and applying the changes, we give it to review and create so that it sends us to the next page where it will show us a summary of all the selected configurations, we click the create button for Azure to proceed. to create our web app as shown in the following image.
Once the resource is created, let’s do it by clicking the Go to resource button.
To check that everything is 100% functional with our web app we are going to look for the Browse option on the main page of the resource that belongs to our web app or locate the URL option and click on the option to copy and paste the path in our web browser to confirm that we already have our web app running smoothly as shown below.
In this way, we have already created our web app through which we will be able to connect via FTP with Filezilla and manage the files that are hosted on that resource.
Connect App Service using Filezilla
Here the trick to connect by FTP to any web app is to obtain the publication profile that the app service offers us on the main page of that resource that we create, we are going to locate the Get Publish Profile option and click to download the file with the extension .PublishSettings as shown below.
Once the file is downloaded we locate it and open it with our notepad and we are going to click on the format option and click on line wrapping so that the file does not open and everything is shown in a single line and it looks more understandable the file, then we will notice that it looks like XML code with relevant configuration users, passwords, URLs, in reality what you are downloading are the profiles for connection via FTP, passive FTP and webapp that we will later see in other articles how to get the most out of them for make releases of our applications in a faster and easier way, continuing with the article we are going to locate the publishProfile tag and to make it more understandable we do enter to give spaces and from there get the profile that interests us which is the FTP as it is shown in the following pictures.
Ok then, having the connection data, we open Filezilla and click on the first icon on the left side, which is where a connection configuration window will be displayed and we will click on the New Site option, we give it a name to our site, in my case put DemoAzureAppService as shown below.
At this step we will see on the right side of the connection window a series of values that we are going to fill with the configurations that we already have from the publishProfile file where we are going to copy the publishUrl and we are going to paste it in the host box as the first step, then We continue with the username and password, it is more than obvious to locate it in the notepad, we copy and paste them and click on Connect as shown in the following image.
Until this step we are doing very well, we will only be shown a window showing us the incoming connection certificate that will allow us to make a connection with the Azure resource through the FTP protocol, we simply click OK.
Up to this point we can already connect by FTP to our web app and be able to manage our files, in this case, we only see a file that is predefined by Azure when creating an app service resource that is the hostingstart.html file.
Backup and make changes to our files
In the previous steps we were able to connect through Filezilla to our reserved space where we have the files that belong to our web app, for now we have the only file that Azure automatically generates, but up to now we could upload relevant files to a web portal, modify images, change names and permissions to folders, to make a test if any change takes effect we click on the wwwroot folder, and in the list below we will see the file hostingstart.html we right click and click on the option View / Edit
It will open the notepad with all the content in HTML where we are going to look for the title tag and I am only going to change the lines of the title to see the change in real time after saving the file as shown in the following image.
A window will be shown where we are going to confirm the changes made on the server itself in the hostingstart.html file and we click Yes.
We go to our Azure web app and copy the url or click on browse and it will show us the changes we made directly from FTP to the html file that we previously modified.
In this way, as we saw in the previous steps, we can quickly demonstrate the use of the Filezilla tool to manage the files already stored in that instance of app service, either to configure some things that were pending, some modification of a parameter or variable in a configuration by environments, some backup, some missing file to be replaced or added, in short. Accessing quickly through Filezilla we can more comfortably control our App service instances, if we are aware and know that management can already be done through other resources through either the App Service Editor that is still in the preview phase today. today as well as through KUDU, the CLI and also tools like Powershell but nothing takes away the convenience of dragging and dropping files easily through Filezilla or some file management program through the FTP protocol.