If an App Service Plan containing an App Service is horizontally scaled in Azure (using Monitor - Auto scale functionality) how does that affect future deployments via Octopus if the "Deploy to Azure" step is used. Would any deployments automatically get deployed to all scaled instances in Azure without us having to do any more configuration in Octopus?
Octopus will not automatically deploy to scaled instances without configuration. You will need to configure Octopus to automatically deploy to targets using project triggers. You can find documentation on using project triggers here: https://octopus.com/docs/deployment-process/project-triggers/automatic-deployment-triggers and documentation specifically concerning auto-scaling infrastructure here: https://octopus.com/docs/deployment-patterns/elastic-and-transient-environments/keeping-deployment-targets-up-to-date
Related
I have an application that consists of an Angular 2+ frontend deployed on a separate App Service to my .NET Core backend (per environment).
I'm investigating zero-downtime deployments with Azure App Service staging slots, however I don't understand how I'd have this setup in my case, because:
My FE and BE are deployed via DevOps CI/CD automation, and are built + deployed in an Azure Pipeline - meaning my Angular app has its API URL set in whichever environment.ts file is chosen (depending on which environment is being deployed to).
What is the correct way to achieve having a zero-downtime deployment setup in Azure in this case?
You are correct in that you won't be able to use deployment slots with your Angular app, since the configuration is bundled with the code. You can use Azure Static Web App with CDN to achieve this.
For your backend, deployment slots with auto swap enabled should get you what you're looking for.
https://learn.microsoft.com/en-us/azure/storage/blobs/static-website-content-delivery-network
https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots
At the company that i work, they deploy applications to azure using Azure App Services.
This involves creating the App service manually, and setting up the pipelines manually.
My question is if there is another way to host and run applications in Azure without using App Services?
The reason for this is that i don't like the manually work when setting up a app service and all it's configuration.
Any suggestions?
What you actually need is setting up CI/CD pipelines for your application to create resource(AppService in this case) and deploy on them.
If you are new to Azure Devops, i would highly recommend to explore Devops starter service to deploy your application with few clicks and see how it creates resources and pipelines automatically
On the 2nd question, there are many compute options available on Azure such as Virtual Machines , AKS (Containers Orchestration) , Container instances etc.
You can explore those compute options using the decision tree here
I'm using the ASP.NET Core & Angular startup template from ASP.NET Boilerplate with Multi-Tenancy disabled: 1 database with a single tenant(Default).
I'm also using TeamCity to build/test/publish the projects available in the startup template so I end up with 3 NuGet packages that are getting pushed to Octopus Deploy:
API (Host project, ASP.NET Core Web Application)
Migrator (Console application, capable of migrating the database(s))
UI (Angular App)
I want to deploy this setup to Azure with Octopus Deploy(self hosted, v2018.9.0) in the following way using 2 App Services(Host & UI) and 1 Azure SQL database(Host):
Take the UI and API applications offline, displaying a friendly maintenance message while updating the projects.
Migrate the database using the Migrator package
Deploy the API application package
Deploy the UI application package
Put the API application online, maybe some more tests to check that it's working correctly
Put the UI application online.
If all this was on-prem, I would have no questions. It's the Azure part that I can't figure out because I don't know how to do these things on Azure via Octopus Deploy:
Put an Azure App Service offline/online (using an app_offline.htm file)
Deploy the Migrator package to the API Azure App Service in a special folder(so that I don't overwrite the API deployment) and run the migrator: dotnet [migrator.dll] -q
I tried using the Octopus Deploy "Deploy an Azure Web App" but this step won't let me also deploy the migrator package and run it before the API package is deployed. Or does it? I don't know how.
I tried using the "Run an Azure PowerShell script" but this executes on the Octopus Deploy server and not on the Azure App Service environment right?
Maybe there are other, even better, approaches deploying this setup to Azure?
You can use App service slots to swap in/out version of your logical applications. When you swap there's a warming up that occurs and no loss of traffic.
So basically deploy to backup slot, then swap production with backup slot.
For the db I don't think your strategy is valid. There are some assumptions you are making that will not make your life easy. I would look at handling the db deployment separately with no breaking changes but that's my opinion.
I'm not familiar with Octopus or TeamCity so I won't go into details about those.
I am trying to get a deployment working from Azure Pipelines and cannot figure out how to deploy a single "Cloud Service classic hosted" web app. I am not finding much documentation about how to configure my template beyond the basic canned templates Azure offers. Does anyone know of better documentation or an example template to deploy from a build? Previously I was deploying directly from Visual Studio running locally, so this jump to using Pipelines is a big one for me.
I have setup continuous deployment of a standard web api project to an API App on Azure. The new version is deployed to the staging slot and then swapped with production at the end of the release task. I can see that (by going to App Service Editor in azure portal) the dll file versions reflect the latest changes. But when I access the APIs (from a webapp or postman) on this Azure app the result does not reflect the published changes. The only way I can force the new changes is either restarting the API app or stopping and starting the app service.
Am I missing anything in using continuous integration with API app on Azure?
I have solved this by adding a new task available in VSO release which restarts the staging slot before swapping with production. This makes sure that the new changes are part of the IIS process.