Continuous Integration and Automatic Deployment in Azure - azure

I have more than one web api projects in a single solution file, but when I configure it for continuous integration and automatic deployment it has to be against each project to different web site.
I have created a publish file and provided those details in the MS Builds Build definition file, still it's not taking the specific project to the correct web site.

In order to specify a particular folder from a github etc deployment you can set an environment variable (App Setting) of Project. so if you have a WebAPI1 and WebAPI2 folder, you can create an APP setting
Project = WebAPI1
This will make kudu deploy the correct project.
See the kudu documentation for more information - Customizing deployments

Related

Azure Dev Ops - Site Under Construction Page during Web App Deployment

I have a .NET MVC Website that gets automatically deployed based on a GIT repository checkin. (Azure Dev ops Pipeline)
When the website is being deployed, if I got to the website URL. I get a blank page with a "Site Under Construction title" page. After the deployment is complete, this page goes away and I see my site.
What I want to know is how can I customise this Under construction page.
If I add a app_offline.htm file in the root of my visual studio project. I seem to see this file when deploy is happening, but when its finished, the file is still there, and I can't see the site.
Do I need to make a change to my build pipeline somehow? or make a change to my web-app configration?
What do I need to do to have this file displayed only during the deployment.
UPDATE
1. Invoking MsDeploy.exe manually in a Azure Devops
2. App_Offline in MSBuild Remote Web Deploy
PRIVIOUS
You can configure it in .pubxml file. That is actually used to take your app offline while deploying. After finishing deployment, MSDeploy tool should delete APP_OFFLINE.html automatically.
<PropertyGroup>
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
...
</PropertyGroup>
Related posts:
1. 👍 Automatize App Offline in Azure App Service and Visual Studio
😊 tlejmi's answer is very detailed.
2. How to take web app offline while publishing?
3. Getting site under construction message after azure webapp deployment

deploy my REST Api service project to Azure

We are having a application developed in MVC 4.
Here are our scenarios:
1) we are following plugin architecture, so we are having other projects which can plugin into the main web application.Right now we are using installshield to deploy our dlls from other projects into the main web application.
How can we do when publishing the main web application as Azure App service.
Is there any feature in Azure so that we can remove the install Sheild and use some properties in Azure to move the dlls from other projects to the main web application folder.
2)We have logging feature enabled so the logs are maintained in local File store under AppData folder and upload the same log file to Db and delete the local log file? How can we achieve the same if moved to Azure App service?
3)Our MVC application calls the another Service application using rest Api calls.Currently we are mentioning the service details in config file under MVC application.
if we are moving to Azure how about the configuration properties mentioned in my MVC Application to call the Service project.
To start with, I would like to deploy my REST Api service project to Azure.My project is a class library and please help how can move my service project to Azure App service and get the server name.
1) Plugin Architecture
We had a similar requirement but we were not using InstallShield for copying plugin DLLs to our web app, instead what we did was created the following folder structure:
-- MVC Application
---- bin
---- App_Plugins
------- Plugin1
------------ Release DLLs
------- Plugin2
------------ Release DLLs
-- Plugins (actual source code)
---- Plugin1
---- Plugin2
and set the output directory of our Plugin 1 and Plugin 2 to point to the ..\App_Plugins\Plugin1\
and we simply published this app directly to Azure Website and that worked like a charm.
Then we found out about CI/CD process on VSTS and that changed everything, it gave us a more elegant way of managing all of this. Can provide more details if you need that.
2 Logging Feature
If all your logging code & logic for moving all this to DB is within the application, then you should not have to worry about anything and it should work without any challenges as long as you setup your DB connections correctly.
3 REST API settings in config file
The web.config file of your MVC application is published along with the rest of your application. so, as long as your settings are mentioned in the web.config and they work locally, it should all work fine in Azure as well.
Start here - https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-deploy
Ensure you already have a Azure account, and of course visual studio has the Azure SDK installed (it may be required).

How do I package and deploy a single Azure web app containing several virtual apps from Visual Studio Team Services (previously VS Online)?

