Skip to main content

Create a geodatabase in a SQL Server cloud-based database service

Available with Standard or Advanced license.

ArcGIS supports several cloud database-as-a-service offerings that are based on SQL Server. If you require geodatabase functionality, you can create an enterprise geodatabase in these databases.

When you create a geodatabase using ArcGIS Pro 3.7, the geodatabase version is 12.1.0.x.

Complete the prerequisites

Before you can create a geodatabase, you must create the database instance in your cloud account, configure it to receive connections, create an sde user and schema, and grant the sde user privileges to create a geodatabase.

Follow the instructions provided by your cloud provider to complete these steps.

You must also copy the ArcGIS Server keycode authorization file to the cloud machine where you install the ArcGIS client that you'll use to create the geodatabase.

Complete the following prerequisite steps before creating a geodatabase:

  1. Confirm that the ArcGIS versions you use support the cloud-based database service type and version you want to use.

  2. Create the database service instance in your chosen cloud platform.

  3. Create a user named sde for the database instance.

  4. Grant the sde user privileges required to create a geodatabase for the type of database service you're using.

  5. Create a schema named sde in the database instance.

  6. Grant the sde user CONTROL permission on the sde schema and set the sde schema as the sde user's default schema.

  7. Install the ArcGIS client—ArcGIS Pro or ArcGIS Server—that you'll use to create the geodatabase.

    For best performance, install the ArcGIS client in the same cloud platform and region where the database service is running.

  8. Configure a SQL Server ODBC client on the virtual machine where you installed the ArcGIS client.

  9. Ensure that the database instance is configured to allow connections from the ArcGIS client.

  10. From the ArcGIS client you installed in step 7, create a connection to the database instance and connect as the sde user.

    See Connect to Microsoft SQL Server from ArcGIS for examples of instance strings.

    If the sde user is a database-authenticated user, you must save the sde user's password in the database connection.

  11. Obtain an ArcGIS Server keycodes file and place it in a location you can access from the ArcGIS client you'll use to create the geodatabase.

Now you can create a geodatabase in the database instance in the cloud.

Create a geodatabase in the database service instance

If you installed ArcGIS Pro in the same cloud region as the database service, you can run the Enable Enterprise Geodatabase geoprocessing tool to create a geodatabase in the database instance, as described in the first section below.

Alternatively, you can run the EnableEnterpriseGeodatabase ArcPy function in a Python window or run a Python script from an ArcGIS Pro or ArcGIS Server installation in the same cloud region.

Run the Enable Enterprise Geodatabase tool

To create a geodatabase using the Enable Enterprise Geodatabase tool in ArcGIS Pro, complete the following steps:

  1. Sign in to the virtual machine in the cloud environment and start ArcGIS Pro.

  2. Open the Enable Enterprise Geodatabase tool.

    See Find a geoprocessing tool for general information about opening geoprocessing tools.

  3. For the Input Database Connection parameter, provide the database connection file that you created as part of the prerequisite steps.

  4. For Authorization File, browse to and choose the keycodes file that was created when you authorized ArcGIS Server (Enterprise edition).

    This file is written to \\Program Files\ESRI\License<release#>\sysgen when you install ArcGIS Server on Windows and to /arcgis/server/framework/runtime/.wine/drive_c/Program Files/ESRI/License<release#>/sysgen when you install ArcGIS Server on Linux.

  5. Click Run.

You now have a geodatabase in the database instance.

You can find messages related to geodatabase creation in the sde_setup.log file, which is created in the directory specified for the TEMP variable on the virtual machine where the script is run. If you have problems creating a geodatabase, review this file to troubleshoot the problem.

Run the EnableEnterpriseGeodatabase ArcPy function

