I've got a website (basic html) and I want to deploy it using Azure Resource manager. It doesn't have a visual studio sln file and I don't want to create one.
I've found this tutorial for an angular website that does something along the lines that I am trying to do. http://www.azurefromthetrenches.com/how-to-publish-an-angularjs-website-with-azure-resource-manager-templates/
The problem I want to solve is that I have the Microsoft Azure SDK for .NET (VS 2015) 2.8.2 which allows me to add resources to my resource group project. The tutorial writes everything itself, rather than use visual studio to create the resources.
Does any one know how to do this?
I've got my application to build the website using a website.publishproj (found at the tutorial) so I have my zip file, what I am now lacking, is how to upload the zip file to azure using the already existing powershell that comes with the 2.8.2 SDK.
So far i've added the below code under the Import-Module statement:
C:\"Program Files (x86)"\MSBuild\14.0\bin\msbuild.exe 'C:\Source\website.publishproj' /T:Package /P:PackageLocation=".\dist" /P:_PackageTempDir="packagetmp"
$websitePackage = "C:\Source\dist\website.zip"
If you're ultimate goal here is the ability to simply deploy and changes to the Azure Web App, one solution is to setup automated deployment from a local Git repository into an Azure Web App. Firstly, you'd create the RG in the Azure portal then configure Continuous Deployment. You can then use something like Visual Studio Code to trigger the deployment from any code changes.
Good run through here: https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-app-using-vscode/
Assuming your website is under source control eg. GitHub - you can use an ARM template to point at the GitHub repo, so when it creates a new website it will automatically pull the content into your newly created site. Great walkthrough here: https://azure.microsoft.com/en-us/documentation/articles/app-service-web-arm-from-github-provision/ or just the code can be found here: https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy.
You can use Azure CLI from non-Microsoft world to deploy eg.
azure group deployment create...
If this has helped, please mark as answered.
Related
I want to host a .Net application on azure VM using IIS. I know the basics of Windows azure like creating a VM & other things.
I want to automate this whole process of creating a VM & hosting an application on IIS on that VM using VSTS (Visual Studio Team System). I know its possible to do it using VSTS (DevOps) also I know basics of VSTS like creating a build definition on it, but I am facing problems in automating my current scenario using DevOps on azure.
All I want to know is how to initiate things like creating VM & installing IIS & hosting application on it automatically using VSTS build steps.
There are a few ways you could go about creating a VM with IIS+App in Azure. To create resources in Azure in an automated workflow, I usually think of using Azure Resource Manager Templates for the configuration. To do that in VSTS, you can take a look at this article.
https://learn.microsoft.com/en-us/azure/vs-azure-tools-resource-groups-ci-in-vsts
There are two ways to use AzureRM templates in VSTS build/release tasks, both are doc'd there. The doc shows how to use an Azure Resource Group project in VSTS, but you could also just pull raw files from github (no project needed).
For a template that creates a VM, installs IIS and installs a web deploy package take a look at this sample:
https://github.com/bmoore-msft/AzureRM-Samples/tree/master/VMDSCWebDeploy
This uses DSC to install IIS, install and start web deploy and deploy a package/app. That will do everything in the DSC script, but you could separate deployment if you wanted to.
That help?
Currently our developers deploy our Mobile Service (.Net backend) from Visual Studio 2013 using the Publish Wizard. Occasionally this means that a developer deploys something that either wasn't committed at all or wan't pushed to the origin source control repository. We are already using Visual Studio Online Build servers to do Continuous Integration from the origin server so it would make sense to use the files it builds to do the deployment to remove this risk.
Currently the only way I can see of doing this is to do a "download drop as zip" from the Visual Studio Online build portal and then do a FTP style deployment. This means I lose the web deploy features of only uploading the changes.
I noticed there is a different build template called GitContinousDeploymentTemplate which allows you to specify a Windows Azure Deployment Environment, but this seems to only be applicable for traditional Cloud Services or Web sites.
If anyone knows a good way of doing this any help would be much appreciated.
Cheers
F
From here
Found a solution.
In the build definition's MSBuild arguments, add the following:
/p:DeployOnBuild=true /p:PublishProfile="{publish name}"
/p:AllowUntrustedCertificate=true /p:VisualStudioVersion=12.0
/p:UserName={username} /p:Password={pw}
You can obtain the value from the publishing profile that can be downloaded from the
Mobile Service dashboard on Azure managament portal.
Under Deployment, add the path to pubxml file in source control under "Path to Deployment Settings". Note: add an extra backslash at
the end of the path to escape the last "\".
One problem with this solution is that deployment happens regardless
of your tests outcome, but that could possibly be remedied by
modifying the build template. We used the
GitContinuousDeploymentTemplate template in our case.
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
Visual Studio 2013 has a publish wizard for Cloud Service projects that packages and deploys a cloud service based on settings persisted in a .azurePubxml file.
I'm setting up automation of this process on a CI server, and want to leverage this functionality within MSBuild, but I'm unsure if it's even possible.
I have found a lot of articles that talk about shelling out to a PowerShell script and using a custom MSBuild target file to do the deploy, but that seems like a duplication of information that I'd rather not delve into.
Given that I have the Azure subscription credentials installed on the build machine, VS 2013, and Azure SDK 2.2, can I invoke the same mechanism that VS 2013 uses in the publish wizard to package and deploy my cloud service?
Currently, using MSBuild with the publish target, I can package the service into a .cspkg file, but I cannot figure out how to trigger to package/deploy based on a profile (.azurePubxml file) that defines the VS build config, and all of the Azure settings.
So, as you pointed out, the default targets will only give you a package. From there, Visual Studio is publishing things using their own infrastructure. Publishing the build from a CI server is considered something external to actual build process and rather something that is part of the deployment process.
If your CI technology has support for PowerShell then it's as easy as automating the Windows Azure PowerShell cmdlets to do your bidding. There's a nicely detailed article on how you might do this with Team Builds in TFS here on MSDN.
I'm using the AzureContinuousDeployment.11.xaml Visual Studio 2013 Template for CI builds from visualstudio.com to an Azure website and it's working great.
However, I need to keep additional files on the server (the app creates files). If I was using the "Web deploy" method, I'd simply disable the "Remove additional files at destination" property, but I don't see an option for that using the Azure deployment template.
I should be able to add /p:SkipExtraFilesOnServer=True to the MSBuild arguments in the build definition, but it isn't working. Files are still being deleted from the web server when I deploy.
I've also tried creating a publish profile and adding it to the template. It hasn't worked either.
I don't think there is a way to keep app-created files while using visual studio deployment. I suggest you to create an Azure Storage account and store those files in the storage (blob would be good enough). It seams that you are using ASP.net. See more detail at Microsoft Azure Storage Client Library for .NET.