The CLI can manage multiple configurations, so you don’t have to define the App, client and secret for each command. Configurations are stored in a file that is located just next to the CLI, so you need to write permissions to this directory.
I have successfully created a new configuration. I have verified it by running sq.exe confit list. But I cannot seem to find the file that is mentioned in the docs. Where does it end up? It’s not in my folder where I have sq.exe. and it’s not there as a hidden file either. Or is the config stored in memory or something?
This works on my local windows machine (since I have access to the entire file system including the folder where .sqcli folder lives) but it does not work on the Windows machine that hosts my Azure Functions app (because there I don’t have access to C:\Users\johndoe\.sqcli).
Is there some way around this? Or would a --config-path flag be needed in the CLI where you can specify a custom path to the .sqcli folder?
I changed it to c:\home\site\wwwroot since this folder has write permissions. I’m still getting this error message however: ERROR: Failed to save configuration file.
And here you can see that the env var is set properly in my function app:
This:
$sqcliFolder = $env:SQCLI_FOLDER
if (-not $sqcliFolder) {
Write-Host "Environment variable SQCLI_FOLDER not found."
} else {
Write-Host "Using folder from environment variable SQCLI_FOLDER: $sqcliFolder"
}
results in:
2025-01-09T18:27:00.015 [Information] INFORMATION: Using folder from environment variable SQCLI_FOLDER: C:\home\site\wwwroot