To run ArcPy functions, connect to one of the ArcGIS client machines in the cloud and run the function from a Python window.

  1. Sign in to the virtual machine in the cloud environment where ArcGIS Pro or ArcGIS Server is installed.

  2. Access a Python window.

    See the following resources for information about accessing Python from ArcGIS installations:

  3. Run the EnableEnterpriseGeodatabase ArcPy function from a Python window.

    Use the database connection file that you created and reference the ArcGIS Server authorization file you placed in an accessible location as part of the prerequisite steps.

    In the following example, the EnableEnterpriseGeodatabase function is run from an ArcGIS Pro installation. The database connection file (ssdbaas.sde) is stored in an ArcGIS Pro project folder (C:\proprojects\pg_proj), and the authorization file (keycodes) is stored in C:\authcodes.

    arcpy.management.EnableEnterpriseGeodatabase(r"C:\proprojects\pg_proj\ssdbaas.sde",r"C:\authcodes\keyfile")

    In the next example, the function is run from an ArcGIS Server installation on a Linux machine. The database connection file (ssdbaas.sde) is stored in /usr/connectionfiles, and the keycodes file is in the default ArcGIS Server location.

    arcpy.management.EnableEnterpriseGeodatabase("/usr/connectionfiles/ssdbaas.sde","/usr/arcgis/server/framework/runtime/.wine/drive_c/Program Files/ESRI/License/sysgen/keycodes")

You now have a geodatabase in the database instance.

You can find messages related to geodatabase creation in the sde_setup.log file, which is created in the directory specified for the TEMP variable on the virtual machine where the function is run. If you have problems creating a geodatabase, review this file to troubleshoot the problem.

Run a Python script from an ArcGIS client

To create the geodatabase by running a script from an ArcGIS Pro (Standard or Advanced) or ArcGIS Server machine, you can use the script provided here.

Tip:

For information about running Python from an ArcGIS Server machine, see ArcGIS Server and ArcPy.

To run a Python script that calls the CreateDatabaseConnection and EnableEnterpriseGeodatabase ArcPy functions to connect to the database and create a geodatabase in a SQL Server database service, complete the following steps:

  1. Save the file with a .py extension.

  2. Run the script, providing options and information specific to your instance.

    In the following examples, the enable_gdb.py file is run from a virtual machine in the same cloud region as the database service.

    In this example, the script is run from an ArcGIS Server installation on a Linux machine. It connects to a database named myrdsdb in an Amazon Relational Database Service for SQL Server instance in the us-east-1 region (database-1-instance-1.zyxjtlpj9fer.us-east-1.rds.amazonaws.com). The keycodes file was placed in /usr/arcgis/auth on the ArcGIS Server machine.

    ./enable_gdb.py --DBMS SQLSERVER -i database-1-instance-1.zyxjtlpj9fer.us-east-1.rds.amazonaws.com --auth DATABASE_AUTH -u sde -p sdeP@ss -D myrdsadb -l '/usr/arcgis/auth/keycodes'
    

    In the next example, the script is run from a Microsoft Windows machine in Azure. It connects to a database named azuressd in the Microsoft Azure SQL Database instance my-instance.ssdbid987.database.windows.net. The keycodes file is in the default ArcGIS Server location.

    enable_gdb.py --DBMS SQLSERVER -i my-instance.ssdbid987.database.windows.net --auth DATABASE_AUTH
    -u sde -p EsDeeEpw -D azuressd -l '\\Program Files\ESRI\License\sysgen\keycodes'
    

    In the following example, the script is run from a machine where ArcGIS Pro is installed and the keycodes file was placed in Users\MyUser\Documents\AuthFiles\keycodes. The script connects to a database (gcsss) in a Google Cloud SQL for SQL Server instance accessed through the public IP address 98.765.43.210.

    enable_gdb.py --DBMS SQLSERVER -i 98.765.43.210 --auth DATABASE_AUTH
    -u sde -p My.Passw0rd -D gcsss -l '\\Users\MyUser\Documents\AuthFiles\keycodes'
    
    Tip:

    Type -h or --help at the command prompt for syntax help for this script.

You now have a geodatabase in the database instance.

You can find messages related to geodatabase creation in the sde_setup.log file, which is created in the directory specified for your TEMP or TMP variable on the virtual machine where the script is run. If you have problems creating a geodatabase, review this file to troubleshoot the problem.

Next steps

The database administrator can create users and matching schemas for users who will create datasets, create users for editors and data viewers, and grant these users the appropriate privileges. Follow instructions provided by the database service provider to create login roles and schemas.