Update the Configuration File for Azure Datastores

You should only create or update a configuration file using the dbfhconfig command line utility.

  1. Open an Enterprise Developer command prompt.
    Note: On Windows, the command prompt must be the same bitism as the ODBC data source that you intend to use.
  2. Set the MFDBFH_CONFIG environment variable to locate the configuration file to be created or updated:
    set MFDBFH_CONFIG=<location-and-name-of-file>

    If you do not set this variable, a file named MFDBFH.cfg is assumed to be located in the current directory.

    Note: The MFDBFH_SCRIPT_DIR environment variable is also required to point to the stored procedures used to interact with a datastore; however, this variable is implicitly set already when using an Enterprise Developer command prompt.
  3. Add a database server instance that you intend to connect to:
    dbfhconfig -add -server:<server-name> -provider:az

    where <server-name> is the name of the database server instance. An entry of (local) or localhost is also valid, which defaults to your machine name.

    Next you need to specify the databases within the instance.

  4. Firstly, you need to create a reference to the master database - this is the primary configuration database supplied with Azure:
    Note: If the <server> element for your database server instance already exists, this reference should already exist.
    dbfhconfig -add -server:<server-name> -dsn:<dsn-name> -type:database -name:master [-user:<user-name>] [password:<password>] [-connect:<connection-string>]

    where <dsn-name> is the ODBC data source for the Azure master database, or if you are using a connection string (instead of an ODBC data source), it is a unique name within the configuration in which to reference the database; <user-name> and <password> are valid credentials for the instance - you do not need to specify theses if you are using a connection string; and <connection-string> is the database connection string if you are establishing a database connection without the use of an ODBC data source - see Database Connection Strings for the database-specific syntax.

  5. Repeat the following step for each required datastore:
    dbfhconfig -add -server:<server-name> -dsn:<dsn-name> -type:datastore -optio:<opts> -name:<dsname> [-user:<user-name>] [-password:<password>] [-connect:<connection-string>]

    where <dsn-name> is the ODBC data source for the datastore, or if you are using a connection string (instead of an ODBC data source), it is a unique name within the configuration in which to reference the datastore; <opts> are the optimizations to be applied to I/O operations; and <dsname> is the actual name of the datastore (as configured in the data source properties).

    <opts> can be one of:
    option description
    all All optimizations applied, as if +<opt> had been specified for each available option. You can then selectively disable certain options using -<opt>.
    none No optimizations applied.
    {+|-}oiseq Enables (+) or disables (-) optimizations for line-sequential files opened for input.
    {+|-}ooseq Enables (+) or disables (-) optimizations for line-sequential files opened for output.
    {+|-}oi Enables (+) or disables (-) optimizations for ESDS, KSDS, and RRDS files opened for input.
    {+|-}oo Enables (+) or disables (-) optimizations for ESDS, KSDS, and RRDS files opened for output.

Example configuration file

The following is an example of a configuration file that contains two datastores, a region database and a cross-region database. The database instance is indicated by the VAR2AZDB variable. As the login credentials are required to establish a connection to this database, the secrets vault has also been enabled: see Configure a Secrets Vault for the Micro Focus Database File Handler for more information.

<datastores usevault="true">
   <server name="${VAR2AZDB}" type="azuresqldb" access="odbc">
      <dsn name="AZ.MYMASTER" type="database" dbname="master" userid="azusr" password="$$vault$$"/>
      <dsn name="AZ.VSAM" type="datastore" dsname="VSAM" userid="azusr" password="$$vault$$"/>
      <dsn name="AZ.SEQ" type="datastore" dsname="SEQ" optio="+ooseq" userid="azusr" password="$$vault$$"/>
      <dsn name="AZ.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all" userid="azusr" password="$$vault$$"/>
      <dsn name="AZ.CROSSREGION" type="crossregion.cas" userid="azusr" password="$$vault$$"/>
   </server>
</datastores>

Next, you must create the datastores using the dbfhadmin command line utility; after which, you can use the dbfhdeploy command line utility to add files to them.