Deploying Campaign Microserviceon Azure
This section explains how to deploy the Campaign Microservice on the Azure cloud. To do so, you need to perform the following tasks:
Deployment Artefacts
Pre-requisites
Before deploying Campaign Microservice on Azure ensure you have the following:
-
Install the Azure Command Line Interface.
To install the Azure Command Line Interface, follow these steps.
- Download and install AZURE CLI from here.
- After the successful installation, sign in to the Azure portal from CLI by using the az login -u <username> -p <password> CLI command.
- Install Maven.
- Install Python.
- An active connection of MySQL is required
For MySQL
The folder structure of the Campaign Microservice is available as a single release bundle. For example, ms-campaign-package-azure-<release_number>.zip.
This bundle contains the following files:
- ms-campaign-package-azure-<release_number>.jar
-
Azure Script files:
- install.sh/install.bat: This script is used to deploy the Campaign Microservice in the Azure environment.
- destroy.sh/destroy.bat: This script is used to stop and delete the Azure services from the Azure environment.
- Folder structure for the ms-campaign-package-azure-<release_number>.zip file is as follows.


- The Pom-azure-deploy.xml file is used to deploy the Azure function into the Azure portal.

Installing Campaign Microservice on Azure
To deploy Campaign Microservice on Azure, follow these steps.
- Copy the generated zip file (from target folder) to the installation directory.
- Extract the zip file.
- In a command prompt, go to the installation directory and modify the details such as resource group, location, DB details, etc., in the install.sh/install.bat script specific to the installation.
- The default Azure function app name in the script can be changed. In case of app name changes, the folder available (ms-campaign-api\target\azure-functions\<app folder>\) in the name of the app must also be renamed.
- To enable the in-house authentication in addition to the API key, perform the JWT Authentication in the installation scripts.
- After this, execute either install.sh or install.bat.
After successful installation, these Azure functions are created.
- To load the master data, retrieve the DDL scripts from the installation directory named \campaign-Azure\db\mysql\ddl_scripts.Connect to MySQL workbench and create a schema with the name campaign and run the script. If not found, retrieve the scripts from the AWS package.
- Sign in to the Azure portal and verify if the Resource Group and the Function App are created.
- Function App

- Campaign Functions

- Function App
- 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.

- 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.
Alternatively, the master key token can also be retrieved from the Apps Keys section of the Azure portal.
The masterKeyToken value can be used to Invoke Azure API functions from API Client with code(query param) or x-functions-key(header).
- After the successful deployment, database, collections, and reference data(master data) are loaded into the MySQL database for the Campaign microservice.
For MSSQL
The folder structure of the Campaign Microservice is available as a single release bundle. For example, ms-campaign-package-azure-<release_number>.zip.
This bundle contains the following files:
- ms-campaign-package-azure-<release_number>.jar
-
Azure Script files:
- install_mssql.sh/install_mssql.bat: This script is used to deploy the Campaign Microservice in the Azure environment.
- destroy.sh/destroy.bat: This script is used to stop and delete the Azure services from the Azure environment.
- Folder structure for the ms-campaign-package-azure-<release_number>.zip file is as follows.


- The Pom-azure-deploy.xml file is used to deploy the Azure function into the Azure portal.

Installing Campaign Microservice on Azure
To deploy Campaign Microservice on Azure, follow these steps.
- Copy the generated zip file (from target folder) to the installation directory.
- Extract the zip file.
- In a command prompt, go to the installation directory and modify the details such as resource group, location, DB details, etc., in the install_mssql.sh/install_mssql.bat script specific to the installation.
- The default Azure function app name in the script can be changed. In case of app name changes, the folder available (ms-campaign-api\target\azure-functions\<app folder>\) in the name of the app must also be renamed.
- To enable the in-house authentication in addition to the API key, perform the JWT Authentication in the installation scripts.
- After this, execute either install_mssql.sh or install_mssql.bat.
This creates Azure functions, and also loads master data after the installation.
- Sign in to the Azure portal and verify if the Resource Group and the Function App are created.
- Function App

- Campaign Functions

- Function App
- 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.

- 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.
Alternatively, the master key token can also be retrieved from the Apps Keys section of the Azure portal.
The masterKeyToken value can be used to Invoke Azure API functions from API Client with code(query param) or x-functions-key(header).
- After the successful deployment, database, collections, and reference data(master data) are loaded into the MSSQL server for the Campaign Microservice.
In this topic