Skip to content

Latest commit

 

History

History
149 lines (122 loc) · 11.8 KB

ircatalog.md

File metadata and controls

149 lines (122 loc) · 11.8 KB

irCatalog®

irCatalog® is a business rule management tool that provides centralized management of rules to ensure the integrity of business rules, keep everyone working on the latest version of rules, and promote sharing of common rules across customers, processes or applications.

If you have not done so already, please read the prerequisites before you get started.

Database Deployment

irCatalog supports both Microsoft® SQL Server (which includes Microsoft® Azure® SQL Databases) and Oracle Database. This section explains how to provision a new Microsoft® Azure® SQL Database for irCatalog. If you have an existing database, you may skip to the the Web App Deployment section.

Sign in to Microsoft® Azure®

First, open a PowerShell prompt and use the Azure CLI to sign in to your Microsoft® Azure® subscription:

az login

Set active subscription

If your Microsoft® Azure® account has access to multiple subscriptions, you will need to set your active subscription to where you create your Azure resources:

# Example: az account set --subscription "Contoso Subscription 1"
az account set --subscription SUBSCRIPTION_NAME

Create resource group

Create the resource group (one resource group per environment is typical) that will contain the InRule-related Azure resources with the az group create command:

# Example: az group create --name inrule-prod-rg --location eastus
az group create --name RESOURCE_GROUP_NAME --location LOCATION

Create Database Server

Create the Azure SQL Server with the az sql server create command:

# Example: az sql server create --name contoso-catalog-prod-sql --resource-group inrule-prod-rg --location eastus --admin-user admin --admin-password %14TVpB*g$4b
az sql server create --name SERVER_NAME --resource-group RESOURCE_GROUP_NAME --location LOCATION --admin-user ADMIN_USER_NAME --admin-password ADMIN_USER_PASSWORD

Create Database

Create the Azure SQL Server Database with the az sql db create command:

# Example: az sql db create --name catalog-prod-db --server contoso-catalog-prod-sql --resource-group inrule-prod-rg
az sql db create --name DATABASE_NAME --server SERVER_NAME --resource-group RESOURCE_GROUP_NAME

Allow irCatalog Server Access via Firewall Rule

In order to allow the irCatalog Server access to the database, a firewall rule must be added to allow Azure services access to the Azure SQL Server.

Create a rule in the firewall to allow you to access the newly created database with the az sql server firewall-rule create command:

# Example: az sql server firewall-rule create --name AllowAllWindowsAzureIps --server contoso-catalog-prod-sql --resource-group inrule-prod-rg --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
az sql server firewall-rule create --name AllowAllWindowsAzureIps --server SERVER_NAME --resource-group RESOURCE_GROUP_NAME --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0

Allow Your Local Machine Access via Firewall Rule

In order to run the catalog database install/upgrade application, a firewall rule must be added to allow your local machine access to the Azure SQL Server. One way to find your external IP address would be to use Google.

Create a rule in the firewall to allow you to access the newly created database with the az sql server firewall-rule create command:

# Example: az sql server firewall-rule create --name myLocalMachine --server contoso-catalog-prod-sql --resource-group inrule-prod-rg --start-ip-address 1.2.3.4 --end-ip-address 1.2.3.4
az sql server firewall-rule create --name FIREWALL_RULE_NAME --server SERVER_NAME --resource-group RESOURCE_GROUP_NAME --start-ip-address MY_EXTERNAL_IP --end-ip-address MY_EXTERNAL_IP

Deploy the irCatalog Database

First, download the latest irCatalog Database package (InRule.Catalog.Service.Database.zip) from GitHub, and unzip into a directory of your choosing.

Update the appsettings.json found in the newly unzipped directory with the connection string for your database. Be sure to set a valid user name and password. You can retrieve the connection string with the az sql db show-connection-string command:

# Example: az sql db show-connection-string --server contoso-catalog-prod-sql --name catalog-prod-db --client ado.net
az sql db show-connection-string --server SERVER_NAME --name DATABASE_NAME --client ado.net

Then run the included executable to deploy the initial irCatalog database schema:

.\InRule.Catalog.Service.Database.exe

(Optional) Remove Local Machine Firewall Rule

While not required, the local machine firewall rule that was added earlier may be removed with the az sql server firewall-rule delete command:

# Example: az sql server firewall-rule delete --name myLocalMachine --server contoso-catalog-prod-sql --resource-group inrule-prod-rg
az sql server firewall-rule delete --name FIREWALL_RULE_NAME --server SERVER_NAME --resource-group RESOURCE_GROUP_NAME

