Skip to content

docs(guides): make the auth layer and vector search tutorials runnable - #2566

Merged
bruno-andrade-azion merged 3 commits into
mainfrom
docs/mm-16222-runnable-auth-vector-tutorials
Nov 11, 2026
Merged

bruno-andrade-azion merged 3 commits into
mainfrom
docs/mm-16222-runnable-auth-vector-tutorials

Conversation

@bruno-andrade-azion

@bruno-andrade-azion bruno-andrade-azion commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Auth layer (en, pt-br):
    • The init step runs azion init --name my-auth-storage. Azion CLI 4.24.0 ignores a positional name: it asks Your application's name: with a random suggestion, so cd my-auth-storage failed for a reader who accepted it.
    • The step describes the real prompts (Choose a preset: / Choose a template:).
    • azion create variables before azion deploy replaces the root .env + azion sync step, because azion sync reads .edge/.env and never sent JWT_SECRET or BUCKET_NAME to the function.
  • Vector search (en, pt-br): the tutorial splits a one-time, idempotent setup.mjs from a read-only search function.
    • The setup reuses an existing database and recovers from 14001 Name Already In Use.
    • It polls getDatabase until status is created, uses IF NOT EXISTS, and seeds only when the table is empty.
    • Before this change, the first request failed on CREATE TABLE, and every later request returned 500 on 14001.
  • Vector search, the function:
    • It is index.js in the Javascript / Hello World project that the prerequisite links to. It was main.ts, a file that project does not have.
    • It uses the ES Modules export default { fetch } handler instead of the deprecated default-export function.
  • Vector search, the library:
    • The page switches to @aziontech/sql, as the Azion Lib reference does.
    • It aligns the failure envelope with that reference.
    • It keeps the LangChain Vector Store/Retriever note, whose source is the May 5, 2025 release notes.

How to test

  1. pnpm dev
  2. Open /en/documentation/guides/application-development/data/auth-layer-object-storage-functions/ and its pt-br version, /pt-br/documentacao/guias/desenvolvimento-de-aplicacoes/dados/camada-autenticacao-object-storage-functions/.
    • The init step runs azion init --name my-auth-storage and names the preset and template prompts.
    • The "Store the environment variables" section uses azion create variables.
    • The deploy section has no azion sync.
  3. Open /en/documentation/guides/application-development/data/sql-database-vector-search/ and /pt-br/documentacao/guias/desenvolvimento-de-aplicacoes/dados/edge-sql-vector-search/. Stages 2–4 build setup.mjs, stage 5 is the index.js search, and stage 6 runs it with azion dev.
  4. Optional, with SQL Database enabled: follow the vector search tutorial end to end, then run node --env-file=.env setup.mjs twice. The second run prints Setup complete without creating anything.

Notes

  • Jira: MM-16222 (T10). Epic: MM-16212.
  • The package name @aziontech/sql overlaps with MM-16229 (T17), which applies the same decision to the other SQL pages.
  • Not covered here, pending SME answers in MM-16194:
    • Question 87: whether Azion.env.get() reads .env under azion dev. The auth-layer page makes no claim about local env.
    • Whether Restricted blocks azion:storage.
  • Checked locally, without an Azion account:
    • The @aziontech/sql 1.0.1 source agrees with the page: getDatabase returns {} for a missing name, status goes from creating to created, and a failed statement fails the whole call.
    • Under @aziontech/bundler 1.2.0, which azion dev runs:
      • the index.js extracted from the page builds with no deprecation warning;
      • the function reads the root .env;
      • Azion.Sql is undefined, so useQuery goes through the API and reads the database that setup.mjs wrote.
    • setup.mjs extracted from the page runs on Node 26 with --env-file and stops cleanly on an invalid token.
  • The samples were not executed against a live account with SQL Database.
  • lint:links reports auth-layer-object-storage-functions: no closing link into "functions". The same finding already exists on main.
  • No permalink changes, no new dependencies.

Auth layer (en, pt-br):
- Describe the real `azion init` prompts (Choose a preset / Choose a template).
- Replace the root `.env` + `azion sync` step, which never reaches the
  function, with `azion create variables` before `azion deploy`.
