API key or secret not set in configuration
# help-with-umbraco
t
Hello! I just cloned a brand new Umbraco Cloud project with Umbraco.Cloud.Cms 15.1.1 and Umbraco.Cms 15.2.1. When trying to run the project in Visual Studio I get the following error: Microsoft.Extensions.Options.OptionsValidationException: 'API key or secret not set in configuration.' I can't find any information about setting an api key in the documentation. I should be able to run my website immediately. Does anyone know why this error occurs?
s
You should be able to, this is not an error I've seen before, where do you see this error? Does
dotnet run
on the command line work? I've just created a new Cloud site yesterday and it worked locally as expected, so this is surprising!
t
I get the error when running
Copy code
dotnet run
s
where do you see this error?
t
Yes, it has worked for me before when I tried 2 months ago
s
I see, let me have a look at this trace
t
I also have the same error on my old instance suddenly (the one I crated 2 months ago on earlier versions). So I guess it could be some local issues on my machine
But I've also seen the error on a cloud environment
s
Do you have an Deploy section in your appsettings with an
ApiKey
configured? that's what it seems to be complaining about
sorry that should be in
umbraco-cloud.json
t
In umbraco-cloud.json I have my three workspaces Development, Staging, Live with guids for each one. Also an Identity part with ClientId and ClientSecret
Ah, the first one is the deploy-part. That looks correct
If that ApiKey is missing there then you will need to contact support, I have no idea how to get it there! 😅
t
Hmm, okay! So I should be able to see my Umbraco CI/CD api key there?
I just activated this button:
Maybe I cloned too fast
s
I didn't enable the CI/CD flow on my test project, so I think the ApiKey should "just" always be there.. not sure what it's used for but I assumed it is for Deploy as it is in
Deploy > Settings > ApiKey
t
Yes, I think you are right. Now I tried to add my key manually and it started to work. I guess something is odd in my setup. I will contact the support 😄 Thank you so much for your quick help. Didn't realize Umbraco had a discord until now
s
No worries. I think it's strange that you didn't get this added automatically.. and on your old project as well, sounds very strange!
t
My old project was actually myself removing the ApiKey to point to a new instance. I can see now that I had a key from the beginning. So it's only the new one that didn't get one from start.
s
ah okay, that's your own fault then haha! but very strange you didn't get it indeed.. anything to find in the git history for that file?
4 Views