Where is the documentation on how to deploy .Net Core apps to Azure Webapps thru VSC? - visual-studio-code

There is documentation on creating and deploying 'Hello World' in Node.Js and deploying it in an Azure Webapp.
https://code.visualstudio.com/tutorials/app-service-extension/create-app
But there isn't documentation on doing the same with .Net Core. I have the 'Hello World' console app as per this.
https://code.visualstudio.com/docs/other/dotnet
I also have the 'Azure App Service' extension installed. How do I deploy the 'Hello World' to Azure Webapp.
I tried Github also. But they closed issue without action.
https://github.com/MicrosoftDocs/azure-docs/issues/10044

How do I deploy the 'Hello World' to Azure Webapp.
We need to deploy the Web Application to Azure not console Application. I do a demo to deploy .net core webapp to Azure through VS code.
The following is detail steps.
1.Create a MVC web application with dotnet command.
dotnet new mvc
2.Publish the project to the local path.
dotnet publish webprojectName.csproj --output localpath
3.If Azure WebApp extension is installed, login with Azure account then you could create azure webapp and deploy the project to your Azure web
4.Select the created/existed Webapp and select the directory(published output local path) to deploy.
5.Check the output from VS code and browser the WebApp.

Related

How to deploy ASPNET Core site to Azure Linux Web App (no container)

I have a web app, and I've setup VSTS to create a package in build, and then deploy it using release management.
It puts all of the result in the wwwroot of the site if I look at it in ftp so I get:
/site/wwwroot/
/wwroot
/
This doesn't run and I get a 404 error.
If I use the URL and go say /wwwroot/images/ it returns it just fine.
The app is set to use .net core and I'm doing a self-contained package.
How do I get VSTS release to put the files in the right place and what is the right place ? I can't find any documentation on this anywhere. Everything is to do with Windows.
Also, what linux target should the dotnet application be set to for self-contained? I have it using ubuntu but I'm sure that's wrong and it's something else.
Please use Azure App Service Deploy task with 4.* (preview) version instead, and deploy again:
I had a similar issue and I responded here. Essentially you need to have a startup command pointing to your DLL because Dev Ops deploys the package in a different way than VS.
Deploying .Net Core to Linux WebApps on Azure with DevOps

How do you overwrite the msdeploy parameter setParam:name='IIS Web Application Name',value when deploying from VSTS

I am able to deploy a website to a VM in AWS using VSTS. My code is hosted in git on VSTS. When I deploy using IIS Website. In the IIS Web App Deploy
In Additional Arguments I specified -setParam:name='IIS Web Application Name',value='Default Web Site\TestVSTS. But it still gets deploy to 'Default Web Site'
And on the log file on VSTS i can see the command not getting overwriten with my command. Any body having the same issue ?
Log File Command being executed by vsts :
C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A2_work\r3\a\temp_web_package_2238626544802922.zip' -dest:auto -setParam:name='IIS Web Application Name',value='Default Web Site' -enableRule:AppOffline -enableRule:DoNotDeleteRule
Update : Set WebSite to "Default Web Site " and Virtual Application to "TestVSTS" Still did not work. Look Below to see what I did and it did work
Update this Work
The IIS Web App Deploy task has already included –setParam parameter.
Based on the parameter, you want to specify web application name, you just need to specify Website Name (Default Web Site) and Virtual Application (TestVSTS) in IIS Web App Deploy task.

How deploy .NET Core web application via Visual Studio Team Services to hosting with IIS

I would like to deploy my .NET Core web application via Visual Studio Team Services to hosting with IIS.
I have tried to discover the possibility of deployment the final release but I don't know what type of task I can use.
I usually used the deploy via Visual Studio 2017 and using publish proccess with MSDeploy and setup profile like this:
<publishData>
<publishProfile
publishUrl="publishUrl"
msdeploySite="site"
destinationAppUrl="destinationAppUrl"
profileName="Default Settings"
publishMethod="MSDeploy" userName="login" />
</publishData>
This site is not running on azure but on shared asp.net hosting.
How can I setup the Visual Studio Team Services - Deploy release if I only know these information?
What type of task is necessary to use?
Since you can deploy it with publish profile, you can to do it in VSTS build/release too.
NuGet restore (2.*) or Dotnet restore task
Visual Studio Build task (MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]"
You can use IIS Web App Deployment Using WinRM tasks if you have admin account.
If the host supports FTP, you also can upload the published files through FTP task.

Elastic beanstalk and Visual Studio Online

Is there any way to deploy build from VSO direct to Elastic Beanstalk?
I have working build of .Net Core application and I can easy deploy it from AWS Toolkit, but don't know it is possibile from VSO.
You can use the deployment tool to automate deployments to Elastic Beanstalk.
Set up an on premise build agent
Prepare environment (e.g. install AWS Toolkit for VS)
Call awsdeploy.exe tool to deploy via Command Line build step/task (e.g. Tool: C:\Program Files (x86)\AWS Tools\Deployment Tool\awsdeploy.exe, Working folder: $(build.sourcesdirectory), Arguments: ElasticBeanstalkDeploymentSample.txt)
More information about deployment tool, you can refer to: Deploying Elastic Beanstalk Applications in .NET Using the Deployment Tool

Build and Publish ASP.NET Web Site Team Services

How do you go about setting up the build / publish for an ASP.NET web site (not a compiled application).
I have a classic simple site with primarily static assets. The only reason for the site is an aspx page that is used for a contact form email.
Simple steps:
Install IIS Web App Deployment Using WinRM extension if you want to deploy app to your web server
Create new build definition with Asp.Net Build (PREVIEW) template (select ASP.NET Build PREVIEW template when create build definition)
Add Windows Machine File Copy step to copy files to your web server
Add WinRM-IIS Web App Management step to create or update web site in IIS
Add WinRM-IIS Web App Deployment step to deploy app to web site (step 4)
You also can refer to this thread: Automated Deployement of ASP.Net MVC Website In IIS server with a Continuous Deployment
If you want to deploy app to azure, you can add Azure App Service Deploy step to deploy your app to azure (do not install previous extension and remove step 3, 4, 5)
You also can refer to this article: Deploy ASP.NET apps to Azure web apps
What I was looking for was publishing a ASP.NET 2.0 Web Site (not an application that requires a build).
It ended up being pretty easy. I have mostly static files, but there is one aspx page for that is used for a contact form. I followed this solution but tweaked it a bit.
All I needed to do was add the npm and gulp task. My gulp task does as the answer suggests - copies all of my pertinent files to a folder called dist. From there, I copy everything from the dist directory to the $(Build.ArtifactStagingDirectory).
Then it is just a matter of publishing the $(Build.ArtifactStagingDirectory) to the server (a drop directory similar to the examples of building an MVC app).
I wired in the release for CI / CD.