Before beginning development of Asset Compute workers, ensure the project is configured with Adobe I/O and cloud storage information. This information is stored in the project’s .env
which is used only for local development, and not save in Git. The .env
file provides a convenient way to expose key/values pairs to the local Asset Compute local development environment. When deploying Asset Compute workers to Adobe I/O Runtime, the .env
file is not used, but rather a subset of values are passed in via environment variables. Other custom parameters and secrets can be stored in the .env
file as well, such as development credentials for 3rd party web services.
private.key
Open the .env
file, uncomment the ASSET_COMPUTE_PRIVATE_KEY_FILE_PATH
key, and provide the absolute path on your filesystem to the private.key
that pairs with the public certificate added to your Adobe I/O App Builder project.
config.zip
.Remember the private.key
file should not be checked into Git as it contains secrets, rather it should be stored in a safe place outside the project.
For example, on macOS this might look like:
...
ASSET_COMPUTE_PRIVATE_KEY_FILE_PATH=/Users/example-user/credentials/aem-guides-wknd-asset-compute/private.key
...
Local development of Asset Compute workers requires access to cloud storage. The cloud storage credentials used for local development are provided in the .env
file.
This tutorial prefers the use of Azure Blob Storage, however Amazon S3 and it’s corresponding keys in the .env
file can be used instead.
Uncomment and populate the following keys in the .env
file, and populate them with the values for the provisioned cloud storage found on Azure Portal.
AZURE_STORAGE_CONTAINER_NAME
keyAZURE_STORAGE_ACCOUNT
keyAZURE_STORAGE_KEY
keyFor example, this might look like (values for illustration only):
...
AZURE_STORAGE_ACCOUNT=aemguideswkndassetcomput
AZURE_STORAGE_KEY=Va9CnisgdbdsNJEJBqXDyNbYppbGbZ2V...OUNY/eExll0vwoLsPt/OvbM+B7pkUdpEe7zJhg==
AZURE_STORAGE_CONTAINER_NAME=asset-compute
...
The resultant .env
file looks as follows:
If you are NOT using Microsoft Azure Blob Storage, remove or leave these commented out (by prefixing with #
).
If you are using Amazon S3 cloud storage uncomment and populate the following keys in the .env
file.
For example, this might look like (values for illustration only):
...
S3_BUCKET=aemguideswkndassetcompute
AWS_ACCESS_KEY_ID=KKIXZLZYNLXJLV24PLO6
AWS_SECRET_ACCESS_KEY=Ba898CnisgabdsNJEJBqCYyVrYttbGbZ2...OiNYExll0vwoLsPtOv
AWS_REGION=us-east-1
...
Once the generated Asset Compute project has been configured, validate the configuration prior to making code changes to ensure the supporting services are provisioned, in the .env
files.
To start Asset Compute Development Tool for the Asset Compute project:
Open a command line in the Asset Compute project root (in VS Code this can be opened directly in the IDE via Terminal > New Terminal), and execute the command:
$ aio app run
The local Asset Compute Development Tool will open in your default Web browser at http://localhost:9000.
Watch the command line output and Web browser for error messages as Development Tool initializes.
To stop the Asset Compute Development Tool, tap Ctrl-C
in the window that executed aio app run
to terminate the process.