Getting error when create octopus release - continuous-deployment

I am using TFS as a CI tool and using Octopus to deploy my C# Web API project. Build artifacts package pushing and creating release successfully from TFS to octopus side, But When try to deploy for IIS in Assembly server, It's getting error as like this, Please check attached error log.

The line that's throwing that error is this one in Calamari. That function Assert-WebsiteExists only gets invoked when you try to do one of the following:
A) Deploy a Web Site in IIS under an already existing Web Application.
B) Deploy a Virtual Directory in IIS under an already existing Web Application.
Both of the above will fail if the parent Web Application (in your case WKLS.Mockservice) doesn't exist before you run that step, which is apparently what's happening in your case.
If you are trying to create the Web Application from that same Octopus deployment process, then you should use this step. If you want to use a Web Application that already exists, then perhaps you just typed the name incorrectly?

Related

Error while publishing an EF Core Angular app to Azure App service

One year back I have worked for a project using the EF Core Angular app (.NET Core 2.1). Now we got some modification to the existing application. So when I try to execute the same application by changing the connection string in the appsettings.json file, it's working fine in local machine. But when I try to publish it in Azure app service it's giving some irrelevant error.
Note: The database is in an Azure VM earlier and now. But when we stop the VM and start the IP will be changed so we need to change only the connection string.
I tried installing all the run time SDK and host bundles. But it doesn't work. I wonder when it is working fine in local, Why it's not getting published in Azure.
Can somebody help me with this?
Congratulations that the issue is error is solved by #vamsi himself:
"I have fixed the issue by commenting the some of the lines in .csproj file."

How to build and release a react application in a web api application with Azure DevOps?

We now have two applications with two differents git respositories. The first one is in ReactJS for the front and the second one is in C# (Web Api 2) for the back. When we want to deploy on Azure, we build the front and we copy the output files to the c# project (web api project). We deploy the web api application from Visual Studio in Azure thanks to the deploy menu.
It's a little bit boring and sometimes we have errors when we change by hand the parameters relative to our differents environments.
We would like to automatize all these tasks with Azure Dev Ops. Have you ever done this kind of stuff ? And how ? Sorry, if this question seems stupid but i can't find a tutorial to build when the front and the back are not in the same git repo. Thanks in advance for your help.
You can follow below steps to build and deploy your application. I can only give a general idea and steps. The main idea is to get your front and backend source code together and build them in the same pipeline. The configurations and parameters for each tasks in the build pipeline need you to specify according to your project.
Below steps is shown in classic view pipeline. Check here for yaml view pipeline
1,Sign in to your Azure DevOps organization and navigate to your project.
2,Go to Pipelines, and then select New Pipeline, and select Use the classic editor to create a pipeline without YAML at the end of the page.
3,Walk through the steps of the wizard by first selecting as the location of your source code.
4, select a source to specify where your code is located. And continue to choose a template, here i choose ASP.NET Core(.NET Framework) template.
5, Add a powershell task to the top of your pipeline(the tasks can be drag and drop to reorder) to run the git commands to clone your front react.js code into same source folder of your backend c# code.
If your code is hosted in azure repo git. You can add below scripts in your powershell task. Make sure Allow scripts to access the OAuth token is checked
cd $(Build.SourcesDirectory)
git clone "https://$env:SYSTEM_ACCESSTOKEN#dev.azure.com/{yourAzureorganizationName}/{yourProjectname}/_git/testrepo"
6, add npm install task and npm custom task to build your react.js, You need to specify the path of Working folder that contains package.json to the folder where you cloned your reactjs code in the above powershell step. you can check steps here for reference.
7, Add a copy file task before task Visual Studio build to copy the output files from building react.js to the your c# project.
8, Configure the necessary path and parameters for Visual Studio build
task and Visual Studio test task to build and test your backend c# code.
9, Add an Azure App Service deploy task at the end to deploy to azure.
You might need to add other additional tasks to build your projects. You can also move your deployment task to release pipeline.check here for more information.
There are lots of examples and learning materials that you can find online about how to create build pipeline and how to deploy your application to azure. I suggest you can follow one example to create your build pipeline for c# project and try to edit your existing pipeline to integrate your react.js project.
Here is microsoft official documents for you to check it out. Hope you find above helpful.
Here, you can find the steps to build and release two web apps (hosting web api) and the relative front developed in ReactJS. Here's our goal :
In Azure devops, we've created a pipeline using the classic editor :
We selected our git repository and this template :
After a step of creating tasks, we obtain :
We'll describe some of these tasks. For example :
/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\appRetailLab" /p:DeployDefaultTarget=WebPublish
Once you've build the two web applications, you've to copy the front files in web applications. There're two tasks for that :
At last, you publish your artefacts in the drop directory within the build.artifactstagingdirectory :
The release :
Our release is not too difficult :
We use 4 tasks :
Replace Token is a very usefull plugin. You can replace a token (defined by a template) by a value defined in the release. We use this plugin to replace our token in the front part of our applications (js files).
To add token in our reactjs application, we use dotenv npm package.
For the web.config parameters don't forget to check XML Variable substitution in your deploy task.
That's it.

