How to configure encryption of documents in ravendb in a multitenant scenario within IIS 7.5 - encryption

Thanks to Daniel Lang's blogpost we were able to encrypt our documents.
Since we are now in a multitenant situation(Multitenancy in RavenDb) and deployed ravendb within IIS 7.5 we want to encrypt all of the tenants.
Unfortunately we're getting a lot of errors (especially in the management studio):
The remote server returned an error: NotFound.
Our tenant databases are created, as we can see them on the file system. But within the management studio we cannot see them anymore.
To enable encryption we placed the encryption dll in the Plugins folder.
Do we need to make some extra configurations to get this to work?
Edit: steps for reproduce:
Clean instance of ravendb configured, IIS 7.5
Created an encryption dll, based on Daniel Lang's blog post
Created a plugin folder and saved the encryption dll from step 2 in this folder
Go to management studio and create some sample data for the default database
Optional: create a tenant database and create some sample data

Related

Moving to Azure hosting and how to choose session state, Database and server

I am totally new to Azure and have been asked to move websites to Azure hosting.
Moving to Azure hosting do seems to an issue but problem seems to be with the asp.net session state, our website which are developed using asp.net 4.0 & MVC & some of the website are quite old developed few years back around 2013-2014.
My big worry is how to choose session state or third part session cache where we wont need to make any change in code other than to web.config file.
We so many article around it has created confusion.
I would appreciate best way we can migrate to azure hosting without making changes to code other than web.config file.
I looked at Azure Redis Cache but this also required to install Microsoft ASP.NET Universal Providers and changes to config file link.
Does Azure provide MS SQL Database with build in support for SQL Session, so that we only need to make change to web.config file rather than installing packages using nuget etc..
This option of Microsoft blog seems to be the option can some config if this right & easy approach. but also at the comment user have posted few issue with this approach
https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/11/28/asp-net-session-state-with-sql-server-in-memory-oltp/
Based on above let me give more details
We use windows based dedicated server for hosting
We use MS SQL SERVER Windows 2012 for database
IIS 7.5
and other software to managing website such as plesk
We have website developed in asp.net webform based website running with framework 4.0 or 4.5
We also have few asp.net MVC based website running on framework 4.5
We use InProc default session state
Firstly, my big concerns are session state, i want to migrate to Azure without making any changes to code except changes to web.config is this possible?
Second we use MS SQL SERVER 2012 as database what is equivalent of same in Azure as in some page it refers database as SQL Database and some where as Azure SQL Database which creates confusion of this SQL Database or Azure database as i have red that these are two different things?
Third, let us say i choose Meb+Mobile--> App Service Standard Package (which comes with upto 10 instance) what are these instance? and will individual session always connect to same instance?
Forth: Database i have about 20 database one of them is about 6GB & other database are about 200MB-700MB which service should i use for database
Single Database or Elastic?
Can i create multiple database under elastic mode?
Let us say if i choose "100 eDTUs: 10 GB included storage per pool, 200 DBs per pool, $0.20/hour" will i have total of 10GB space for all database in elastic pool and what is per pool and how many pools will i get in this option.
Fith:Disk Space, let us say i choose App Service "S2: 2 Cores(s), 3.5 GB RAM, 50 GB Storage, $0.200", is 50GB diskspace include OS or space allowcated to file which we upload?
I have asked too many question as i didnt had clarity from MS chat as they just passed links which can be confusing at time
Yeah, the Redis session state provider is a Nuget package, though you could possibly install it in another project and just throw the DLL in the app's bin folder. I have not tested this, so I can't know if it would actually work.
But another option for legacy apps is to keep ARR Affinity on in the App Service (if you are using them). This effectively sets a cookie on the client when they first connect so the load balancer will always connect them to the same instance, so in-memory session state works.
The problem with that is of course if the instance restarts for any reason, you lose the session state. Auto-scaling is also a bit of a problem.

Migrating ASp.net webform based websites to Microsoft Azure

I have to migrate asp.net webform & asp.net MVC websites to Microsoft Azure and most of the webform based website have been created as "website project" in visual studio. and all website use MS SQL Server 2008 R2 as database plus all website use either .net Framework 4.0/4.5.
I confused by reading article regarding migrating webform based website to Azure not working and need code changes and if we use Azure database then we cant use stored procedures etc... this has confused me alot.
So i have few question regarding this.
Can i move asp.net webform 4.0 based website directly to Azure without making any code changes assuming we are connecting to external SQL SERVER 2008.
For first step can which MS SQL Server database i need to choose on Azure so that i can easily restore database in Azure and connect to this database from my local machine using MS Management Studio..
I have heard lot about Azure store files as blob and we need to make change to code to point to new path. What is this Azure blob and why do we need to change code for pointing them blob.
What i have to do keep allowing users from uploading images & document without making any changes in the code..
Does Azure website have always 1 instance running or multiple instance running, i am asking this as our website use InProc session state will i lose session if it is ruuning on multiple instance. or should we prefer SQL Session state in Azure enviroment.
What i should take into consideration for migration current website to Azure.
Will copy pasting all the files in Azure work. Please advise
Depending on how old the ASP.NET webforms projects are, you are going to need to bring them up to date with current security, and anti forgery tokens, etc.
Also if the project was previously a "Website" and not a "Web Application", this is also something that you will need to take into consideration!
I am currently working on upgrading a website to a web application.
This might be a useful website to look through
http://www.gregthatcher.com/Azure/Ch7_ConvertWebsiteToWebApplication.aspx
Migrating to Azure is easy ,
create a Azure account and create the web app which you want to host or create.
you can deploy using FTP or use the build and deploy feature in TFS account.
Steps
You need to create web app in your account.
create a DB in azure manually or export your DB to azure from Management studio if you have an existing DB
get the Connection string from the Publish profile from Azure.
Setup the storage account if you want to store files ,images etc.

