Quickstart: Install the ESAF tools¶
In this quickstart, you install one ESAF tool, start the Factory API and check that they connect. The Factory API is the one service that every tool calls. It ships inside the app, so you don't install it separately.
Tip
Run it guided. The ESAF Tutorial Guide types each command for you and checks every step: it also starts its own Factory API. Open an ESAF tutorial and the track Scenarios 1-3. Download the ESAF Tutorial Guide. It's a private preview: ask Joakim Åström on LinkedIn for a preview code.
Every tool is an L1 client of the same Factory API, so the result is the same whichever you pick. See the onion architecture.
Prerequisites¶
- Windows x64: Git for Windows, which includes Git Bash. For the CLI (PowerShell) tab, also PowerShell 7.3 or later.
- Linux or macOS: Git and Bash. Use the CLI (bash), Python SDK or REST tab. The one-call scenarios need the app package v0.47.100 or later. Check the download table: a Linux or macOS package older than that starts the API, but it doesn't have the one-call scenarios yet.
- Azure CLI and Python 3.10 or later.
- A Git repository for your Factory's configuration, in GitHub or Azure DevOps. This is your consumer repository.
Start the Factory API¶
Option A) Windows - Start via ESAF Tutorial Guide (Windows app only)
1. Download the [ESAF Tutorial Guide](https://github.com/jostrm/azure-enterprise-scale-ml/blob/main/environment_setup/install_tutorial_guide/README.md) 2. From within the app, click "Start API". Wait until the pill shows **Running** with a port number.  3. The **API started** dialog shows the auto-generated API key. Select **Copy key** if you need it in another tool, then **Close**. The guide's API uses a new port every time it starts, so you don't type the address or the key yourself: under [Connect your tool](#connect-your-tool), the guide's **Type connection** button types both into PowerShell for you, in one line. Keep the guide open. The API stops when you close it.Option B) Mac & Linux - Start via ESAF Wizard App (Windows, Mac OS, Linux)
The Factory API ships inside the **AIFactory Config Wizard**, a desktop app for Windows, Linux and macOS. 1. Download the [AIFactory Config Wizard](https://github.com/jostrm/azure-enterprise-scale-ml/blob/main/environment_setup/install_config_wizard/readme.md#download) for your system. 2. Extract the archive. On Windows, keep the `_internal` folder beside `aifactory-config.exe`. 3. Open the app. On Windows, that's `aifactory-config.exe`. For the other systems, see [macOS](https://github.com/jostrm/azure-enterprise-scale-ml/blob/main/environment_setup/install_config_wizard/readme.md#macos) and [Linux](https://github.com/jostrm/azure-enterprise-scale-ml/blob/main/environment_setup/install_config_wizard/readme.md#linux). 4. In the left menu, select **Quick setup**, then **Start API host**. Do this before you open any other window in the app, so that you choose the key.  5. In the **API Host Authentication** dialog, enter a private API key. You choose it. remember it for the next steps. 6. Copy the API address from the **API Host Started** dialog. The default is `http://127.0.0.1:8765`. The status bar shows it too. Keep the app open. The API stops when you close it.Option C) Windows - Start from the command line (no app window)
The Windows package of the AIFactory Config Wizard also runs the Factory API on its own, without a window. You need v0.47.107 or later. Run these lines in the PowerShell window you use for the next steps. 1. Download and extract the package:Invoke-WebRequest 'https://github.com/jostrm/azure-enterprise-scale-ml/raw/refs/heads/main/environment_setup/install_config_wizard/windows/aifactory-config-windows.zip' -OutFile "$HOME\Downloads\aifactory-config-windows.zip"
Expand-Archive "$HOME\Downloads\aifactory-config-windows.zip" "$HOME\aifactory-config" -Force
$env:AIFACTORY_API_KEY = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(32))
$api = Start-Process "$HOME\aifactory-config\aifactory-config\aifactory-config.exe" -ArgumentList '--api-host', '--port', '8765' -PassThru
foreach ($i in 1..30) { try { Invoke-RestMethod http://127.0.0.1:8765/health; break } catch { Start-Sleep 1 } }
Create your Factory folder¶
Your Factory's configuration lives in an azurefactory folder in your consumer repository.
- Open Bash in the root of your consumer repository. On Windows, that's Git Bash.
- Add this repository as a submodule and create the folder:
git submodule add -b release/v1.25 https://github.com/jostrm/azure-enterprise-scale-ml
bash ./azure-enterprise-scale-ml/01-start-v125-and-above.sh
Expected output, among other lines:
The script creates azurefactory\register.json with no factories in it. It changes nothing in Azure. See
folder structure.
Connect your tool¶
Choose one tool. You can add the others later; they all use the same API address, key and folder.
The App tabs use Enterprise Scale AI Factory, the ESAF desktop app for Windows 11. It starts its own Factory API, so you can skip "Start the Factory API" above.
- Install the app from its download folder. You need version 1.0.24 or later.
- Open Enterprise Scale AI Factory from Start.
- On Start Guide, under Consumer repository root, select Browse repository and pick your consumer repository.
Open PowerShell in the root of your consumer repository.
- Install the CLI:
- Connect to the Factory API:
- Option A, ESAF Tutorial Guide: in the guide, select Type connection, then click this PowerShell
window within 3 seconds. The guide types one line that sets
$env:AIFACTORY_API_URLand$env:AIFACTORY_API_KEYfor its API. Press Enter. The line includes the key, so don't share a screenshot of it. -
Option B, AIFactory Config Wizard:
-
Option C, command line: run the next lines in the same PowerShell window that started the API. The key is already set there; set only the address:
-
Point the CLI at your folder and check the connection:
Open Bash in the root of your consumer repository. With the ESAF Tutorial Guide (option A), use the port that its
pill shows (Running ... on port N) instead of 8765, and paste the key from its Copy key button.
python3 -m pip install ./azure-enterprise-scale-ml/environment_setup/azurefactory-cli
export AIFACTORY_API_URL='http://127.0.0.1:8765'
read -r -s -p 'API key you entered in the app: ' AIFACTORY_API_KEY && export AIFACTORY_API_KEY
export ESAF_FOLDER="$PWD/azurefactory"
azurefactory health
In Git Bash on Windows, the API needs a Windows path:
export ESAF_FOLDER="$(cygpath -w "$PWD/azurefactory")".
Install the SDK and set the connection once. This is PowerShell; on Linux or macOS, use the three export
lines from the CLI (bash) tab instead. With the ESAF Tutorial Guide (option A), select Type connection in the
guide and click this PowerShell window instead of the Read-Host line: it also sets the API address.
python -m pip install .\azure-enterprise-scale-ml\environment_setup\azurefactory-cli
$env:AIFACTORY_API_KEY = Read-Host 'API key you entered in the app'
$env:ESAF_FOLDER = (Resolve-Path .\azurefactory).Path
Then save this as check_connection.py and run it:
Verify the result¶
Your tool reaches the API, and your folder holds no factory yet.
| Tool | Expected output |
|---|---|
| App | The status light at the bottom shows API connected. |
| CLI, in either shell | azurefactory health prints "status": "ok". |
| Python SDK | The script prints []. |
| REST | The second command lists seven routes that start with /api/v1/esaf/. |
For example, the CLI prints:
If something goes wrong:
| Message | Fix |
|---|---|
AIFACTORY_API_KEY is required, or HTTP 401 |
Set the key again. It must match the key you entered in the app. |
The Factory API has no /api/v1/esaf routes |
Your app package is older than v0.47.100. Download the current package. On Linux and macOS, check the download table for a package with that version. |
Select an absolute local factory folder without traversal. |
Set ESAF_FOLDER with Resolve-Path, as shown. |
ModuleNotFoundError: azurefactory |
Run the pip install line again with the same python. |
Next step¶
Back: Setup docs
Next: Quickstart: Create your AI Factory
Related:
- Settings: the connection settings in one table.
- The six scenarios: what you can run now.
- Guide 18: try the tools against a local demo service first.