Testing Cloud Hot Folders in a Local Environment

Set up a local development environment to test that Cloud Hot Folders are functioning correctly.

Prerequisites

  • You have an integrated development environment, such as Visual Studio Code or IntelliJ IDEA.
  • You installed Microsoft Azure Storage Explorer. For more information, see https://azure.microsoft.com/en-gb/features/storage-explorer/Information published on non-SAP site.
  • You have a container orchestration system for running applications, such as Docker Desktop, which runs a local Blob store.
  • You have a lightweight server clone of Azure Blob storage, such as Azurite, running in a Docker container as local storage and you ran the following command from a command line.
    docker pull mcr.microsoft.com/azure-storage/azurite
    To learn more, see Azurite by MicrosoftInformation published on non-SAP site.

Procedure

  1. Add the following three extensions to your config/localextensions.xml file.
    • azurecloudhotfolder
    • cloudcommons
    • cloudhotfolder
  2. Start Docker Desktop.
  3. From the command line, run the command to create an Azurite container.
    docker run -p 10000:10000 -p 10001:10001 mcr.microsoft.com/azure-storage/azurite
  4. In the config/local.properties file, create the following two properties:
    Property Value
    cluster.node.groups integration,yHotfolderCandidate
    azure.hotfolder.storage.account.connection-string The entry is a string made up of several parts that are separated by semicolons.
    • DefaultEndpointsProtocol=http
    • AccountName=<any_account_name>
    • AccountKey=<any base64 encoded string>
    • BlobEndpoint=http://<localhost>:11000/$<account_name> where the port is the published IP port of the Azure Blob storage emulator that runs against Docker port 10000.

    Example

    DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1
  5. Install and run Microsoft Storage Explorer.
  6. Find the container in the Microsoft Storage Explorer and use the connection string and primary key to connect to the emulated Blob.

    When you highlight the container name, a Properties tab along the bottom of the page contains the primary key and connection string.

  7. Build and run your local SAP Commerce Cloud installation.

    Once SAP Commerce Cloud starts with the new extensions and properties, it creates a Blob container in Azurite.

  8. Run a system update to update the Type System definitions in the database for Cloud Hot Folders.
    1. Open Administration Console.
    2. Navigate to Start of the navigation pathPlatform Next navigation step UpdateEnd of the navigation path.
    3. Select the following extensions.
      • azurecloud
      • cloudcommons
      • cloudhotfolder
      • azurecloudhotfolder
    4. Click Update.
  9. In Microsoft Storage Explorer, find the hybris container in your Blob storage account.
  10. Create a test file with the name test.csv.

    You can copy cloudhotfolder/resources/cloudhotfolder/test/hotfolder/product-00.csv and rename it to test.csv.

  11. Upload the test file to the hybris container and put it in a folder with the name master/hotfolder.
    1. Create the directory master/hotfolder in the hybris container in Microsoft Azure Storage Explorer.
    2. Upload the test.csv file to master/hotfolder.

Results

In the Azurite console, the file is copied to the processing folder and then to the archive folder. If the impex import was unsuccessful, then the file is copied in the error folder. A confirmation message displays in the terminal and includes a list of the processing steps.

You’re now ready to upload files to Cloud Hot Folders (hybris/master/hotfolder).