Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Realm Sync with Azure Functions

I'm trying to use Realm Cloud in an Azure Function but it keeps giving me an error:

make_dir() failed: Permission denied Path: /realm-object-server/

Is there a way to configure Azure Functions to have permissions to create files? I'm new to Azure Functions, this is my first one so I'm not really sure of all the particulars.

like image 485
GBreen12 Avatar asked Jun 27 '26 20:06

GBreen12


1 Answers

I have found one solution to this. Inside Azure function, you can only create any file or folder inside the temp folder. So if you use following sync configuration, it should work. It worked for me.

var configuration = new FullSyncConfiguration(new Uri("/~/<your-realm-name>", UriKind.Relative), _realmUser, Path.Combine(Path.GetTempPath(), "realm-object-server"));

So basically, here you are passing the folder name to store the realm locally. If you don't pass the folder name, it will try to store it in a default location where you will get the access error.

like image 172
Amit Shahani Avatar answered Jun 30 '26 09:06

Amit Shahani