Can't log in to SQL server after cloning repo - sql-server

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?

Related

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.

Getting error when create octopus release

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?

Run the application from its EAR

I have only ear file of the application and I need to deploy it on the server. I tried deploying it directly on my integrated weblogic server but because of security in the EAR, it is asking username/password from me and when I provide one from jazn file of the application, it does not accept.
Next I tried creating customization application of the ear and there I gave reference to jazn file while creating project. Now it is accepting my password but while running, it is throwing error -
[oracle.jbo.NoDefException][oracle.jbo.mom.DefinitionManager.findDefinitionObject][ApplicationCustomer]
I googled this error but seems like it is because it is not able to find business components from the corresponding model project. I added the model project as a dependency but still getting the same error.
Any ideas ?
You can create your own users directly in Weblogic, though Weblogic Console:
http://docs.oracle.com/cd/E21764_01/apirefs.1111/e13952/taskhelp/security/DefineUsers.html
Since users are server specific and not application specific, you can use these users to log on against your application.
For convenience reasons an ADF application can deploy users and roles, but thats only for testing purposes. In Production systems, users are not being deployed with the application, but either created through Weblogic Console or Enterprise Manager, or 'injected' by a Authentication Provider.
Another option would be to change passwords for the users deployed along with the application. On Weblogic Console, go to:
Security Realms -> My realm -> User and Groups -> select one of the users -> Passwords.
Then provide New Password and Confirm New Password fields. Save.

DNN / WebMatrix / Localhost / Multiple Sites

It seems that DNN is undergoing an upgrade and I cannot access the forums or many of the docs. Needing an answer soon, and Google providing too many varied types of hits (none of which are helpful or most of which post to the DNN site that is undergoing that upgrade), I had a few questions about setting up DNN.
First, I am coming from Orchard. There I was able to use Webmatrix - I downloaded the web version, opened as administrator, created modules, messed with themes, etc. Using the Orchard Docs, I was able to set up a multi-tenant site and run it on local host (IIS express through Webmatrix) - this included modifying the host/config files to view the multi-tenant sites. I could then publish to my own server running IIS 7. On the server I set up the landlord site then bound the tenants with no problem.
Being new to DNN (and things not being readily available at the moment on their site), I was hoping I could get some guidance on how to set up DNN similar to what I did with Orchard.
First question is obviously whether or not that is possible (i.e., no IIS, only IIS Express (Webmatrix) on my local machine).
Here would be my other questions:
If I can run it locally, can I just download the 7.1.0 new install package, and open Webmatrix (as Admin) on the folder I unzipped it in?
Assuming I just "Run" the website, I will then set up the "Landlord" instance of DNN on the following screens, correct? (i.e., where it asks for credentials and what DB setup I can use)
Can I then go ahead and create sub-tenant sites (alias/portal)? If so, do I go about manually updating my host/config files to run those tenants (depending on the port)?
Assume all of the above is correct, do I have to "reinstall" the 7.1.0 package on my webserver, or will a simple publish from Webmatrix do (with the proper credentials in Settings)? If so, I can handle pointing to the landlord on my server and then binding my subtenants in IIS.
Sorry for the n00b questions. Thanks!
On the Download page on dnnsoftware.com, there's a link to click which will start the install process within WebMatrix: http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2fweb%2fwebpi%2f2.0%2fWebApplicationList.xml&appid=106
When you create a new portal, you can specify that it uses a URL which is a subdirectory of the current URL (i.e. a child portal alias), so that you don't have to use different ports. I'm not especially familiar with IIS Express, so I would expect that you could point multiple ports to the site, and map those as different portal aliases, but not sure exactly how you could do that, if you don't want to make use of child portal aliases.
To publish a site, you should just need to push the file system and database, and setup IIS.

Log installer info when installing WPF App

I have a WPF (Clickonce) app. I want to find out which users are installing or re-installing the app, and probably write those info in a database for audit.
How can I do that?
The current ClickOnce deployment doesn't provide any server-side hooks for monitoring whatsoever (in fact, the "website" generated by ClickOnce publishing is just a very simple, plain HTML page providing a link/button for downloading and executing the .application or setup.exe, respectively, on the client machine. Everything else is taking place locally).
Now, depending on what you want to log (initial installations, or updates, or both) you have the following options:
Create your own website where user will register before getting access to the install/launch for the app (or maybe you just identify them by IP - depends on your needs) - this allows you to log who first installs the app, but not the automatic updates.
In your application, use the classes in the System.Deployment namespace (notably ApplicationDeployment) to access information about updates etc. whenever your application is run. You can then have your app make calls to a web service that you provide, where you can log any installation / launch action (or even other runtime information, like usage of certain features, exceptions etc).
If you are targeting .NET 4, you can have the log files go to a specific folder. Then when the user runs the application, you can have it copy it to your server and delete it, or write it to a database and delete it. Here's an article explaining how to specify where to put the log from a ClickOnce deployment. Note that it runs when you install, update, or uninstall the application.
http://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/
The registry settings are in HKCU, so you could have your C/O app actually set the info when it first installs. You'll miss the first install log, but it will write the logs to disk after that.
Also note that the article tells you how to turn on verbose logging. You don't have to do that just to write the log to a folder.

Resources