During following my first kaa application, I added sample configuration schema to log schemas table by mistake. log schemas table How to fix the mistake ? I can delete neither application nor schema.
It is not possible to delete a log schema in Kaa. There is a ticket in Kaa Jira: KAA-591.
To correct the mistake, just ignore this log scheme and upload a correct one. Later in the guide, use a correct log scheme version to create an SDK profile.
Related
I'm trying to run
dotnet ef database update
When I do so, I get an error about not being allowed to CREATE TABLE. Not entirely surprising as I don't want the user I have the website running under to be able to create tables. So, after a bit of searching I found a solution that basically created an inherited context, and with that context used a different set of credentials. So, I tried;
dotnet ef database update --context ScaffoldContext
And I got the same error. I checked my connection string, yes, it's a user I can use to create a table with. Confirmed through SQL CLI. So, I added CREATE TABLE privileges to my site user, and the error changed. Suggesting that the base connection string was the one that mattered and it's ignoring using my elevated user. I tried moving the configuration into the OnConfiguring override in my inherited scaffold context, instead of services.AddDbContext in my Startup.cs. However, looking this up it looks like the wrong way to go about that. When I added CREATE TABLE privilege to my site user, I got a different exception about not being allowed to touch dbo.
This is driving me nuts, I don't want to use my site user as my migration user and it seems every example I find is from older versions of EF or dotnet core. Does anybody have any solid guides on how to go about managing users correctly using migrations with 2.1?
Note: If I change my connection string to be my sa user, it works fine. So the migration will go through. I'm just not wanting to give either full privileges to my site user or swapping credentials around in connection strings every time I need to run a migration.
I'm totally new to ASP.NET Core 2.0; I created a new Project with In-App Authentication.
When I run the application and try the Register function, I get an error message saying that
the table "AspNetUsers" does not exist.
That is OK and expected, I did not run the Migration scripts. For less confusion, I then deleted the Migration folder.
The problem I want to solve is I want the Register functions to register the user to my custom database. I already updated the settings in appsettings.json for this.
I made a Notepad++ search in the entire folder for AspNetUsers and found 0 hits. Yet, when I run the application again, the error message is the same, that the table "AspNetUsers" does not exist.
I am very confused. How does it know to look for that table if that text does not exist in the entire project directory?
How do I make it use my own database? I looked around, but I was unable to find any solutions. This is my last resort.
Thanks!
AspNetUser is table name for ApplicationUser object in database and there is no automatic migration in EF Core yet, so you have to generate migration files by your self. in database run following command nuget console:
Add-Migration Initial
after running this command a Migrations folder would be added. then run next command to apply migration to your database:
update-database
I recently started building my first Firebase app, and I'm unsure how to create test users.
For non-user test data, I can keep a testdata.json file in my codebase and import it via the Firebase Console, but there doesn't seem to be an equivalent mechanism for users.
I'm aware that the latest version of firebase-tools (v3.2.0, released 4 days ago) added an auth:import command, but when I checked the docs, I saw that it expected password hashes to be pre-generated, which is not something I know how or want to do manually.
If there was an equivalent auth:export command that generated a file appropriate for feeding to auth:import, then I could use the Firebase Console to manually create a few users, export them to a file, and check it into my codebase (just like testdata.json), but there is no such command.
Even then, the fact that the Firebase Console doesn't let you set basic profile attributes (like displayName) on users is yet another obstacle...
There are three ways to create email/password users:
through the API
through the Firebase Console
by importing them with the Firebase CLI
For your use-case all three of these sound equally applicable. If you're having trouble getting one working, edit your question to include the minimal steps that reproduce the problem. If you'd like to request a fourth way, I recommend filing a feature request.
For anyone following along with this post, it appears the Firebase CLI added this export feature:
firebase auth:export users.json
However it's not clear to me how user password hashes are preserved for auth:import
The easiest way to add test users with JSON + Firebase console.
Go to your project -> develop -> database
click menu -> export JSON to see your Db structure
add new users (or other data) to this JSON
Go to your project -> develop -> database and delete your database
click menu -> import JSON and paste your new JSON-file
Now your Db contains test users!
I need some clarification on when to register a Database as a Data Tier Application (DAC). I've looked at all the guides but am stuck on a few points.
The database is NOT registered
Build Database Project to produce DacPac
Publish the Database Project
Check "Register as a Data Tier Application"
Check "Block publish when database has drifted from registered version"
First time round, this works. It registers the database and succeeds.
However, on subsequent publishes is fails as it says the DB has drifted noting two users which have not changed.
Am I following the correct process? i.e. setting the Publish script to re-register each time?
What is the best practice for making changes? By changing the relevant .sql files in the Database Project and then building? The guides talk a lot about being able to version the DB using the DacPac but its not clear how. Should I rename each DacPac and commit it to TFS?
My next step is to publish the Database as part of the overall ASP.Net Solution. When I try to do that (it works fine when the DB publish is not included), it comes up with the following error
Web deployment task failed. (The SQL provider cannot run with dacpac option because of a missing dependency. Please make sure that DacFx is installed. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DACFX_NEEDED_FOR_SQL_PROVIDER.)
However, I have all the required elements installed on the publishing machine. Do they need to be on the SQL Server or IIS VMs?
Any guidance would be much appreciated.
If you want to deploy your changes to a database using a dacpac you would need to register the database as a DAC. This basically creates a snapshot of the database at that point in time. You do this before making a change to create the initial snapshot and then after a deployment.
The reason you do this is to detect drift. Lets say you do a deployment and someone makes a change directly in that database, for instance changing the logic of a stored procedure, you would want to know about that change before making a subsequent deployment. If you deploy your dacpac and ignore this change it will revert their change to whats in the dacpac model. This is where drift occurs. You can generate an xml report on what has drifted through the sdk.
You can enable a setting to disable deployment if drift occurs so that you can retrofit those changes in the database directly in your source code. You would then need to re-register the database as a DAC to create a new snapshot.
Am I following the correct process? i.e. setting the Publish script to re-register each time? Yes
What is the best practice for making changes? By changing the relevant .sql files in the Database Project and then building? Yes
The guides talk a lot about being able to version the DB using the DacPac but its not clear how. Should I rename each DacPac and commit it to TFS? You can set a version within the databse. Have a look at the properties of the database project. You shouldnt rename the dacpac.
About the ASP.Net publish, I would need a bit more detail around the project structure and environment setup.
I was restoring a database in MarkLogic and accidently I changed the security database also. Now I am not able to login into the admin interfaces using my previous admin username and password. I went through the documentation and came to know that if realm is changed in security database this can happen. But no solution was provided. I have tried uninstalling and reinstalling MarkLogic but as this does not change the security database, I still could not login. I am sure that there must be a way to reset my login credentials but I couldn't find it. Can someone suggest what should I do??
How about:
Stop MarkLogic
Move all data
Install a clean copy of MarkLogic
Start MarkLogic
If you have a backup of the Security database, then restore that first. If not, recreate all security settings manually. After that, continue with:
Recreate earlier databases with Forest names identical to how they were
Stop MarkLogic
Move back all Forest data except those of Security
Start MarkLogic
You could try fiddling a bit with the XML configs like assignments.xml, but that is not highly recommended, and do make copies before you do so..
HTH!