App Service
App Service
With Azure App service, Azure provides a new level of backend integration for
mobile and web services.
In this course, you will be introduced to different types of azure app services,
key features, continuous deployment, deployment slots, app scaling, and app
management such as monitoring and securing of apps (mostly focuses on web apps).
Happy Learning!
All azure app services such as web apps, API apps, function apps, and mobile apps
run in an app service plan.
Web Apps
Web app is a compute resource which can be on a shared or dedicated VM that azure
offers for website hosting.
DevOps optimization: Set up CI and CD with different tools and enables typical
DevOps life cycle.
Global scale with high availability: Automatically or manually scales up or out and
ensures the hosting of your application globally.
Connections to SaaS platforms and on-premises data: Access on-premises data using
hybrid connections
Visual Studio integration: Dedicated tools in Visual Studio streamline the work of
creating, deploying, and debugging.
Web Apps adds the Power of Microsoft Azure, such as security, load balancing,
autoscaling, and automated management.
The above picture contrasts the traditional hosting and azure web app hosting.
Mobile Apps
Mobile apps in app service offers globally available and highly scalable mobile
application development platform for system integrators and enterprise developers.
Continuous Deployment - can integrate with common SCM systems, allowing you to
automatically deploy a new version of your backend by pushing to a branch of your
SCM system.
Build native and cross platform apps: You can take the advantage of App services
using native SDKs irrespective of your android, iOS, windows apps.
Connect to your enterprise systems: Mobile Apps enables to connect with your
enterprise on-premises or cloud resources.
Build offline-ready apps with data sync: Enables to work offline and ensures to
sync data when connectivity is present.
API Apps
API apps makes it easier to host, develop, and consume APIs in the cloud and on-
premises. With these we get simple access control, hybrid connectivity, and
seamless integration with Logic Apps.
Easy consumption
Logic Apps
Logic Apps
Logic Apps enables a way to simplify and implement scalable integrations and
workflows in the cloud. It provides a visual designer to model and automate your
process as a series of steps known as a workflow.
Logic Apps
Key App Service Features
Saves time in designing complex processes using the design tools.
Optimizes workflows and patterns which would be easy in implementing the code.
Customizes your logic app with your own custom APIs, and codes.
Build off a API Management, Azure Functions, and Azure Service Bus with first-class
integration support.
Azure Functions
Azure functions enables to execute code on-demand without the provision or manage
infrastructure explicitly. As it is a serverless compute service users need not to
be worried about the servers, virtual machines and scaling.
Azure PowerShell
Rest APIs
Azure Portal
FTP or FTPS: Use your favorite FTP enabled tool to move your files to Azure such as
filezilla, which is just a file upload process where user is responsible for the
version control and file structure management.
Kudu: Use the deployment engine in App Service to push your code to Kudu directly
from any repository (Git/Mercurial or OneDrive/Dropbox).
Web Deploy: Deploy code to App Service directly from your favorite tools such as
Visual Studio.
Each options are having its own characteristics hence carefully understand the
requirements while selecting the deployment type.
http://$webappname.azurewebsites.net
$webappname is your web app name.
It generates different endpoints basing your type of deployment such as FTP, Kudu
etc.. , you can access them at resource page > properties.
Play
03:31
-03:56
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
kudu is a hidden or background service site included by azure web app. It is the
engine behind source control based deployments into Azure App Service.
Kudu is useful for viewing deployment logs, capturing memory dumps, looking at
configuration parameters and many more. You can access Kudu service in azure portal
by navigating to your web app resource dashboard > Advanced Tools > Click on go.
Through Kudu you can retrieve diagnostic dump, view running processes, add site
extensions, list service data endpoints (REST APIs).
Play
07:42
-11:22
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Continuous Deployment
Continuous Deployment
Continuous deployment works well for the projects where several contributions are
being integrated. Azure portal sets up an easy way for continuous deployment from
various sources such as BitBucket, Visual studio and GitHub.
You can enable and disable at any time it; navigate to your resource page and
choose Deployment center under Deployment section > choose source (Github,
VSTS,Onedrive etc..).
Deployment Slots
Deployment slots are actually live web apps with their own host names, hosted on
the same application server as your main app, which keeps the production slot.
In App service you can deploy your apps to separate deployment slots instead of
deploying in default production slot. This type of implementation includes several
advantages such as:
Allows validating web app changes in a staging deployment slot before swapping it
with the production slot.
Web app content and configuration elements can be swapped between two deployment
slots, including the production slot.
Cannot scale the intermediate slot, as the only slot that can be scaled is the
production slot.
The simplest way to deliver the requirement is to setup 2 deployment slots Staging
and Production ( you can create more) and push the final application changes to
staging for final testing.
If your Unit Tests gets succeeded, you can just swap your Staging slot to
Production and make it accessible to the client.
Navigate to your app deployment resource and choose the deployment slots option.
When the first time you add the slot you will get only two options such as clone
configuration from the default slot in production and not at all.
Note: You can deploy to the slot from different branch or repository.
Swap Deployments
Swap Deployments
Consider a situation where you left a bug unfixed in your final deliverable and did
not notice while running your unit tests, consequently your client sees the bug and
reports you immediately. If you're using Azure Deployment Slots, you can use the
previous deliverable by re-swap from Production to again Staging without stopping
your clients business for bug fix.
After the successful deployment of your app, navigate to the resource window in
portal.
Choose swap option and select the source and destination slots.
For the above use case; the source deployment slot will be staging and destination
deployment slot would be production.
Play
08:49
-14:13
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Following are the scaling options that helps increase your app performance :
Vertical Scaling: Scales up and down hardware.
Geo-Scaling
Play
02:59
-05:20
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Auto Scaling
Auto Scaling
Auto Scaling is an another way to increase your app performance, which scales your
apps basing on metrics.
The different metrics you can able scale are: CPUPercentage, MemoryPercentage,
DiskQueueLength etc..
Note : In the above picture the auto scaling is enabled based on CPU Percentage.
You can set up the scaling of instances and instances target based on a condition
on CPU Percentage.
Play
13:50
-17:37
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Geo- Scaling
Geo- Scaling
Geo-Scaling adds geographical regions to your applications through out the world
and enables vertical and horizontal scaling independently.
It gets closer to your customers who are using your applications in different
regions across the world.
Locating your app in different regions improves more availability and continued
service will be associated.
This capability enables hosting your linux web apps, windows web apps, mobile
apps,functions and docker containers and helps to achieve massive scaling upto 50
instances as default.
App service environments are suitable for high scale, high memory utilized, and
secured network access applications, where customers can have multiple ASEs in
multiple azure regions or within a single azure region.
Note: ASEs are deployed to a virtual network where it is isolated to run only a
single customers application.
HTTP, HTTPS termination and load balancing of app service within an ASE are looked
by front end, which will be automatically added when the app service plans in ASE
are scaled out.
Workers are roles which hosts customer apps. These are available in three sizes:
one vCPU/3.5 GB RAM, two vCPU/7 GB RAM, and four vCPU/14 GB
An ASE can hosts range from 100 instances in a single app service plan to 100
single instance app service plans.
Scaling ASE
This video explains how to configure the ASE scaling in azure portal.
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Your App Service apps are isolated from both the Internet and from the other
customer's Azure resources.
Communication of secrets between your App Service app and other Azure resources in
a resource group stays within Azure which are encrypted.
Communication between your external resources and App Service apps such as
PowerShell, CLI, REST APIs, and hybrid connections, are encrypted.
SQL Injection: Attack which inserts malicious code into strings that are further
passed to a SQL server instance for parsing execution.
Session Hijacking: May cause active hijacking (attacker directly gets involved with
the target) and passive hijacking (attacker just monitors the traffic).
Cross Site Scripting: Runs the malicious script on the user's computer by embedding
script tags in URLs.
Application Level Man In the Middle: Attacker reroutes the communication between
two users without the user's knowledge.
In order to access services provided by google, facebook, twitter etc, the users
are required to sign in to their end point to get authenticated. Similarly, app
services directs all unauthenticated users to the endpoints of your azure
applications for sign-in.
Authentication Providers
Authentication Providers
There are several authentication options available for enabling authentication of
you app service . You can authenticate with
Microsoft Account
Play
06:48
-11:41
Mute
Settings
Enter fullscreen
Play
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
Point to Site VPN and App service environment (explained in scaling app service
topic) are two such features that sets up your applications in isolation ensuring
high-level security.
Point to Site VPN connection offers you to create a connection from a virtual
network to an individual client computer. It is appropriate when you try to connect
to your VNet from remote locations like home, conference room etc..
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
In this module, you will get to know about different monitoring and troubleshoot
options provided by azure such as:
Resource health
Monitoring process explorer
Tracking application failure history
Diagnostics as a service
Monitoring HTTP traffic
Monitoring poor app performance
Monitoring CPU and Memory Usage.
Resource Health
Resource Health
Azure resource health service aims to reduce the customers time to spend in
troubleshooting, by enabling its capability of exposing the health of individual
resources.
You can access to resource health by navigating to your resource page > support +
troubleshooting > resource health.
Health Statuses
Health Statuses
Azure resource health service displays several health statuses for your resources
such as:
Available: Represents the service hasn't detected any events that affect the health
of the resource. In the picture, you could see the Availablestatus for your
service.
Unavailable: Represents the service has detected some event that is affecting the
on-going platform resource health. It changes to Available once the service runs as
expected.
Unknown: Indicates that resource health hasn't received any information about the
resource for more than 15 minutes.
Process Explorer also lets you kill a specific process that is causing the
performance issue for your application.
Availability
Requests/Failures
Deployments.
Diagnostics as a Service
Diagnostics as a Service is an advanced troubleshooting function that examines
variety of data points such as HTTP logs, Event logs, process memory dumps etc..
Select Troubleshoot tool under what actions you can take section.
Choose my application is running slowly and under that select data collection and
analyses tool
You will be directed to your application diagnoser page which contains diagnosers
for your instances.
If you have trouble playing this video, please click here for help.
No transcript is available for this video.
You need to specify the time in seconds that indicates the restart sleep timer. If
you are restarting multiple instances at the same time, the instances restart after
restart sleep time interval. It is not same as restarting your web apps.
To enable it: navigate to resource page > resource health > Troubleshoot tool > My
app is performing slowly > Advanced Application restart.
Hands-on scenario
The developers at your company are experiencing latency and timeouts with their web
application running on On-premises infrastructure. To overcome this, the company
wants to deploy their custom application in the cloud. As a solution architect, you
need to find a solution to this problem by automatically scaling the underlying
infrastructure to prevent future service interruptions. Use Azure App Services and
configure the required services with the following parameters in the Azure cloud.
i) App Services: Runtime Stack: .NET Core 3.1(LTS), OS: Windows, Region: East US,
Sku and Size: F1 Shared infrastructure, 1 GB memory.
Notes:
Use the credentials given in the hands-on to log in to the Azure Portal, create a
new resource group and use the same resource group for all resources. The
Username/Password/Services Name can be as per your choice, after completing the
hands-on, delete all the resources created.
Course Summary
Congratulations! You have come to the end of this course.
By now, you must have got a good understanding about deploying and managing Azure
App services.
Keep Learning!!!!!