Installing Marketing Catalog Microservices in Azure
This section helps you to install the Marketing Catalog Microservice into Azure cloud.
- Obtain the MONGODB_CONNECT_STR string for Java driver version 3.4.
- Download the Mongo Shell from the Mongo Atlas under the connect with mongo shell tab by clicking the connect button.
- Obtain the MONGOSHELL_CONNECT_STR string under the connect with MongoDB Compass tab by clicking the connect button.
Procedure:
- Download the zip file.
- Extract the zip file.
- In a command prompt, navigate to the installation directory and modify the details such as resource group, location, MONGODB_CONNECT_STR, MONGOSHELL_CONNECT_STR, etc., in the install.sh or install.bat script specific to the installation.
- Default mongo.js file (Master Data) is inserted into the MongoDB through the install.bat/.sh file. You can insert data other than master data using the following steps:
- Pre-requisite data can be loaded into Mongo DB through install-db-scripts.bat/.sh script file.
- Data can be loaded only through script files (.js).
- All the files need to be placed under folder path “ms-party-azure\target\azure-functions\<app folder>”.
- The following are the required parameters while executing the bat file.
Parameter Description uri
Need to provide Mongo string URL with username & password mentioned in the pre-requisite section
app_name
Need to provide the app name which mentioned while deploying azure
scripts
Need to provide the files names delimited by comma
- Command to execute :
- For .bat file :
install-db-scripts.bat --uri <uri> --app_name <app_name> --scripts "<filename1>,<filename2>"
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>"
EXAMPLE:install-db-scripts.sh --uri mongodb+srv://test:test@cluster0.4o1ua.azure.mongodb.net --app_name partyapp --scripts mongo1.js,mongo2.js
- For .bat file :
- Perform the JWT authentication in the installation scripts to enable the in-house authentication in addition to API key.
- Execute deployment script to create the resources in Azure.
Script Description install.sh / install.bat To deploy all the necessary components for a microservice including streaming services, in order to run the microservice independently. install-ms.sh / install-ms.bat To deploy only the components necessary for microservice. Data Event Streaming (DES) is presumed to be deployed and running already. The streaming services are not deployed. Once the installation completes, all the functions are created in Azure.
- Log in to Azure portal and check if the following have been created.
You can retrieve the API key for each endpoint in the function app using the command below.
func azure functionapp list-functions <function-app-name> --show-keys
You can also retrieve the API key using the Azure function GUI as shown below.
You can retrieve the endpoints of the azure function app from the Azure Function App. Below is the URL of sample function app.
The Get Function URL provides the complete URL with API key.
After the successful deployment database, collections and the reference data (master data) are loaded into the mongo database for Marketing Catalog microservice.
The default Azure function app name in the script can be changed. In case of app name changes, the folder available (ms-marketingcatalog-azure\target\azure-functions\<app folder>\) in the name of the app should also be renamed.
Post Installation Steps
You should set the environmental variables in the Azure Function app > Configuration > Application Settings as below.
|
Environment Variable |
Description |
Example |
|---|---|---|
|
temn_msf_stream_kafka_bootstrap_servers |
Event Hub host name with port as 9093 |
marketingcatalogkafkaapp.servicebus.windows.net:9093 |
|
eventHubConnection |
Event hub connection string. Obtain the connection string from shared access policies -> connection string - primary key |
Endpoint=sb://marketingcatalogkafkaapp.servicebus.windows.net/; SharedAccessKeyName=RootManageSharedAccessKey; SharedAccessKey=W15p/NGRC7vpwK/0ESYiTUSOSB5UMtFNItSRYQYZ08o= |
|
temn_msf_stream_kafka_sasl_enabled |
SASL Security should be enabled by setting this property to true. |
true |
|
eventHubName |
Event hub namespace |
marketingcatalogkafkaapp |
|
temn_msf_ingest_source_stream |
Source topic used for ingestion |
table-update |
|
temn_msf_ingest_sink_error_stream |
Topic for error stream |
error |
|
temn_msf_stream_kafka_sasl_jaas_config |
sasl security jass configuration string org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="<eventhub-connection-string>"; |
org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password=" Endpoint=sb://marketingcatalogkafkaapp.servicebus.windows.net/; SharedAccessKeyName=RootManageSharedAccessKey; SharedAccessKey=W15p/NGRC7vpwK/0ESYiTUSOSB5UMtFNItSRYQYZ08o= "; |
Independent of the deployment mode, the following configurations should be carried out in Azure Function app > Configuration > Application Settings as described in the table below
|
Environment Variable |
Description |
Example |
|---|---|---|
|
temn_msf_schema_registry_url |
URL of the schema registry |
http://localhost:8081 |
|
HTTP_BASE_PATH |
Base path of the IRF provider container |
http://<IP>:<PORT>/irf-provider-container/api/v1.0.0/ |
|
HTTP_RESOURCE_PATH |
Resource path of IRIS API used by marketing catalog microservice is product/{productId}/productConditions |
product/{productId}/productConditions |
In this topic