Publish an Asp.Net Web Api Self-hosted console application as Azure Webjob - azure

I have an ASP.NET Web API Self-host console application and I want to publish it as a Azure Webjob service. Is it possible, is it advisable?.
I'm using Topshelf to install it as a windows service on my local server.
I haven't a web application only the console application.

In a Webjob, no. See Azure App Service sandbox limitations here - assuming you need to listen for inbound requests on a socket.
Installing stuff (think .msi or writing to registry) is also not supported.
Look at Cloud Services (Worker Role), Service Fabric or IaaS VMs.
They're all options.
EDIT (sometime in 2017):
Now there's even more option: Docker containers in Azure App Service Linux, Azure Container Service (DC/OS, Swarm or Kubernetes as orchestrator) or Azure Container Instance.

Related

Migration of On-Prem to Azure

I have a web application that is running on my localhost and i want to use azure app service or azure vm to launch it online. which is the best choice?
Solution to host webapplication
There are ways to deploy your application to Azure Cloud.
Method 1 : Azure App Service is fully managed platform for deploying application and scaling apps. it has built-in web hosting feature and supports multiple languages and frameworks.
Please follow the steps to deploy application to App Service.
1.Create sample web application using Visual Studio application.
Create a new project
Right click on created application and choose Publish
Note: Before publish application to Azure, login to visual studio with Azure Account.
Select target-Azure Cloud.
5.Select target platform windows or Linux.
Click on App Service (Windows) > Create new (window)" in App Service (Windows) >Create new.
Select your subscription, resource group & hosting plan.
Check the Application deployment status in visual studio account.
9.Test the application with Azure App service URL once deploy the application to Azure app service.
Go to Azure Portal > Azure App Service > overview > Url.
Application working with App service Url
Method 2: Azure VM
To deploy an application in an Azure VM with IIS, you can follow below steps:
Create an Azure VM with required configuration such as the operating system and size.
Azure Portal > Create > Select Server OS.
2.Use RDP to connect to the Azure VM.
You can use FTP to upload your code to the Azure VM.
Now, open the IIS Manager and create a new website in that IIS.
After that, you can configure the website to point to the location of your application code on the VM.
Finally, test your application.

Application logging in Azure Kubernetes

In our scenario, we are trying to Dockerize the Asp.net framework 4.6 based Web API that logs on the server using Nlog.
Currently the application is hosted on IIS web server.
The question is how / where to store the logs when the application is rehosted on Azure kubernetes
should I use something like application insights
You can use the Azure Monitor including Application Insights to have your application logs.
Here is the official documentation on Azure Monitor for containers
Azure Monitor for Containers supports consuming logs from not just
Kubernetes but also from other orchestration engines such as DC/OS,
Docker Swarm, and Red Hat OpenShift.
Azure Monitor for Containers is perfect for Infrastructure monitoring and Application Insights which is now part of Monitor as well would be excellent for APM.
Application Insights for .NET
https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net

What are the advantages of using Azure App Service to deploy a docker application instead of Azure Container Instance?

What are the advantages of using Azure App Service to deploy a docker application instead of Azure Container Instance?
I found out that Azure Container instances don't have any networking-related capabilities in terms of restricting app access. Are there any more advantages of using Azure App Service to deploy a container?
There are many advantages of using Azure app service over azure container instance
Azure app service is PAAS(platform as a service) on the other side azure container the instance is an IAAS(infrastructure as a service).
In azure app service directly integration of custom domain is available
Integration with the application gateway to handle the traffic load
It offers auto-scaling and high availability.
Automated deployments from GitHub, Azure DevOps, or any Git repo to support a continuous deployment model
Host background jobs(Web Jobs)

Azure WebJob In its own AppService or in an AppService with Api

I have an AppService which hosts an Api. I also have two WebJobs. My question is should I host the WebJobs in the same AppService as the Api or would it be better to host each WebJob in their own AppService.
My question is should I host the WebJobs in the same AppService as the Api or would it be better to host each WebJob in their own AppService.
When you deploy WebJobs, you need to host it in the Azure App Service as a background task. WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app.
Also, Azure App Service payment is determined by the App Service plan that you run your apps on, while WebJobs is no need for additional cost.
For more details, you could refer to this article.
WebJobs are coupled with App services or Web app in the app service plan and they run as a background task of app service. We can't have an webjob independently running without the web app on the App service plan . We can control the scaling of web job in the case of multiple instance but web job has to be run as background task of app service.

Is it possible to use MQ Client with a web app installed in an Azure App Service?

We have a web app running on Windows Server but we need to migrate it to an Azure App Service.
Our web app uses MQ Client service to connect with certain transaction services, but it is not possible to install other services on the Azure App Service except for the web app.
Is there a way to use MQ Client in Azure?
Thank you very much for your time!
Is there a way to use MQ Client in Azure?
As Azure WebApp is a sandbox. Install MQ client is not supported on the Azure WebApp service.
If Azure VM is acceptable, I recommand that you could use Azure VM to instead of Azure WebApp service in your case.

Resources