https://github.com/svrooij/az-cog-cli
https://github.com/svrooij/az-cog-cli
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/svrooij/az-cog-cli
- Owner: svrooij
- License: mit
- Created: 2023-06-23T12:39:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-02T10:35:06.000Z (almost 2 years ago)
- Last Synced: 2025-03-20T08:03:23.817Z (about 1 month ago)
- Language: C#
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Azure Cognitive Search CLI
Allowing you to index blog posts right from you pipeline.
# GitHub Action: Azure Cognitive Search Index
Index local json files and send them to your Azure Cognitive Search Service
## Using this action
```yaml
- uses: svrooij/az-cog-cli@main
with:
# The location of the folder to index
folder: ""# The endpoint of your Azure Search Service
endpoint: ""# The Admin API Key, needed for uploading documents
apiKey: ""# What files to look for
# Default: index.json
query: ""# IndexName to send the items to
# Default: blog-1
index: ""
```## Inputs
| **Input** | **Description** | **Default** | **Required** |
| -------------- | ------------------------------------------------- | ------------ | ------------ |
| **`folder`** | The location of the folder to index | | **true** |
| **`endpoint`** | The endpoint of your Azure Search Service | | **true** |
| **`apiKey`** | The Admin API Key, needed for uploading documents | | **true** |
| **`query`** | What files to look for | `index.json` | **false** |
| **`index`** | IndexName to send the items to | `blog-1` | **false** |Set the `endpoint` and `apiKey` through secrets e.g. `endpoint: ${{ secrets.AZURE_SEARCH_ENDPOINT }}`
## Docker: Azure Cognitive Search Index
This app is also published as a docker container, you can run as follows.
Use `{platform-specific-part} index folder {location-of-mapped-folder} --endpoint https://{searchService}.search.windows.net --apiKey xxx`
Or run `docker run --rm ghcr.io/svrooij/az-cog-cli:dev index folder --help` for more details.
```text
> docker run --rm ghcr.io/svrooij/az-cog-cli:dev index folder --help
Description:
Add data in a folder to your indexUsage:
az-cog-cli index folder [options]Arguments:
Folder to look for filesOptions:
--query What files to look for [default: index.json]
--index Which index shall be used? [default: blog-1]
--endpoint Specify the endpoint
--apiKey Specify the Admin API Key
-?, -h, --help Show help and usage information
```### Windows (using PowerShell)
```PowerShell
docker run --rm -v ${PWD}:/usr/my-folder ghcr.io/svrooij/az-cog-cli index folder /usr/my-folder --endpoint https://{searchService}.search.windows.net --apiKey xxx
```### Linux
```bash
docker run --rm -v $(pwd):/usr/my-folder ghcr.io/svrooij/az-cog-cli index folder /usr/my-folder --endpoint https://{searchService}.search.windows.net --apiKey xxx
```