Azure Web Apps
Azure App Service is used for creating HTTP-based service and could be used for hosting web applications, REST APIs, and mobile back ends.It comes in the is a platform-as-a-service or PaaS deployment model.
It supports the following languages:
- ASP.NET
- ASP.NET Core
- Java
- Ruby
- Node.js
- PHP
- Python
There are numerous options for hosting web applications in Azure but Web Apps is best option in most cases.You can create web application in azure using the Web Apps in App Service by using either of the following:
- Portal
- Powershell
- CLI
Portal
If you want to create Web App using the portal then you can use the following steps:
1.Select the Web category in the portal
2.Select the Web App
3.Provide required details such as:
- WebApp name this should be gloablly unique as it uses the domain .azurewebsites.net
- Publish method docker or code
- Stack such as .NET or Java
- OS Windows or Linux
- Region Where you want to host your app service
- App Service Plan Dev/Production or Isolated
CLI
1.Before creating the App service you need to create app service plan.You can create it using the az appservice plan create command
az appservice plan create --name NameOfAppServicePlan --resource-group NameOfResourceGroup --sku FREE
2.Create web app in the newly created App Service plan.
az webapp create --resource-group NameOfResourceGroup --plan NameOfAppServicePlan --name NameOfApp
3.If you want to connect to database then you need to configure it in the Startup classes ConfigureServices method:
services.AddDbContext<DatabaseContext>(options =>options.UseSql("Data Source=localdatabase.db"));