Install on Microsoft Azure

Install on Microsoft Azure
lac52
You can install 
Layer7 Live API Creator
 to run as a cloud-based service on Microsoft Azure.
In this article:
 
 
Verify the Prerequisites
Before you install 
Layer7 Live API Creator
 on Microsoft Azure, ensure that you have completed the following prerequisite steps:
  • You have an Azure account and you are logged in to the Azure Portal.
    Create a free Azure account. For more information, see the Azure site.
  • You know which license type you are using 
    Layer7 Live API Creator
     under, either a standard license that the CA Support site issues or an Enterprise Software Portfolio License Agreement (PLA).
    For more information about licensing, see Licensing.
  • You have reviewed the installation best practices.
    For more information, see Installation Best Practices.
Create a Resource
  1. In the Azure Portal, create an Azure app service (web app), search for 
    Apache Tomcat 8
     , and then create the resource.
    Your web app and resource is created.
  2. Configure your web app. Complete the following steps:
    1. In the Azure Portal, open the blade for the web app.
    2. Click 
      Application settings
      , and then the 
      General settings
       category.
      For more information about the application settings, see the Microsoft Azure documentation.
    3. Complete the following, and then click 
      Save
      :
      • For the 
        Framework versions
         options, select 
        Java Version 8
         as the Java version.
      • For the 
        Web Container
         option, select 
        Newest Tomcat 8.0
        , as the web container.
    Your web app is configured.
Install on Azure
You can install the web application ARchive (WAR) file to Azure using several methods. The following method uses FTP, but you can also use GitHub and other mechanisms.
For more information about the others methods to installing WAR files, see the Microsoft Azure documentation.
Follow these steps:
 
  1. Connect to your resource using FTP. The FTP address and connection information is under 
    Properties
    .
    Use a free FTP solution. For more information, see the FileZilla site.
  2. Upload the 
    CAliveAPICreator.war
     file to your site using FTP or GitHub.
  3. Copy the WAR file to the 
    ${CATALINA_HOME}/webapps
     directory.
  4. (If you want 
    Layer7 Live API Creator
     to be at the root URL) Rename the 
    CAliveAPICreator.war
     file to 
    ${CATALINA_HOME}/webapps/ROOT.war
    .
  5. Upload the JAR files for the JDBC drivers that correspond to the database management system (DBMS) that you you plan to connect to by completing one of the following:
    1. Navigate to the 
      ${CATALINA_HOME}/lib
       directory under your 
      ROOT
       directory.
    2. Add the JAR files to the 
      ROOT.war
       file by issuing the following command:
      mkdir WEB-INF\lib
      cp nameofmyjdbc.jar WEB-INF\lib\.
      jar ufv MYWARFILE.war WEB-INF\lib\nameofmyjdbc.jar
  6. Modify the log file so that it points to the correct location by completing the following:
    1. Open the 
      WEB-INF\classes\logging.properties
       file, modify the file directory to point to 
      org.apache.juli.FileHandler.directory = d:\home\LogFiles
      , and then save and close the file. The following code snippet shows an example:
      handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
      ############################################################
      # Tomcat
      ############################################################
      org.apache.juli.FileHandler.level = DEBUG
      org.apache.juli.FileHandler.directory = D:/home/site/wwwroot/homeLogFiles
      org.apache.juli.FileHandler.prefix = CAliveAPICreator.
      java.util.logging.ConsoleHandler.level = DEBUG
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
      ############################################################
      # Jersey
      ############################################################
      com.sun.jersey-level = DEBUG
      For more information on using external logging see External Logging 
    2. Enter the following command:
      mkdir WEB-INF\classes
      cp logging.properties WEB-INF\classes\.
      jar uvf ROOT.war WEB-INF\classes\logging.properties
Installing the WAR file can take five or more minutes.
You have installed on Azure.
Test your Service
Test your new service by logging in to API Creator.
Follow these steps:
 
  1. In Azure, click the URL or Browser icon.The API Creator landing page opens.
  2. Click the API Creator link.The Logon window opens. The following is an example of the full URL:
    http://<mydomain>.azurewebsites.net/APICreator/index.html
    API Server configures the admin repository the first time.
    For more information about the admin repository, see View your API Definition.
You are logged in to API Creator.
View the Log Files and Debug
  1. In API Creator, create a sample API and create REST API endpoints by connecting to your existing SQL database.
    For more information about how to create an API, see Creating APIs.
  2. View the log files. Using the Console or remote debugging with Visual Studio, the DEBUG Logs ( 
    catalina.out
     and 
    CAliveAPICreator.MMDDYY.log
     ) are located in the 
    D:/home/site/wwwroot/homeLogFiles
     directory.
  3. (Optional) In Microsoft Azure Portal, enable diagnostic logging, auto-scale, and add extensions. From the Settings page, click 
    Diagnostic logs
     and complete the following:
     
    Application Logging (Filesystem)
     
    Set to On. 
     
    Level
     
    Choose 
    Verbose
     .
     
    Web server logging
     
    Set to On. 
     
    Detailed error messages
     
    Set to On.
    The following image shows the Logs page for the Web app:
    DiagnosticLogs.PNG  
  4. View the Streaming logs under tools/Console Log. The following image shows the Streaming logs for the Web app: 
You have logged and debugged your installation.
Advanced Configuration
The following topic provides advanced configuration details.
Create a Database for your Authentication Tokens
Your 
Layer7 Live API Creator
 configuration requires that you create a database for your authentication tokens if:
  • You have specified an authentication provider that uses the 
    Default Auth Provider
     authentication method (for example, the 
    built-in authentication
     authentication provider) or the 
    JavaScript Auth Provider
     authentication method as the authentication provider for your API.
  • You are not securing your published APIs using API Gateway.
  • You plan to configure 
    Layer7 Live API Creator
     to run as cluster or, if you have configured 
    Layer7 Live API Creator
     to run as a single node, you want to persist your authentication tokens.
For more information about how to create this database, see Create a Database for your Authentication Tokens.