Can't log in to SQL server after cloning repo

I am using the generic ASP.NET Core sample project with login examples. I made some basic modifications (no modifications to the model).
I pushed my project out to bitbucket and then cloned it on another computer (where I have a different login and domain).
When I try to load my project, I get the following:
Cannot open database "aspnet-WebApp-XXXXXXXXXXXXXXXXXXX" requested by the >. The login failed.
Login failed for user 'MYNEWDOMAIN\mynewusername'.
It's using EF migrations (since the example uses basic migrations).
I don't care about the content of the database (I seed it anyway)... I just want to be able to run the project.
Any ideas?

Can't deploy Google App Engine application on local server

I am trying to follow the instructions for running a simple new Google App Engine web application locally (without Google Web Toolkit, just the Web App) named "tunes".
I am following these instructions. Step one is to make a run configuration. I made one using all the defaults; I checked that under the Server tab the "Run built-in Server" box is checked. However, when I Run the app, I get the Console; right below the console tab it says
&ltterminated> tunes [Web Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe (Feb 26, 2014, 5:35:44 PM)
then below the line is what looks like a classic Unix "Usage" error message in the console, in red type, whose first line is
Usage: &ltdev-appserver> [options] &ltapp directory>
followed by a list of options, and then nothing else happens that I can see.
I tried pointing a browser at http://localhost:8888/tunes as suggested by the documentation, but Firefox could not find a server active at that port.
Under the Arguments tab in the Run Configuration is the following:
"-codeServerPort 9997 --port=8888 org.tunes.gaeproject.Tunes C:\Users\cdf\java\eclipse4.3.1workspace\tunes\war"
I can successfully deploy the web application to the Google App Engine site and run it there.
What do I have misconfigured?
Google AppEngine application is not meant to run on local server, and neither you could create its docker image etc to deploy it anywhere you wish.
Instead I suggest you to port your application to Google Compute Engine (GCE) first within your deployment setup, which might require minor code refactorings, and Kubernetes kinda auto-scaling deployment will functional equivalent to what you have now. But with approach you may port the application easily to local server setup, or a docker image to run from any virtualization environment

Deployment of RIA Services app not working with Web Deployment Project

I'm attempting to deploy a RIA services 1.0SP1 project that has been precompiled with a Visual Studio 2010 Web Deployment Project. When I deploy the application to IIS using Visual Studio, the application runs fine. However, when I use a web deployment project to precompile the application, the first call to a RIA services service on the same system fails. An error similar to this is produced:
Load operation failed for query 'Login'. The remote server returned an error: NotFound.
It appears that the "NotFound" error happens frequently in RIA Services applications, as per this question. Using Fiddler, I discovered the error is a true Not Found error on the server, where as the service cannot be found. I also attempted to reference the URL of the service directly, which failed.
Searching the web, the comments on this post point to there being known problems with web deployment projects and RIA Services and this post points to the issue being a problem with Virtual Path Provider that RIA services uses to map the incoming requests to the proper domain service.
My question is, is it possible to get a RIA Services Web application working with a Web Deployment Project? Are there configuration changes required to make this work? One of the referenced sites mentions manually creating .svc files, is this the correct approach for solving the problem?
Here's what I could find. RIA does not support deployment in a Web Site project. This is an intentional decision that is evident in the tooling (you cannot add RIA to a new SL application that you're linking to a Web Site). My best guess is the precompiled deployment option can interfere with the execution of RIA's Virtual Path Provider.
I can't find anything that confirms the VPP will not run, but here are the sources that lead me to the conclusion.
1) From http://msdn.microsoft.com/en-us/magazine/cc163675.aspx
"Note that the .aspx files in the deployment directory are just marker files with no content. They have been left there to ensure that a file with the endpoint name is present in case the "Check that file exists" option for the .aspx extension in an IIS app is set."
2) From http://forums.silverlight.net/forums/t/218547.aspx#531318
"When you build and deploy your RIA services website using web deployment project then you have to copy a dummy page with .svc extension file under "ClientBin" or create a folder "Services" and paste the file there."
3) From http://forums.silverlight.net/forums/p/186739/428256.aspx#428488
"If the [published] WebSite project does not work, go to the folder, delete the PrecompliedApp.config"

Resources