Web App Deployment

Sign in to Azure

First, open a PowerShell prompt and use the Azure CLI to sign in to your Azure subscription:

az login

Set active subscription

If your Azure account has access to multiple subscriptions, you will need to set your active subscription to where you create your Azure resources:

# Example: az account set --subscription "Contoso Subscription 1"
az account set --subscription SUBSCRIPTION_NAME

Create resource group

Create the resource group (one resource group per environment is typical) that will contain the InRule-related Azure resources with the az group create command:

# Example: az group create --name inrule-prod-rg --location eastus
az group create --name RESOURCE_GROUP_NAME --location LOCATION

Create App Service plan

Create the App Service plan that will host the InRule-related web apps with the az appservice plan create command:

# Example: az appservice plan create --name inrule-prod-sp --resource-group inrule-prod-rg --location eastus
az appservice plan create --name APP_SERVICE_PLAN_NAME --resource-group RESOURCE_GROUP_NAME --location LOCATION

Create Web App

Create the Azure App Service Web App for the Catalog Service with the az webapp create command:

# Example: az webapp create --name contoso-catalog-prod-wa --plan inrule-prod-sp --resource-group inrule-prod-rg
az webapp create --name WEB_APP_NAME --plan APP_SERVICE_PLAN_NAME --resource-group RESOURCE_GROUP_NAME

Deploy package

First, download the latest irCatalog package (InRule.Catalog.Service.zip) from GitHub. Then deploy the zip file package to the Web App with the az webapp deployment source command:

# Example: az webapp deployment source config-zip --name contoso-catalog-prod-wa --resource-group inrule-prod-rg --src InRule.Catalog.Service.zip
az webapp deployment source config-zip --name WEB_APP_NAME --resource-group RESOURCE_GROUP_NAME --src FILE_PATH

Upload valid license file

In order for irCatalog Service to properly function, a valid license file must be uploaded to the web app. The simplest way to upload the license file is via FTP.

First, retrieve the FTP deployment profile (url and credentials) with the az webapp deployment list-publishing-profiles command and put the values into a variable:

# Example: az webapp deployment list-publishing-profiles --name contoso-catalog-prod-wa --resource-group inrule-prod-rg --query "[?contains(publishMethod, 'FTP')].{publishUrl:publishUrl,userName:userName,userPWD:userPWD}[0]" | ConvertFrom-Json -OutVariable creds | Out-Null
az webapp deployment list-publishing-profiles --name WEB_APP_NAME --resource-group RESOURCE_GROUP_NAME --query "[?contains(publishMethod, 'FTP')].{publishUrl:publishUrl,userName:userName,userPWD:userPWD}[0]" | ConvertFrom-Json -OutVariable creds | Out-Null

Then, upload the license file using those retrieved values:

# Example: $client = New-Object System.Net.WebClient;$client.Credentials = New-Object System.Net.NetworkCredential($creds.userName,$creds.userPWD);$uri = New-Object System.Uri($creds.publishUrl + "/InRuleLicense.xml");$client.UploadFile($uri, "$pwd\InRuleLicense.xml");
$client = New-Object System.Net.WebClient;$client.Credentials = New-Object System.Net.NetworkCredential($creds.userName,$creds.userPWD);$uri = New-Object System.Uri($creds.publishUrl + "/InRuleLicense.xml");$client.UploadFile($uri, "LICENSE_FILE_ABSOLUTE_PATH")

Change the connection string

The irCatalog application now needs to be configured to point to your irCatalog database.

# Example: az webapp config appsettings set --name contoso-catalog-prod-wa --resource-group inrule-prod-rg --settings inrule:repository:service:connectionString="Server=tcp:contoso-catalog-prod-sql.database.windows.net,1433;Initial Catalog=catalog-prod-db;Persist Security Info=False;User ID=admin;Password=%14TVpB*g$4b;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30";
az webapp config appsettings set --name WEB_APP_NAME --resource-group RESOURCE_GROUP_NAME --settings inrule:repository:service:connectionString="Server=tcp:SERVER_NAME.database.windows.net,1433;Initial Catalog=DATABASE_NAME;Persist Security Info=False;User ID=USER_NAME;Password=USER_PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30";

Verify using irAuthor®

Using irAuthor you should now be able to connect to your catalog using the url https://WEB_APP_NAME.azurewebsites.net/service.svc.