Pre-compile MVC web project with Razor views on Azure - asp.net-mvc

How to precompile MVC web project (with all Razor views in it) and deploy it using the standard Visual Studio Azure Publishing tool?
There is no option for me now to use any other Azure deploying tools which could allow to enable this option like it's already exists in local "File System" publishing.
Already read many articles but there doesn't seem an easy way to do it!
Any help?

Related

ASP.NET MVC Deployment to azure

So I'm trying to deploy a test site to Azure.
The site has a database which was built in SQL server management studios, then I used ADO.NET Entity Data model to import the database into visual studios. Then I just used scaffolding to create CRUD operations.
How do I deploy this web app to Azure?
I used a database first so I'm not sure if that's a problem
I've tried following some tutorials but they seem to have different UI
eg. https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/database-first-development/publish-to-azure
First you want to go into Tools in your nav menu and check for 'Get Tools And Features'. Make sure you have Azure tools installed, and from there you'll be able to access the Azure menu to publish your web app directly from Visual Studio. You can also do this in VS Code, however you'll need the official Azure extension from Microsoft.

How can I remove all azure integration from my visual studio templates?

I never notests this but if you create a new asp.net MVC website in visual studio you get full azure integration without knowing it. Turns out all of my applications, while hosted on my own server, are logging everything they do with Azure.
If I remove all azure dependencies from my project it won't build anymore. Is there a way to remove this feature from my asp.net project template? I really don't like this, for one, my inbox is exploding with "Data collection for .... has reached it's daily cap" emails and two, I feel violated in my privacy, why does Microsoft have know everthing of my projects?
Sorry for the possible duplicate question, but Google really isn't my friend on this one.
Actually, when you create a new project with default options you don't get any Azure integrations.
If your application is with Azure AD authentication, you should disable this when creating the new project.
If your application is doing logging on Azure, you can disable Application Insights.

Publish ASP.Net MVC Site (created in Visual Studio) to Azure using Azure Cmdlets

I have a ASP.Net MVC Project in a solution which contains multiple other Class library projects (which are dependencies of MVC project).
Now I want to automate the process of creating multiple DEV AzureWebsites and publish the MVC project (along with its dependencies) through Azure PowerShell Cmdlets.
I know how to create AzureWebsite and other Cmdlets, but I am not sure about how to publish VS MVC Project, take that folder and deploy it in AzureWebsite. Please let me know my options.
PS - I do not want to Visual Studio -> Right Click publish option, because I need to create multiple instances of Dev AzureWebsites.
Good news. The script to do this is already written for you. In Visual Studio, take a look in the PublishScripts folder of your solution. There you will find the scripts and parameter file for your solution. You can use these to publish to other Web Apps (formerly Websites).
The dependencies will be included in the package file that is generated so no additional steps are needed for that.

TFS 2013 Team Build/WIX/ASP.NET MVC Project

I'm trying to design a WIX setup project that needs to harvest the output of an ASP.NET MVC Web site.
There are several problems.
Building the ASP.NET project does not output the same content as a web publish would.
So it seems that I need to harvest the output of the published web site, meaning it should be done in a temporary location.
It should work on team build continuous integration (and in Visual Studio).
Every sample I've found so far uses temporary directories and command line steps before building the setup project.
Am I wrong ?
Is there another solution ?
Thanks in advance.
You would need to run those commands as part of your build so that you have that output to then package with WIX.

WebDeploy to deploy multiple web sites

We're using this process to use WebDeploy to deploy and compile two web sites that are a part of the solution. The approach we took was found here:
http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html
But it's only deploying one of the web sites; is there a way to tell it to publish both?
Thanks.
Web Packages created based on the above walkthrough (i.e. via VS 2010 and its derivatives like TFS etc) can only contain one web project. Unfortunately VS generated Web Packages will be limited from this sense. If you use Web Deploy (MSDeploy) EXE or API directly and then you can package more than one web site within IIS etc. I believe you are trying to accomplish this via Team Build so that is not really an option.
Although, in Team Build you can create more than one build definitions to cause multiple packages to be created. You can also set properties in your .csproj or .vbproj file (same properties mentioned in Step10 of the walkthrough). If more than one project have properties DeployOnBuild set to be true then from within single solution build within TFS you can have multiple web packages generated. You will still have to deploy each web independently.
Hope this helps

Resources