Have you heard of…
automated deployment of applications with Azure App Services?
If not, here are the basics.
When creating web applications using solutions such as NodeJS or .NET Core you don’t have to look for hosting services that would support the framework or buy access to a virtual machine where you would have to configure the web server. Using the Azure App Service solution you can speed up the process significantly!
What is App Service?
Azure App Service is a PaaS solution that allows you to quickly publish applications using the framework of your choice. Thanks to this solution, the only thing a developer has to worry about is proper CI/CD configuration or uploading files to the Azure platform.
How to configure CI/CD?
Firstly, you need to create an App Service. In the window of creating a new Web App, you need to provide basic information – resource group, region and the name, which will be part of the FQDN under which the application will be available.
To be able to directly publish the code of an application written in a given framework, select the „Publish: Code” option, and then indicate the technology in which the application is created (runtime stack). For testing purposes, you can choose the „Free F1” plan, so you can test the solution without any additional costs.
After creating an instance, it is possible to integrate CI/CD with GitHub. To do this, go to the App Service tab, select the previously created instance and go to the „Deployment Center” tab. Then, in the „Settings” section, indicate how to deploy. You can choose from two options:
· CI/CD – configure automatic deployment,
· Manual Deployment (push) – manual indication and uploading the source code (repository, OneDrive, Dropbox).
In order to set up automatic deployment from GitHub, select the „CI/CD” option, choose „GitHub” and then log in to your account and indicate the repository and branch with the source code.
Before saving the changes, you can preview the automatically generated Workflow configuration using the „Preview file” button. After saving the changes, the file will be added to the specified GitHub repository.
After uploading the Workflow configuration file to GitHub, the process of deploying the application to the Azure platform will begin.
The whole configuration takes a few minutes and is done without the need for defining the workflow manually. Due to this, every time you push the selected branch, a new code will be automatically deployed to the App Service. Quick and convenient.
App Service and Visual Studio
If you are using the Visual Studio application, you can publish your application to App Service with a few mouse clicks. To do this in Visual Studio, go to the „Build” tab and then select „Publish”. A wizard window will open in which you should indicate that you want to publish your application to the Azure cloud. After authorizing the account and indicating the App Service instance, just click the „Publish” button to have your application automatically deployed to the Azure cloud. Each time you want to publish a code again, all you need to do is click the „Publish” button to deploy a new version of the application.