I have some powershell to create a farm including the secure store service. The code is pretty straight forward:
Update-SPSecureStoreMasterKey -ServiceApplicationProxy $id -Passphrase $passphrase
I dont get any errors but when I then try to create an application server key, thus:
Update-SPSecureStoreApplicationServerKey -ServiceApplicationProxy $id -Passphrase $passphrase
it fails and tells me the master key is not found:
Update-SPSecureStoreApplicationServerKey : Master secret key is not present in the database.
The thing is, this doesnt always fail. It's seems rather unreliable.
Anyone got a workaround or any clever ideas?