How to create startup tasks (or install dependencies) in Azure Web App? - azure

There is a Cloud Service in Azure classic deployment model. In the Cloud Service you can add web role and set up a startup tasks. If your application has any dependencies that require installation on the destination VM or controll over IIS-related settings, you can use a startup tasks to provide an unattended deployment for this configuration. For example, if you need installed software on the backend side, you can run MSI in startup task to install it.
Unfortunately, I can't find this functionality in new Azure Resource Manager model. My Web App need some installed software on backend side, but I can't figure out how to install it. Could you help me with this?

You can't. Web App (or App Service) doesn't give you control over the underlying OS. You should consider containerizing your app and run it through using e. g. ACI or AKS.

A Cloud Service was nothing more than a VM with extended support in Visual Studio. Cloud Services are deprecated but you can still create a VM in Azure and install your dependencies.

Related

Azure App service with or without docker

I have some experience in using azure app services without docker. I did worked on k8 with docker. Now I am seeing an option to deploy containers in azure app services. As per my understanding app services internally use container and orchestration engine. Now someone can explain why this new docker option in azure app services? How it is going to help? When to use this option? Why I should bundle it as docker(extra effort eventhough it trivial)?
Azure App Service on Linux (Web App with built-in images)
The built-in image option running on Linux is an extension of a current Azure App Service offering, catering to developers who want to use FTP or GIT, deploy .NET Core, Node, PHP or Ruby applications to Azure App Service running on Linux
All of the built-in Docker images are open sourced on GitHub and available on DockerHub
Now someone can explain why this new docker option in the azure app
services?
Web App for Containers is catered more towards developers who want to have more control over, not just the code, but also the different packages, runtime framework, tooling etc. that are installed on their containers.
Customers of this offering prefer to package their code and dependencies into containers using various CI/CD systems like Jenkins, Maven, Travis CI or VSTS, alongside setting up continuous deployment webhooks with App Service.
This way you can easily deploy and run containerized applications that scale with your business.
How it is going to help?
This will make sure that the environment that you use locally, is
exactly the same as the one in the cloud.
Just pull container images from Docker Hub or a private Azure
Container Registry and Web App for Containers will deploy the containerized app with your preferred dependencies to production in seconds.
Automate and simplify your container image deployments through
continuous integration/continuous deployment (CI/CD) capabilities
with Docker Hub, Azure Container Registry, and Visual Studio Team
Services
Automatically scale vertically and horizontally based on application
needs. Granular scaling rules are available to handle peaks in
workload automatically while minimizing costs during off-peak times
When to use this option?
If you are so passionate/familiar with Docker/container then you can
use the Azure App service with the container.
If you are planning to host all your container in ACS(Azure Container
Service)/GitHub Repository then this service might be useful
You can refer to this blog for more details

Can I publish a ASP.NET Core app into an Azure AppService on a Linux Service Plan from Visual Studio?

I just need to deploy a aspnet core app into a Linux Service Plan.
I tried pre-creating the Linux service plan (into it's own Resource Group) from portal, and then starting the publish profile creating process in VS, but it does not show the linux Resource Group or Service Plan.
I can only find references to doing this from a Linux machine using Git-integration.
Thanks in advance,
Jose Parra
Unfortunately, for now we cannot deploy web app to Azure linux service plan through VS. It's by design that we can only see windows service plan in VS publish process.
However there are alternatives for us to choose.
FTP-- Upload pre-compiled files(under ~/bin/Debug(Release) folder) to website. Here's the reference.
Local Git--You may have read this tutorial. Note that Git bash can also be used in Windows.
GitHub--Follow this reference to connect VS with your GitHub, then config Deployment option in portal. After that your code will be deployed automatically once pushed to GitHub.
There are some other deployment ways like CI/CD aka Continuous Delivery in portal and another source control tool BitBucket. I recommend you to use GitHub as it's simple to operate in VS after configuration.

How to persist .exe installations on Azure Cloud Service

I am have created an Azure Cloud Service to analyze text in images. It uses this Python library which depends on the installation of Tesseract-OCR here. Specifically, I am using tesseract-ocr-setup-3.02.02.exe (one of the old versions because it has a Windows installer), which can be found here.
My problem is: this installer doesn't have a silent/automatic installation option, but I need it to automatically install itself when the Azure Cloud Service is being deployed. I can't be manually installing it every time I upload the cloud service, and especially after Azure restarts the Cloud Service VM for maintenance. Are there other options for getting Tesseract-OCR installed on the Azure Cloud Service VM so that the installation persists if Azure restarts the Cloud Service?
Your best bet would be to setup a VM, Install the software that you need, and deploy your app to this machine via ftp or something..
You can't customize the host of a "managed cloud service"

Deploy Worker Role To Azure VM

I have a Worker Role that need complex environment settings (install a couple of softwares, setup some directories and etc) so I want to deploy it to VM ( instead of Cloud Service that specialize in more simple environment without pre configure settings).
The problem that I can only publish to Cloud Service (from VS 2013), am I missing something ?
I tried to find some article and relevant materiel about deploy a Worker Role to a VM and the only things I found is related to the Cloud Service.
How can I do it ?
(or provide me a general guidelines)
Simply put, you can't deploy a Worker Role as is into an Azure Virtual Machine (IaaS) without doing code changes.
Things you could do:
Isolate your business logic into a separate DLL and then create a separate Windows Service project which consumes this DLL. Then you could deploy that Windows Service into a VM. Do note that your business logic DLL should not have references to any libraries which will only run in Cloud Services kind of environment (e.g. Diagnostics, ServiceRuntime etc.)
Do take a look at Startup Tasks for Cloud Services. They do provide a mechanism to perform additional tasks like installing software when your Cloud Service is deployed.

Is Azure Worker Role for an on-premise solution available through Windows Azure Pack or App Fabric

I am writing an application that will be deployed both to the cloud and to on-premise data-centres (for those clients who, essentially, don't yet trust the cloud with their data.
If i choose to go MS Azure I can use the new cloud project types with their Web and Worker roles. But how can I get the worker roles running for the on-premise variant?
Do I have to write my own host (say as a windows service)? This is not ideal as it requires additional code and deployment.
Is there an Azure compatible approach, say in the Windows Azure Pack or the App Fabric stuff (is App Fabric still current?) that doesn't require the full setup of the private cloud ?
This doesn't exist in Azure Pack.
There is no need to try and have a Worker Role on premise. All you need to do is to have a Virtual Machine that you install a Windows Service on.
It's easy to create a Windows Service using Topshelf.
Deployment of a Windows Service with Topshelf is actually much easier than deployments for Worker Roles because you just run the .exe you create with the install and then with the start arguments.
Because of this you actually need less code than for a Worker Role since you don't need a second wrapper project.
While I haven't used Windows Azure Pack before it does seem capable of providing this functionality in house, however the requirements and setup procedures are intense and it is certainly geared towards enterprise.
A better option is for you to create a console app that triggers the OnStart() and Run() functions for your WorkerRole based on your OS Task Scheduler.
Not too much work in my opinion and you get to keep your WorkerRoles as is but just add the console app for any on premise solutions.

Resources