- Align the test-token secret with the JWT_SECRET placeholder.

Vector search (en, pt-br):
- Split setup (setup.mjs) from the request-time search (main.ts).
- Poll getDatabase until status is `created` before the first statement.
- Reuse an existing database and recover from 14001 Name Already In Use.
- Make table, index, and seed idempotent (IF NOT EXISTS, seed when empty).
- Use @aziontech/sql, per the Azion Lib reference.
- Align the failure envelope with the Azion Lib reference.
- Remove the unsourced LangChain Vector Store/Retriever note.

Refs: MM-16222
…e-auth-vector-tutorials

* origin/main: (22 commits)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
  chore(main): release docs 2.4.3 (#2616)
  docs(applications): review the Applications section and apply the updated writing rules (#2615)
  chore(deps): bump npm and GitHub Actions dependencies (#2590)
  chore(deploy): promote docs-v2.4.2 to production (#2610)
  chore(main): release docs 2.4.2 (#2609)
  docs(style-guide): align the guide with the shipped sections and settle its open rules (#2600)
  chore(deploy): promote docs-v2.4.1 to production (#2569)
  chore(main): release docs 2.4.1 (#2568)
  chore(deploy): promote docs-v2.4.0 to production (#2560)
  docs(workloads): document custom page assignment with azion workload-deployment (#2564)
  docs(templates): reconcile Console Deploy links with the current catalog (#2563)
  docs(applications): fix rewrite argument, certificate API, workload domains, and connector CLI (#2562)
  docs(style-guide): review the EN style guide against the naming catalog (MM-16284) (#2561)
  docs(marketplace): fix invalid Arguments JSON in 7 integration guides (#2559)
  docs(runtime): fix broken example code in the Runtime reference (#2556)
  ...
- Auth layer: run `azion init --name my-auth-storage`. Azion CLI 4.24.0
  ignores a positional name and asks for one with a random suggestion.
- Vector search: write the search into `index.js`, the entrypoint of the
  Javascript / Hello World project the prerequisite links to, with the
  ES Modules fetch handler instead of the deprecated default-export
  function.
- Vector search: restore the LangChain Vector Store and Retriever note,
  sourced by the May 5, 2025 release notes.
- Vector search: name stage 6 "Run the search locally", the build step
  "Build the project", and `seedDocuments` where "the function" was
  ambiguous.
@bruno-andrade-azion
bruno-andrade-azion merged commit 43199bf into main Nov 11, 2026
10 checks passed
@bruno-andrade-azion
bruno-andrade-azion deleted the docs/mm-16222-runnable-auth-vector-tutorials branch November 11, 2026 19:26
bruno-andrade-azion pushed a commit that referenced this pull request Nov 11, 2026
* origin/main:
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
bruno-andrade-azion pushed a commit that referenced this pull request Nov 11, 2026
* origin/main:
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
bruno-andrade-azion pushed a commit that referenced this pull request Nov 11, 2026
…-main

* origin/main: (21 commits)
  feat(nav): give every breadcrumb crumb a page and make CLI commands runnable (#2636)
  fix(cli): drop azion update workload-deployment, which the CLI does not expose (#2639)
  docs(terminology): retire Edge Node, module, and add-on from current pages (#2618)
  docs(migration): share the repeated migration-guide procedures as partials (#2619)
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
  chore(main): release docs 2.4.3 (#2616)
  docs(applications): review the Applications section and apply the updated writing rules (#2615)
  chore(deps): bump npm and GitHub Actions dependencies (#2590)
  chore(deploy): promote docs-v2.4.2 to production (#2610)
  chore(main): release docs 2.4.2 (#2609)
  ...
bruno-andrade-azion pushed a commit that referenced this pull request Nov 11, 2026
* commit '7aa84b1d0': (22 commits)
  docs(nav): apply the review of the orphan-page triage
  feat(nav): give every breadcrumb crumb a page and make CLI commands runnable (#2636)
  fix(cli): drop azion update workload-deployment, which the CLI does not expose (#2639)
  docs(terminology): retire Edge Node, module, and add-on from current pages (#2618)
  docs(migration): share the repeated migration-guide procedures as partials (#2619)
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
  chore(main): release docs 2.4.3 (#2616)
  docs(applications): review the Applications section and apply the updated writing rules (#2615)
  chore(deps): bump npm and GitHub Actions dependencies (#2590)
  chore(deploy): promote docs-v2.4.2 to production (#2610)
  ...
bruno-andrade-azion pushed a commit that referenced this pull request Nov 12, 2026
* origin/main: (24 commits)
  chore(nav): count only visible rows toward the navcheck soft max (#2640)
  docs(nav): triage the pages outside the navigation (#2593)
  fix(guides): match the QStash variable and the Functions usage response to the code (#2571)
  feat(nav): give every breadcrumb crumb a page and make CLI commands runnable (#2636)
  fix(cli): drop azion update workload-deployment, which the CLI does not expose (#2639)
  docs(terminology): retire Edge Node, module, and add-on from current pages (#2618)
  docs(migration): share the repeated migration-guide procedures as partials (#2619)
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
  chore(main): release docs 2.4.3 (#2616)
  docs(applications): review the Applications section and apply the updated writing rules (#2615)
  ...
bruno-andrade-azion pushed a commit that referenced this pull request Nov 12, 2026
…y-filter-removal

* origin/main: (24 commits)
  chore(nav): count only visible rows toward the navcheck soft max (#2640)
  docs(nav): triage the pages outside the navigation (#2593)
  fix(guides): match the QStash variable and the Functions usage response to the code (#2571)
  feat(nav): give every breadcrumb crumb a page and make CLI commands runnable (#2636)
  fix(cli): drop azion update workload-deployment, which the CLI does not expose (#2639)
  docs(terminology): retire Edge Node, module, and add-on from current pages (#2618)
  docs(migration): share the repeated migration-guide procedures as partials (#2619)
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  chore(main): release docs 2.4.4 (#2627)
  chore(deploy): promote docs-v2.4.3 to production (#2617)
  fix(applications): apply live test results and define each resource by its role (#2626)
  chore(main): release docs 2.4.3 (#2616)
  docs(applications): review the Applications section and apply the updated writing rules (#2615)
  ...
bruno-andrade-azion pushed a commit that referenced this pull request Nov 12, 2026
* origin/main: (29 commits)
  fix(structure): tag bare code fences, fix heading skips, add pt-br meta_tags (#2629)
  docs(style-guide): drop the nonexistent GlossaryFilter from the glossary template (#2577)
  docs(release-notes): fix the October 14 anchor and merge the duplicate February 24 entry (#2572)
  fix(orchestrator): fix broken bind and create-service API samples (#2574)
  docs(readability): split the long sentences in the Runtime, CLI, Reference, and KV Store pages (#2635)
  chore(nav): count only visible rows toward the navcheck soft max (#2640)
  docs(nav): triage the pages outside the navigation (#2593)
  fix(guides): match the QStash variable and the Functions usage response to the code (#2571)
  feat(nav): give every breadcrumb crumb a page and make CLI commands runnable (#2636)
  fix(cli): drop azion update workload-deployment, which the CLI does not expose (#2639)
  docs(terminology): retire Edge Node, module, and add-on from current pages (#2618)
  docs(migration): share the repeated migration-guide procedures as partials (#2619)
  fix(marketplace): drop the Azion CLI prerequisite from firewall integration guides (#2612)
  docs(guides): replace the residual "These checks confirm" lines with use-case expect blocks (#2611)
  docs(guides): make the auth layer and vector search tutorials runnable (#2566)
  chore(scripts): add pnpm lint:terraform to validate Terraform samples (#2637)
  fix(firewall): correct the CLI binding, the WAF config sample, and the JWT paywall steps (#2565)
  docs(cli): document azion workload-deployment and fix pages that say the CLI cannot bind a deployment (#2567)
  docs(terraform): rewrite the samples for provider v2.10.0 (#2557)
  chore(deploy): promote docs-v2.4.4 to production (#2631)
  ...

# Conflicts:
#	apps/docs/src/content/docs/en/pages/observe/real-time-events/data-sources.mdx
#	apps/docs/src/content/docs/pt-br/pages/observe/real-time-events/fontes-de-dados.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants