How to deploy Azure Website with Virtual Application using VSO Continuous Deployment - azure

I have a Microsoft Azure Website and a virtual application running under it that I have configured. I am able to deploy both the main web application and the virtual application successfully by right clicking on each project and selecting publish. The main web application deploys to the site root, and my virtual application deploys to its sub directory (in this case it's /Api).
We keep our code under source control in Visual Studio Online which you can connect to an Azure website for continuous deployment. However, when I run the build for the virtual application (Api) it deploys it to the root of the site and not to /Api.
I have a number of other cloud services and websites utilizing CD already. It's the virtual application part that is giving me trouble.

The out of the box deployment build only deploys a single application. In this case your site.
To deploy multiple applications you need to use the DefaultTemplate.12.xaml and create a PowerShell to do your deployment in the post-test script step.
This problem will be fixed by a new build system being developed by MSFT...

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.

How do you deploy an IIS Web App as a folder instead of a virtual application in Azure Devops pipeline?

We have a release pipeline that publishes Virtual Applications from zip-files fine.
However we have some artifacts that we would like to be just a folder and not an application.
Is it possible to define that it should be deployed as a folder somewhere?
We are using the IIS Web App deploy task.

Add website to Azure Cloud Service

We are currently in the process of building a website on azure. At this moment I have a cloud service that is hosting my web api. Deploying to azure works like a charm.
Besides this project we have a pure HTML AngularJS project. I can publish this website as a WebApp. Though, is it possible to deploy it together with the web api?
You can deploy the second one as a Virtual Application/ Directory (Remember to check the Application check box):
You can use this link on how to publish to Root App as well as Virtual directory in your Azure subscription:
http://blogs.msdn.com/b/tomholl/archive/2014/09/22/deploying-multiple-virtual-directories-to-a-single-azure-website.aspx

Windows azure web role on local IIS

I am developing windows azure web role. Can I host the azure web role on my local IIS.
If yes..what are the steps I need to follow ?
Local Machine is currently running on windows server 2008 R2
There are two ways to achieve that, with varying levels of fidelity to the target environment.
The simplest is just to run your website project locally. You can attach it as a virtual directory on IIS and run it from the browser or debug it from Visual Studio. This will run as a regular IIS web application, but it won't be running as a web role.
The second is to package your application as a cloud service and run it under the Windows Azure Compute Emulator installed on your development machine. There are several tutorials on how to do that, including:
Developing and Deploying Windows Azure Cloud Services Using Visual Studio - see "Debugging a Windows Azure Application Locally".
Run a Windows Azure Application in the Compute Emulator
Windows Azure Basics–Compute Emulator
Building the web role for the Windows Azure Email Service application - 3 of 5
How-to deploy application to Windows Azure Compute Emulator with CSRUN
The Compute Emulator simulates several features of Windows Azure Cloud Services, but yout have to be aware of Differences Between the Compute Emulator and Windows Azure. Your application can tweak its behavior according to the environment by reading the RoleEnvironment.IsAvailable and RoleEnvironment.IsEmulated properties.
The Compute Emulator uses IIS Express locally for your dev/test work. IIS Express should be already set up for you when you installed the SDK+Tools. (Older versions of the SDK relied on full IIS 7 - more info here).
If you're talking about developing for running in production locally: It doesn't exactly work this way. A web role translates to a Windows Server virtual machine with some startup scaffolding code to allow you to install things in your VM, tweak the registry, etc. Since web role instances are stateless, every time a new instance is launched, the startup script is executed (same if an instance crashes due to hardware failure and is brought up again on another machine).
If you want to run the web app itself locally, then you'd need to take specific actions, based on whether your code is executing in Windows Azure or on a local machine (and then package it a bit differently - you wouldn't include the web role project). You can check RoleEnvironment.IsAvailable + RoleEnvironment.IsEmulated to help you out.

How do I use web deploy to deploy sub site in Windows Azure

I have a web role with multiple sites accessible using different port numbers.
e.g. (main site) http://site.cloudapp.net , (sub sites ) http://site.cloudapp.net:8080, http://site.cloudapp.net:8081
I can use web deploy to deploy the main site . How can I use web deploy to deploy the sub sites?
You can deploy to a sub-application by prefixing it with the parent site name. For example mysite/myapplication. ScottGu's blog has more details if you need them.
However, I'd be more concerned since you said you are doing this with an Azure web role which are deployed on virtual machines with ephemeral disks (non-persistent if the hardware fails or needs to be redeployed). If Azure re-deploys your web role to another VM your "web deployed" changes will be lost and the contents of your cspkg will be redeployed. If you really want to use web deploy your should consider using Azure Web Sites or Azure Virtual Machines, otherwise to ensure your changes are not lost you'll need to republish the full cspkg file and allow Azure to deploy the changes to all your instances.

Resources