Configuring MongoDB App Service Application #
Overview #
Setting up a MongoDB App Service Realm Application to work with the CoSync AssetLink module can be efficiently managed through the CoSync Portal. This process is straightforward, provided the developer has obtained all the required Realm API Keys and correctly configured their Amazon S3 bucket. The essential Realm API Keys needed to set up the CoSync AssetLink module include:
- MongoDB Realm Application Id
- MongoDB Realm Project Id
- Realm project or organization Public API Key
- Realm project or organization Private API key
- MongoDB Realm Service Id
Retrieving these values is explained in the Realm API Keys section of this documentation. The more difficult key to retrieve is the MongoDB Realm Service Id.
The Amazon S3 keys that will be needed to configure the CoSync Engine AssetLink module for a MongoDB Realm Application include the following:
- AWS user access key
- AWS user secret access key
- AWS S3 bucket name
- AWS bucket region code
Configuring an Amazon S3 bucket and collecting these key values is explained in the Amazon S3 Setup section of this documentation.
The developer should first collect all these keys and store them securely. Since these keys essentially serve as programmatic passwords for the MongoDB Realm App Service Application cloud instance and the Amazon S3 account, they must be kept confidential. A recommended practice is to save them in an encrypted file on a removable key fob, and possibly also in a printout stored in a secure location.
Enter Keys from MongoDB Realm Tab #
After collecting all the keys, setting up a MongoDB Realm App Service Application for the CoSync AssetLink module is straightforward. Firstly, the developer should navigate to the MongoDB Realm tab within the application details and input the Realm App Id as illustrated below.
Next, the developer should press the button Init CoSync AssetLink and fill in the Realm API keys as shown here:
Finally, the developer should enter the Amazon S3 keys and bucket parameters as shown here:
As previously mentioned, the developer is required to supply two buckets: one for the application’s private assets and another for public assets.
The initialization process should complete in approximately 10 seconds once the developer clicks the Submit button. To confirm that the configuration was successful, the developer can visit the MongoDB App Service portal and check that the CoSync functions have been installed correctly.
The configuration process does not introduce any schema data in the MongoDB Realm App Service Application; this occurs the first time a client connects to the MongoDB Realm App Service Application. Additionally, there may be a latency of several minutes the first time a client writes to a MongoDB Realm App Service Application. This is not the first time for each client, just the first time that assets are uploaded to Amazon S3.
This is not a defect; it is a part of the initialization procedure between MongoDB Realm and the backend Atlas Cluster to which it connects. This delay is only experienced on the initial write and may be unsettling for the developer.