-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a majority of the App Service Section
- Loading branch information
Showing
7 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
docs/4-cloud-computing/4.3.7-app-service.md: | ||
category: Cloud Computing | ||
estReadingMinutes: 10 | ||
exercises: | ||
- | ||
name: Deploy Simple Web Application to App Service | ||
description: Create A Web App and Scale and Monitor | ||
estMinutes: 240 | ||
technologies: | ||
- Azure | ||
- Azure App Service | ||
- Azure CLI | ||
--- | ||
# Azure App Service | ||
|
||
Azure App Service is a fully managed platform for building, deploying, and scaling web apps. It supports various programming languages and frameworks like .NET, Java, Node.js, Python, and more, allowing developers to build web and mobile back-ends with ease. Through Azure App Service, you can integrate with various Azure tools like Azure DevOps for CI/CD and take advantage of built-in features such as custom domains and SSL certificates. It's designed with best practices in mind, providing scalability, robust monitoring, and security, thereby enabling a seamless and efficient app hosting solution. | ||
|
||
> [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/) Documentation | ||
### Exercise 1: Deploy a Java Application | ||
|
||
We will be using liatrio's version of the spring-petclinic for this exercise, its a simple java application that deploys a web app for a virtual pet clinic. | ||
|
||
1. Fork [Spring-Petclinic](https://github.com/liatrio/spring-petclinic.git). (We will be using this later for Continuous Deployment) | ||
|
||
2. Clone your new fork. | ||
|
||
```bash | ||
git clone https://github.com/YOUR_NAME/spring-petclinic.git | ||
``` | ||
|
||
!> There is an official repo for the spring-petclinic, we will not be using that since it contains different build test that may not be useful for our purposes and might break the application on build. | ||
|
||
3. Install the maven project and ensure that you can reach the application locally to move onto the next step. | ||
|
||
![Spring Petclinic Landing Page](img4/spring-petclinic-1.png ':size=912x400') | ||
|
||
#### Deploy the Java App to App Service | ||
|
||
1. Read the above documentation about Azure App Service and use Microsofts official [Maven Plugin](https://learn.microsoft.com/en-us/azure/app-service/quickstart-java?tabs=javase&pivots=platform-linux-development-environment-maven) to deploy a java application. | ||
2. Make sure the application you deploy can be reached by copying the domain it gives you at the end and pasting that into your web browser. | ||
|
||
?> If you wish, you may change the name of your application in the pom file before you deploy. | ||
|
||
### Exercise 2: Deploy a Docker Application | ||
|
||
We have seen that the Azure App Service can be useful for deploying a Java application using Azures built in maven plugin, but what if our application doesn't use java? What if it uses something that isn't natively supported by Azure? That's where docker containers come in, they are super versatile and can run a wide range of applications that are otherwise not supported by the Azure App Service natively. In this exercise, we will be taking the spring-petclinic and publish a docker image to be used with the Azure App Service. This will demonstrate a more practical use for App Service, as a majority on Engineers would be using Docker Containers. | ||
|
||
#### Build and Publish Docker Image | ||
|
||
1. Using the readme in the spring-petclinic repo, build a docker image and publish the image to your desired remote image repository. | ||
|
||
?> You might need your credentials if you choose to deploy the application to an image repository other than the ACR | ||
|
||
2. Run the container locally and ensure that you can access the application. | ||
|
||
3. Using the Azure Docs from earlier, deploy the application to Azure App Service and ensure you can reach the application using the provided domain. | ||
|
||
?> App Service listens on port 80 by default | ||
|
||
#### Scale Application | ||
|
||
Application Scaling in essential in balancing the load and giving the application more resources to execute properly. Azure App Service has this feature built in and we can use the Azure CLI to scale up and scale out our service. | ||
|
||
1. Using the Azure CLI, Scale up your application by subscribing to a better service plan | ||
|
||
```bash | ||
az appservice -h | ||
``` | ||
|
||
?> The new service plan can just be the next one up, no need to upgrade to a large machine | ||
|
||
2. With the same command as before, scale out the application for more instances to be used. Increase the number of instances from 1 to 2 and verify that the change went live. | ||
|
||
#### Monitor Application | ||
|
||
Monitoring is a great way for developers to track their applications logs, resource consumption, crash dumps, etc. Azure App Service provides a method for doing this called Azure Monitors. This allows us to connect a monitor to a resource, such as an Azure App Service, and track exactly what we need depending on the application. | ||
|
||
1. Follow [this](https://learn.microsoft.com/en-us/azure/app-service/tutorial-troubleshoot-monitor) tutorial on the Azure App Service docs and create a simple monitor for the spring-petclinic and confirm that your monitor is actually tracking logs. | ||
|
||
?> Do not use the example they give you in the tutorial, use the spring-petclinic | ||
|
||
#### Setup CI/CD and show changes | ||
|
||
Continuous Integration and Continuous Deployment are essential for a DevOps Engineer to understand and practice. Using the spring-petclinic application, create a workflow for the fork that does the following: | ||
|
||
* Builds and Pushes a Docker image to a container registry | ||
* Deploys docker image to the App Service | ||
|
||
Make a simple change to the spring-petclinic application and show that the changes you made will deploy to the App Service using your workflow. | ||
|
||
## Deliverables | ||
|
||
- Placeholder 0.o |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters