Unable To Publish To AWS Lambda From Visual Studio 2017 - amazon-web-services

I am trying to take an existing .net core API project and run it as a lambda function (Which should be possible).
I have installed the VS 2017 SDK for AWS. While following tutorials, I am supposed to be able to right click my project and select deploy to AWS Lambda. The only option I have is "Publish To Elastic Beanstalk"
However, when I create a brand new empty function in Visual Studio (New Project). I do have the ability to Publish To Lambda
But I can't seem to figure out the difference between the projects. Every nuget/tooling reference between the two projects is identical when it comes to AWS Packages.

My answer was the following, in my csproj I had the following line :
<DotNetCliToolReference Include="Amazon.Lambda.Tools " Version="1.5.0" />
Notice there is a small space after Tools. No complains from VS though so it was super hard to spot, and only exists because you have to edit the csproj manually when adding DotNetCliTools.

Related

Azure DevOps project build returning with log4net error

I'm trying to build a visual studio 2015 dot-net application which has log4net reference in the code.
When I build in Azure DevOps using Nuget restore, Nuget Tool installer, Visual studio build, Publish Build artifacts I am getting an error:
Error CS0246: The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?) Process 'msbuild.exe' exited with code '1'.
Please someone suggest whether I have to add another agent or make some reference to the package/nuget in Azure DevOps. need details since I'm new to Azure DevOps.
The error message suggests that either the using is missing or the assembly could not be found, meaning that probably the nuget restoration has failed.
If you can't figure out the issue by looking at the log, the first step should be to set system.debug to true, then you might get more info about what the issue might be.
My first instinct when I don't know what's going on would alsways be to look into the s folder of an agent but I don't have experience with hosted agents and as far as I know you cannot access the working folder of a hosted agent.
So as a workaround (only if everything else fails) I would suggest to zip the s folder ("$(Build.Sources)") or special parts of it into the a folder ("$(Build.Artefacts)") and publish that zip as an artefact. Then you can download it and look at it in great detail, e.g. look at the packages folder or open the solution and see why it doesn't compile.
Problem was partly solved as there was .gitignore and .gitattribute files in my source directory which i guess had entries to ignore the third party .dlls like log4net and several folders which were not getting checked-in when i did vsts push. But there arose some other errors in vsts build now which i am trying to figure out. I will create a new thread for that.
Thanks.
For some reason I lost ability to see it in
Tools -> Manage Nuget Packages for Solution
However from the docs
I used
Install-Package log4net
in Package Manager Console
That solved the issue.
Previously I had noticed the yellow triangle against log4net In Manage Packages For Solution, and may have tried removing it via Nuget.
However it was still showing as a reference

How do I create a TFS2017 Build Task equivalent to Visual Studio's Web Deploy Publish method?

I am trying to complete Continuous Integration/Continuous Deployment automation for a web application project. I have been helped by a series of SO posts link1, link2, link3 and things are now running, except the upload to the hosting server is longer than it needs to be; I currently upload all files instead of just the ones that changed.
When creating the TFS2017 Build (or Release) there are many Task options, including some from the marketplace. I'm referring to, in this case, the dialogue for a Build as shown below:
I'm currently using a PowerShell script which seems a little archaic and inefficient as noted above. Do any of the tasks available to us mimic the Visual Studio 2017 Web Deploy Publish Method which runs quite nicely and quickly? If not, what can I use for an 'intelligent' upload process that checks whether or not a file must be uploaded?
Unfortunately, there is no this kind of build task could mimic the Visual Studio 2017 Web Deploy Publish Method for now.
The method trough VS IDE will dynamically check if some files need to be uploaded or not.
However through TFS build task or powershell script will not do this, just simply copy all files you assigned. Afraid there is no workaround for an 'intelligent' upload process that checks whether or not a file must be uploaded. Since we don't how VS IDE did this.

Publish option missing in visual studio

I am trying to deploy an application to aws from within visual studio (2017), but the publish and publish to aws beanstalk options do not appear when I right click the project in the solution explorer. I have installed the aws toolkit, and when working with other projects, the options are present. I'm still new to visual studio, so it's possible I'm missing a simple step, but any help would be appreciated, as I have spent several hours searching for an answer.

Is it possible to use Web Deploy from Visual Studio Online?

I would like to build in Visual Studio Online and then Web Publish to Amazon.
Is this possible? Or does it only publish to Azure?
It publishes to wherever you like.
Use the PowerShell, Batch, or ShellScript task to deploy to whatever system you like in whatever way that you want.
Better yet, create a professional release pipeline with release management and deploy to many environments.
I ran MSBuild with the following parameters added...
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:DeployIISAppPath=MyWebsite
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=WMSvc
/P:CreatePackageOnPublish=True
/P:MsDeployServiceUrl=https://DOMAIN/MsDeploy.axd
/P:UserName=User1
/P:Password=******

C++ in the cloud. Casablanca REST Service on Microsoft Azure

Hello fellow Azure users. I have created quite an extensive C++ REST service using the CasaBlanca REST SDK. When I began working on this project I as lead to believe that I could run it in the Cloud (Azure) . Please explain how best I can get this service to run on Microsoft Azure. I can't afford to re-program the entire project in another language like C# or Java. Thanks in advance!
If you're wondering why I believed CasaBlanca was meant for the Cloud:
http://channel9.msdn.com/Events/TechEd/Australia/2012/AZR331
-Seth
Looking at the TechEd video I can see that they are using the SpeechService demo which you can find the source of here: https://hg.codeplex.com/microsoftcasablanca so you can understand how they performed the deployment to Azure.
Looking at the code I can see the solution is designed to be deployed to a Cloud Service Worker Role and includes a "Cloud Service" project in the Visual Studio solution - this is the project type which gives the "Deploy To Cloud" option which you see in the video.
Given that the demo is from 2012 there will have been many Azure SDK releases since then so the demo code may require an update, but the deployment method from Visual Studio 2012 and 2013 remains essentially unchanged.
Regardless how you're using casablanca, c++ applications can be run on Virtual Machines, web/worker role (stateless) VMs in cloud services, probably websites... Choosing between these is a matter of opinion (or at least dependent on the app you're building), and there's no single right answer.