Deploying Party Microservice on Azure

This section explains how to deploy the Party microservice on the Azure cloud. To do so, you need to perform the following tasks:

Deployment Artefacts

The folder structure of the Party microservice is available as a single release bundle. For example, ms-party-package-azure-<release_number>.zip.

This bundle contains the following files:

  • ms-party-package-azure-<release_number>.jar
  • Azure Script files:

    • install.sh/install.bat: This script is used to deploy the Party microservice in the Standalone mode.
    • destroy.sh/destroy.bat: This script is used to undeploy the microservice and delete the Azure services from the Azure environment.
  • Folder structure for the ms-party-package-azure-<release_number>.zip file is as follows.

    Pom-azure-deploy.xml file deploys the Azure function on the Azure portal.

Deploying Party Microservice on Azure

Prerequisites

Before deploying Party microservice on Azure ensure you have the following:

  • Install the Azure Command Line Interface. For more information about the installation, click here.
  • Install Maven.
  • Install Mongo Shell.

    Download the Mongo Shell from Mongo Atlas under the tab named Connect with Mongo Shell by clicking Connect.

  • An active connection string of Mongo Atlas cluster. The Mongo Atlas Cluster must be acquired for Java driver version 3.4.
NOTE:
  • MONGODB_CONNECT_STR string must be obtained for Java driver version 3.4.
  • Download the mongo shell from the Mongo Atlas under the Connect with mongo shell tab by clicking Connect.
  • MONGOSHELL_CONNECT_STR string must be obtained under the Connect with MongoDB Compass by clicking Connect.

To deploy Party microservice on Azure, follow these steps.

  1. Download the generated zip file from the target folder into the installation directory.
  2. Extract the zip file.
  3. In Command Prompt, go to the installation directory.
  4. Modify the installation-specific details such as Resource Group, Location, MONGODB_CONNECT_STR, and MONGOSHELL_CONNECT_STR in the install.sh/install.bat script.

    For example,

    • SET MONGODB_CONNECT_STR="mongodb://Temenos:Temenos123@cluster0-shard-00-02.4o1ua.azure.mongodb.net:27017,cluster0-shard-00-00.4o1ua.azure.mongodb.net:27017,cluster0-shard-00-01.4o1ua.azure.mongodb.net:27017/ms_party?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-vj913p-shard-0&ssl=true"
    • SET MONGOSHELL_CONNECT_STR="mongodb+srv://Temenos:Temenos123@cluster0.4o1ua.azure.mongodb.net"
  5. The default mongo.js file (master data) is inserted into the MongoDB through install.bat.shfile. To insert the data other than the master data, do the following:
    1. Load the prerequisite data into Mongo DB through the install-db-scripts.bat/.sh script file. The data can be loaded only through the script files(.js).
    2. Place all the files under the folder path, ms-party-azure\target\azure-functions\<app folder.
    3. Send the following parameters while executing the bat file:
      uri Provide the Mongo string URL along with username and password that are mentioned in the Prerequisite section.
      app_name Provide the app name that is mentioned during the Azure deployment.
      scriptsProvide the files names delimited by comma.
    4. Execute the following commands:
      • For .bat file,
        • install-db-scripts.bat --uri <uri> --app_name <app_name> --scripts "<filename1>,<filename2>"

          For example, install-db-scripts.bat --uri --mongodb+srv://test:test@cluster0.4o1ua.azure.mongodb.net --app_name partyapp --scripts "mongo1.js,mongo2.js".

      • For .sh file,
        • install-db-scripts.sh --uri <uri> --app_name <app_name> --scripts "<filename1>,<filename2>"

          For example, install-db-scripts.sh --uri mongodb+srv://test:test@cluster0.4o1ua.azure.mongodb.net --app_name partyapp --scripts mongo1.js,mongo2.js.

  6. The default Azure function app name in the script can be changed. In case of app name changes, the folder available (ms-party-azure\target\azure-functions\<app folder>\) in the name of the app must also be renamed.
  7. To enable the in-house authentication in addition to the API key, perform the JWT Authentication in the installation scripts.
  8. After this, execute either install.sh or install.bat.
    ScriptDescription
    install.sh/install.bat To deploy the necessary components for a microservice including streaming services will be deployed, in order to run the microservice independently.

    After successful installation, these Azure functions are created.

  9. Sign in to the Azure portal and verify if the Resource Group and the Function App are created.

    Resource Group

    Function App

    Party Functions

  10. Obtain the API key for each endpoint by using the func azure functionapp list-functions <function-app-name> --show-keys command. Alternatively, you can also obtain the API key from the Azure function GUI.

  11. Obtain the endpoints of the Azure Function App from the Azure Function App. The URL of the sample function app is as follows:

    The Get Function URL provides the complete URL along with the API key.

  12. After the successful deployment, database, collections, and reference data(master data) are loaded into the mongo server database for the Party microservice.

Copyright © 2020- Temenos Headquarters SA

Published on :
Tuesday, October 5, 2021 11:13:15 AM IST

Feedback
x