Umbraco 13 on Azure VM using Key Vault problems (plus hangfire issues)

I’ve got a rather frustrating issue where i’m setting up an Umbraco 13 site on an Azure VM. This was previously hosting on an Azure Web App, and was using the environment variables functionality rather than key vault.

Now it’s in a VM, we’re using Key Vault for all the appSettings info, including the connection strings. I’ve followed this guide - https://docs.umbraco.com/umbraco-cms/13.latest/extending/key-vault. It does mention there that the connection string value can be found at Umbraco:CMS:ConnectionStrings which isn’t actually correct. I have tried it though.

I have confirmed that the VM can access the Key Vault values so I know the managed identity stuff is all configured correctly.

I’ve tried using both ConnectionStrings--umbracoDbDSN and Umbraco--CMS--ConnectionStrings--umbracoDbDSN and it both instancea the website on the VM just loads the install screen.

Has anyone had issues getting Azure Key Vault working with Umbraco 13 on and Azure VM.


I have also sometimes seem some errors relating to Cultiv Hangfire where it can initialise a static RecurringJob method. I’m not sure if this is related to Hangfire trying to initialised before key vault has been able to get the connection string, although i’m guessing a bit here as it could simple be due to the connection string issues in general.

Aren’t Azure keys written with underscores instead of dashes?

Not when using Key Vault :slight_smile:

I have just located my issue though, and it’s related. As I just copied everything I had from the Web App version settings, I also included the umbracoDbDSN_ProviderName setting we had in there.

Key Vault doesn’t allow underscores, for secret names, (hence the use of the dashes instead of underscores). It appears it won’t automatically map a single dash to an underscore too. This results in the following:

Using ConnectionStrings--umbracoDbDSN-ProviderName in the aim to replicate ConnectionStrings:umbracoDbDSN_ProviderName doesn’t work. Because this doesn’t get mapped, it doesn’t get picked up by the website, so Umbraco can’t see the value and sees the DB set up as incomplete, resulting in the install screen.

I ended up just moving move this value to the actual appSettings.json in the repo file as this value will always be the same on the VM.

This also fixed the Hangfire issues.

2 Likes