I have a Visual Studio solution that contains two web applications (our main site and our WebAPI project). I am able to host them locally in IIS Express as a single site using the applicationhost.config, but I want to package them (in our Build) and then deploy them (in our Release) as a single site from Visual Studio Online (which hosts our code) to Azure.
My Visual Studio Team Services Build configuration packages each of the Visual Studio projects into its own Web Deploy package. The Web Deploy packaging is done during my Build phase, and the deployment to Azure is done during the Release phase - this is done so I am not recompiling source every time I do a deployment, which is unnecessary and would slow down the process.
The first web application identifies "HelloAzure" as the DeployIisAppPath in its pubxml file. The second one (the WebAPI project) identifies "HelloAzure/api" as the DeployIisAppPath in its pubxml file.
Currently, I am using two of the "Azure Web Site Deployment" steps (the one that uses Service Endpoints to perform a deployment). I name the same web app name for both steps. When the second project is deployed, it seems to overwrite the first one rather than adding a second application to the existing site. I believe I must not be following the intended practice for deploying several Web Deploy packaged applications into one web site from Visual Studio Team Services to Azure, but I can't find the recommended practice documented anywhere.
I do need to have both applications hosted within a single site. Deploying them as separate sites is not an option.
It appears that Kudu has some options that might support this scenario, but I am not deploying from source code, I am deploying from Web Deploy packages created by our Team Services build.
The MSDeployAllTheThings VSTS extension supports deployment to a virtual app in an Azure site.
https://marketplace.visualstudio.com/items?itemName=rschiefer.MSDeployAllTheThings
Microsoft also seems to have added official support for deploying to virtual apps from VSTS to Azure to the AzureRM VSTS extensions according to this thread: https://github.com/Microsoft/vsts-tasks/issues/624

How can I use the TFS Online <--> Azure Website integration when there are two web apps in the solution

I am trying to get continuous integration configured using Azure. The process I have followed is exactly as detailed by Continuous delivery to Windows Azure using Visual Studio Online
This process works perfectly! I check-in, it builds, and deploys to the Azure website. However, as soon as I add a second web application to the solution, after the CI build kicks off and then completes, the only thing that gets published to the website is the bin directory of the second web application! (Updates to the first project are successful, though)
Given the scenario, I don't understand why the dll's of the second application are being published to the bin directory when the rest of the application(i.e. content files) are not. There is no reference from app1 to app2 so the dll's shouldn't be brought in by reference.
How can I configure this so that it will also publish the second web application?
You can tell Windows Azure Web Sites which project within a repository to deploy using a deployment file.
Add a file called .deployment to the root directory of your repository, with this content:
[config]
project = src/MyApp.Web
You can specify the folder containing the web application, or the actual .csproj or .vbproj file for the application.
If you have two sites in a single solution/repository and you want to publish them both, you will need to use two separate Web Sites, and use App Settings in the portal to specify the project instead. Create the sites, and for each, add a setting called Project in the Configure page, with the path to the directory or project as before.
More info: https://github.com/projectkudu/kudu/wiki/Customizing-deployments (Kudu is the system that actually handles deployments on Azure Web Sites)

Azure Continuous Deployment from Visual Studio Team Services with multiple projects

While using Github (or anything other than Visual Studio Team Services) I can use the following page to customize deployment: https://github.com/projectkudu/kudu/wiki/Customizing-deployments
I'd like to customize my deployment as I currently have both a web app and a web api project. I want the web app to be deployed, as default it deploys the web api project. Using project Kudu the settings (.deployment file or even better, the app settings on Azure itself) works great, but not when you deploy from Visual Studio Team Services.
I've spoken with David Ebbo from Project Kudu, and he explained that VS Team Services doesn't use Kudu at all, but probably MS Build. So my question is, how to specifically deploy the web app.
I managed to change the Build Definition and specify the web app .csproj as the Projects To Build. This works. However, I also want to deploy my web api.
Deploying the web api project with Kudu is easy as I can create a separate website, connect to the some repository (and solution) and specify the Project App setting so that it deploys the correct .csproj. How should we do this for MS Build? When I change the Build Definition, it will always deploy the project specified in there.
Just saw another answer on Stackoverflow that looks to solve this problem: Publish Multiple Projects to Different Locations on Azure Website

Resources