1

We are currently hosting our Sitecore 9.1 initial release on premises, but want to move the complete solution into Azure. We want to use public services and not put our solution in an ASE. To secure our database as much as possible we want to use SQL connection with managed identity as described in this blog post. https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi

Does anybody know if this is possible with Sitecore? Most important is to secure the xDB databases (shards).

2

No, this is with t he current version, 9.1 and below, not possible. There is piece of code required to get an accesstoken, which is not available within Sitecore. You will have to come up with another solution. We worked with the new public vNets on the app Services and firewall rules increase access security for these databases.

The actual code that is needed:

public MyDatabaseContext(SqlConnection conn) : base(conn, true)
{
    conn.ConnectionString = WebConfigurationManager.ConnectionStrings["MyDbConnection"].ConnectionString;
    // DataSource != LocalDB means app is running in Azure with the SQLDB connection string you configured
    if(conn.DataSource != "(localdb)\\MSSQLLocalDB")
        --> conn.AccessToken = (new AzureServiceTokenProvider()).GetAccessTokenAsync("https://database.windows.net/").Result; <--

    Database.SetInitializer<MyDatabaseContext>(null);
}
  • Do you think of the new App Service VNet Integration that enables access across Service endpoints? The problem is that it is still in preview. – Runar Hannevold Mar 13 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.