Set up a GitHub Repository
In this tutorial, you will learn how to create a GitHub repository and do the basic setup.
This tutorial was tested for ArcGIS Enterprise 11.5 in December, 2025.
Prerequisites
Check the preconditions for this tutorial:
-
VS Code is installed on your local machine.
-
Git is installed on your local machine.
-
You have a GitHub account. This account is connected to VS Code.
Create a new repository
Create a new GitHub repository for these tutorials.
-
Log in to GitHub with your account credentials.
-
Click the + icon in the top right corner and select New repository.
-
Name your repository security-manager-policies.
-
Add a description: Policy configurations for security.manager NEXT.
-
Choose Private for sensitive policy configurations.
-
Check Add a README file.
-
Click Create repository.
-
Copy the repository URL (HTTPS format).
Clone the repository in VS Code
Next, you need a local clone of that repository.
-
Open VS Code on your local machine.
-
Press Ctrl+Shift+P to open the Command Palette.
-
Type
Git: Cloneand select it. -
Paste the repository URL you copied previously.
-
Choose a local folder for the repository.
-
When prompted, select Open to open the cloned repository.
Create the policy directory structure
security.manager NEXT CLI requires a fixed folder structure.
-
To separate the files for security.manager NEXT from other files, create a folder policies.
-
In VS Code Explorer, right-click in the repository root.
-
Select New Folder.
-
Enter the name
policies.
This folder is the working directory of security.manager NEXT.
-
-
To meet the required folder structure, create a subfolder named
servicesinsidepolicies.
Your directory structure should look like:
security-manager-policies/
├── README.md
└── policies/
└── services/
Add the policies
Currently, your local setup does not have policies. Create a new policy for the SampleWorldCities service.
-
Add a new file to the
servicesfolder namedSampleWorldCities.json. -
Open the file and add the policy from the previous tutorial.
{
"fallbackPolicies": [{
"layers": [
"0"
],
"restrictions": ["cities_only_names", "cities_username_filter"]
},{
"layers": [
"1"
],
"restrictions": ["country_username_filter"]
}],
"restrictions": {
"country_username_filter": {
"type": "spatial",
"featuretypeurl": "https://services.conterra.de/server/rest/services/security_demos/World_Countries/FeatureServer/0",
"featurequery": "NAME LIKE UPPER(SUBSTRING('${user.username}', 1, 1)) || '%'",
"imageoperation": "arcgis-clipping"
},
"cities_username_filter":{
"type": "feature",
"query": "CITY_NAME LIKE UPPER(SUBSTRING('${user.username}', 1, 1)) || '%'"
},
"cities_only_names":{
"type": "field",
"allowedfields": [
"CITY_NAME"
]
}
}
}
Commit and push changes
Commit and push your changes to GitHub.
-
In VS Code, go to the Source Control view by pressing Ctrl+Shift+G.
-
Review the changed and added files: e.g.
policies/services/SampleWorldCities.json. -
Enter a commit message Add SampleWorldCities policy.
-
Click Commit to stage and commit changes.
-
Click Sync Changes or use Ctrl+Shift+P and select Git: Push to push to GitHub.
Verify the repository updates in the web browser.
-
Go to your GitHub repository in the web browser.
-
Navigate to the
policies/services/folder. -
Verify that
SampleWorldCities.jsonis present.
Backup policies from an ArcGIS Enterprise
If you set up this project after working with the security.manager Manager UI, you may want to get all existing policies of the ArcGIS Enterprise instance. To avoid manually copying all policies, you can use the security.manager CLI to get all the files. Be aware that the command overwrites your local files with the same name.
Install security.manager CLI and follow the guide Define and sync but use the --reverse flag in step 3 to synchronize from the ArcGIS Enterprise to your local machine.
This option is explained in Backup policies.
If necessary, commit and push the backed-up policies to GitHub so they are available in this repository.
Summary
In this tutorial you learned to create a GitHub repository to store the policy configuration. You can collaborate with others and use the version control.
Follow JSON schema to activate autocompletion and use VS Code IntelliSense.