File system issue when porting an ASP.NET application to Azure

I have an existing ASP.NET website that I would like to port to Azure within my free trial.
I would like the migration to be as painless as possible. The application uses log4net and NHibernate, plus it needs to share data with an application supposed to run on a virtual server.
Two questions can be asked as 1
How do I configure paths in Web.config to access a shared drive?
I need to configure the paths into which logs will be stored and, most important, I have to specify where the application will read the files written by the daemon that will run on my Azure Linux VM.
When both the app and the daemon ran on the same server (yes, I had Mono running fine) I just had to choose a shared local directory.
I'm not sure I'm totally understanding the scenario, but I'll try to give you a few options.
One - Windows Azure Web Sites (currently in Preview) could be a great option for your ASP.NET site. Of course, it depends what needs your site has. But, you can write your log4net files with web site and using NHibernate too.
Two - Web roles work great for situations like this. You would likely have to change some code to use blob storage for persistant file storage. You could use Windows Azure drives as a way to get a persistent location for log files. Windows Azure drives don't have a pre-determined drive letter, so you'd want to use the API to get to that. That may, or may not, be a good option for your situation. With web roles you could also write the log4net files to local storage and use Windows Azure diagnostics to transfer them periodically to blob storage. Just another way to persist the files.
Three - Using Windows Azure Virtual Machines (currently in Preview) you could write the log files to a data disk, which is backed by blob storage.
In the end, if you have files you need to share across instances and/or roles, then leveraging blob storage is likely your best option.

ASP.NET Configuration on hosted (Godaddy.com)

I been developing a website with MVC3/EFCode First/C#, everything ok, I tested multiple times on my computer and all perfect.
I used ASP.NET membership to manage permissions, and the administration web that provides Visual Studio 2010 (the little button on the Solution Explorer with a Hammer and a Little World), that launch a website where i can add more users, roles, and some configurations. I used the feature that enables you to add users, to add an "admin user" to the platform that create all the other users... but i NEED this first user on my membership table (so i can log-in and create all the stuff that the website use).
The trouble that I have is that I hosted the website on Godaddy using the publish tool on Visual Studio, everything ok, I create the database and the connection strings are ok, but I don't have this "Control Panel" to add the first user...
What can I do?
You have added the structure of the database to your remote server. Now you need to add the contents of your Asp.Net membership tables to the GoDaddy copy as well.
For example, see this: http://msdn.microsoft.com/en-us/library/dd394698.aspx, and you can find
Database deployment settings for deploying to staging servers and production servers are like the settings that you entered for the Debug build configuration. The difference is that you do not want to deploy the test user accounts that you entered into the ASP.NET membership system. However, you cannot just specify Schema Only database deployment for the ASP.NET membership database. This is because one of the tables in the database contains configuration data that is required for the ASP.NET membership system. Therefore, you will create a custom script to add the configuration data.
At this location

Which database to use for C# ASP.NET website?

I am developing an online internal web portal (like users write tests, provide document links to study, completing a study roadmap, admin user to view ststistics, etc). It caters some 150 users. I have planned to use ASP .NET with c# in Visual Studio 2008 on windows xp. I am implementing using Forms and NOT MVC since I feel at home with forms.
I do not want to use windows authentication since each user will have many attributes related to him and so it will be easy using a database. Security is not an issue since it is being used internally only.
I have only a fair knowledge about ASP and C# and VS 2008.
Now my questions:
Can I use MS SQL server database that is built in in VS 2008?( I cannot ask for external databases)
Can I export the website totally along with the databases to IIS server running in some other computer? How?
Do I need to export databases separately or provide a database creation script like PHP?
(I have more questions. Will update once I start off).
(This is my first .net web app. so can i know where i can find login scripts, pagination, examples, and pretty much all the stuff)
edit: which to use? New website or New Webapplication?
You can pretty much use any database, but it seems from your requirements that you want to look closer towards something like SQLExpress, SQL Server Compact Edition or SQLLite.
Can I export the website totally along
with the databases to IIS server
running in some other computer? How?
Your database will be shipped along with your application if you use one of the database options that I have specified above.
Do I need to export databases
separately or provide a database
creation script like PHP?
See my comment above, the database will exist when you deploy your website to IIS. It's a physical file that will be in your APP_DATA folder.
You can use:
MySQL. The reason: It has no space or memory limit!
SQL Server or SQL CE. These are both alike. They just differ in slite functions, and also the storage!
The SQL CE allows you to have 4GB. But the SQL Server lets you have 10GB.
So it depends on your work!
Also, I wanted to point out one error in a post, that the SQL CE is present in App_Data, Correct! But the SQL Server is placed somewhere like:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\here_will_it_be
And yes, you can migrate it to wherever you want to place it. I mean if you want to upload it to a hosting server, you can upload it using Web Deploy! Or what ever service. When downloading you will have to repeat same process!
I hope you are doing good with your first web app! :)

Resources