Deploying Sitecore 9 in AWS RDS

Using RDS to host Sitecore databases can be a good option when you want to deploy Sitecore 9 in AWS. RDS is a database service so you do not need to setup and maintain VMs or SQL Server. However you might run into a few issues when trying to do so, which are related to contained database authentication.

Enabling contained database authentication

Sitecore 9 uses contained database authentication by default. This avoids needing to manage logins outside the database. However this is turned off by default in RDS and trying to enable it through SQL like below will throw an error saying you do not have permission to run the RECONFIGURE statement.

--this will not work in RDS
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO

Instead you will have to go to the database instance’s parameter group and set enable contained database authentication, see screenshot below. The instance might need to be restarted for this change to take effect.

RDS enable contained database authentication

Fix errors with SIF

The Sitecore Installation Framework might throw some errors as well because some of the Sitecore web deploy packages (.scwdp) try to enable contained database authentication through the above SQL code. This can be fixed by:

  1. renaming the package to .zip
  2. unzipping
  3. remove SQL code
  4. zip again, make sure to keep original folder structure
  5. rename to .scwdp and deploy

5 thoughts on “Deploying Sitecore 9 in AWS RDS

  1. Pingback: Fit Sitecore 9 databases in Aliyun RDS – Klauth Wang's Tech Blog

  2. Siva

    I’m trying to install sitecore 9.1. I have enabled “contained database authentication” as suggested above. When I try to install, I get the below error. My IT admin says, on RDS database mirroring will be running which we cannot turn it off. He told to find and remove that code. But I couldn’t locate the file which has those line. Any suggestion or workaround on this?

    Error count: 1.
    Error Code: ERROR_EXECUTING_METHOD
    More Information: Could not deploy package.
    Error SQL72014: .Net SqlClient Data Provider: Msg 1468, Level 16, State 2, Line 5 The operation cannot be performed on database “Baptist_Core” because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.
    Error SQL72045: Script execution error. The executed script:
    IF EXISTS (SELECT 1
    FROM [master].[dbo].[sysdatabases]
    WHERE [name] = N’$(DatabaseName)’)
    BEGIN
    ALTER DATABASE [$(DatabaseName)]
    SET RECOVERY SIMPLE
    WITH ROLLBACK IMMEDIATE;
    END
    Error SQL72014: .Net SqlClient Data Provider: Msg 5069, Level 16, State 1, Line 5 ALTER DATABASE statement failed.
    Error SQL72045: Script execution error. The executed script:
    IF EXISTS (SELECT 1
    FROM [master].[dbo].[sysdatabases]
    WHERE [name] = N’$(DatabaseName)’)
    BEGIN
    ALTER DATABASE [$(DatabaseName)]
    SET RECOVERY SIMPLE
    WITH ROLLBACK IMMEDIATE;
    END
    Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_METHOD.

    Like

Leave a comment