Update azure functions docs#8176
Conversation
|
@barddoo: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
Thanks for the PR! I'll bring it up with the docs team to get feedback here! |
pragl
left a comment
There was a problem hiding this comment.
I suggest implementing copyedits I've left in comments (minor clean-up), but this LGTM!
|
📝 WalkthroughWalkthroughAdded a comprehensive documentation page for deploying Apollo Server to Azure Functions, covering prerequisites, project setup, dependency installation, GraphQL HTTP-triggered function creation, local development, context objects with TypeScript definitions, authentication/authorization patterns, and deployment approaches via VS Code, Azure CLI, and CI/CD pipelines. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/source/deployment/azure-functions.mdx (1)
170-172:⚠️ Potential issue | 🟡 MinorUse “context menu” here.
“Context window” on Line 171 reads like a UI typo; in VS Code this is the right-click context menu.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/source/deployment/azure-functions.mdx` around lines 170 - 172, The phrase "context window" in the Azure Functions doc should be corrected to "context menu" to match VS Code terminology; update the sentence on the step that currently reads "Open the context window (use right-click) of your function app in the Azure Functions panel." to "Open the context menu (use right-click) of your function app in the Azure Functions panel." in docs/source/deployment/azure-functions.mdx so the UI wording is accurate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/source/deployment/azure-functions.mdx`:
- Around line 178-186: The code fence for the Azure Functions publish command is
currently showing line numbers which breaks copy/paste; update the markdown code
block that contains "func azure functionapp publish <YOUR_FUNCTION_APP_NAME>" to
disable line numbers by changing the opening fence to ```bash
showLineNumbers=false (i.e., replace ```bash with ```bash showLineNumbers=false
for that specific block) so the snippet is copy/paste friendly.
---
Duplicate comments:
In `@docs/source/deployment/azure-functions.mdx`:
- Around line 170-172: The phrase "context window" in the Azure Functions doc
should be corrected to "context menu" to match VS Code terminology; update the
sentence on the step that currently reads "Open the context window (use
right-click) of your function app in the Azure Functions panel." to "Open the
context menu (use right-click) of your function app in the Azure Functions
panel." in docs/source/deployment/azure-functions.mdx so the UI wording is
accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8b0fed43-c4d0-4c18-bf96-4acad96ef733
📒 Files selected for processing (1)
docs/source/deployment/azure-functions.mdx
📜 Review details
🧰 Additional context used
🪛 GitHub Check: AI Style Review
docs/source/deployment/azure-functions.mdx
[warning] 3-3: docs/source/deployment/azure-functions.mdx#L3
Products and Features: Remove 'the' before the standalone product name 'Apollo Server'.
description: How to deploy Apollo Server with Azure Functions
[warning] 66-66: docs/source/deployment/azure-functions.mdx#L66
Products and Features: Remove 'the' before standalone product name Apollo Server.
// Set up Apollo Server
[notice] 12-12: docs/source/deployment/azure-functions.mdx#L12
Structural Elements: Do not specify the number of items in a list introduction.
Make sure you've completed the following:
[notice] 20-20: docs/source/deployment/azure-functions.mdx#L20
Structural Elements: Headings should use sentence case.
## Set up your project
[notice] 24-24: docs/source/deployment/azure-functions.mdx#L24
Structural Elements: Headings should use sentence case.
### Create a new Azure Functions app
[notice] 28-28: docs/source/deployment/azure-functions.mdx#L28
Structural Elements: Headings should use sentence case.
### Install dependencies
[warning] 39-39: docs/source/deployment/azure-functions.mdx#L39
Structural Elements: Terminal commands longer than three words should be in a code block with a language specifier.
```bash
npm install -D typescript
---
[notice] 42-42: docs/source/deployment/azure-functions.mdx#L42
**Structural Elements**: Headings should use sentence case.
```suggestion
### Create your GraphQL function
[notice] 160-160: docs/source/deployment/azure-functions.mdx#L160
Structural Elements: List items that are fragments should omit ending punctuation.
- `req`: The [HttpRequest](https://learn.microsoft.com/javascript/api/@azure/functions/httprequest) object containing HTTP headers, method, body, query parameters, etc.
[notice] 161-161: docs/source/deployment/azure-functions.mdx#L161
Structural Elements: List items that are fragments should omit ending punctuation.
- `context`: The [InvocationContext](https://learn.microsoft.com/javascript/api/@azure/functions/invocationcontext) object containing function execution context (trace context, retry context, etc.)
[warning] 164-164: docs/source/deployment/azure-functions.mdx#L164
Structural Elements: Headings should use sentence case.
## Deployment
[warning] 168-168: docs/source/deployment/azure-functions.mdx#L168
Structural Elements: Tutorial headings should use imperative verbs.
### Deploy with VS Code
[notice] 185-185: docs/source/deployment/azure-functions.mdx#L185
Structural Elements: Terminal commands should have line numbering removed with showLineNumbers=false.
```bash showLineNumbers=false
func azure functionapp publish <YOUR_FUNCTION_APP_NAME>
---
[warning] 188-188: docs/source/deployment/azure-functions.mdx#L188
**Structural Elements**: Tutorial headings should use imperative verbs.
```suggestion
### Use CI/CD
[warning] 234-234: docs/source/deployment/azure-functions.mdx#L234
Structural Elements: Headings should use sentence case.
## Advanced patterns
[warning] 236-236: docs/source/deployment/azure-functions.mdx#L236
Structural Elements: Conceptual overview headings should use gerunds.
### Authenticating and authorizing
[warning] 263-263: docs/source/deployment/azure-functions.mdx#L263
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
// 1. Verify JWT signature
[warning] 264-264: docs/source/deployment/azure-functions.mdx#L264
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
// 2. Check expiration
[warning] 265-265: docs/source/deployment/azure-functions.mdx#L265
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
// 3. Look up user in database
[warning] 267-267: docs/source/deployment/azure-functions.mdx#L267
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
// Mock implementation
[warning] 268-268: docs/source/deployment/azure-functions.mdx#L268
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
if (token.startsWith('Bearer ')) {
[warning] 269-269: docs/source/deployment/azure-functions.mdx#L269
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
const userId = token.replace('Bearer ', '');
[warning] 270-270: docs/source/deployment/azure-functions.mdx#L270
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
// Look up user...
[warning] 271-271: docs/source/deployment/azure-functions.mdx#L271
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
return { id: userId, name: 'User', email: 'user@example.com', roles: ['user'] };
[warning] 272-272: docs/source/deployment/azure-functions.mdx#L272
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
}
[warning] 274-274: docs/source/deployment/azure-functions.mdx#L274
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
return null;
[warning] 279-279: docs/source/deployment/azure-functions.mdx#L279
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
req: HttpRequest,
[warning] 280-280: docs/source/deployment/azure-functions.mdx#L280
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
_context: InvocationContext,
[warning] 281-281: docs/source/deployment/azure-functions.mdx#L281
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
_body: any,
[warning] 283-283: docs/source/deployment/azure-functions.mdx#L283
Structural Elements: Use two spaces for each indentation level in JavaScript code blocks.
const authHeader = req.headers.get('authorization');
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| 2. Deploy using the Azure Functions Core Tools: | ||
|
|
||
| ```bash | ||
| func azure functionapp publish <YOUR_FUNCTION_APP_NAME> | ||
| ``` |
There was a problem hiding this comment.
Disable line numbers for the publish command block.
This shell snippet should opt out of line numbers so it stays copy/paste friendly.
Suggested change
-```bash
+```bash showLineNumbers=false
func azure functionapp publish <YOUR_FUNCTION_APP_NAME></details>
<!-- suggestion_start -->
<details>
<summary>📝 Committable suggestion</summary>
> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
```suggestion
🧰 Tools
🪛 GitHub Check: AI Style Review
[notice] 185-185: docs/source/deployment/azure-functions.mdx#L185
Structural Elements: Terminal commands should have line numbering removed with showLineNumbers=false.
| ```bash | |
| npm run build | |
| ``` | |
| 2. Deploy using the Azure Functions Core Tools: | |
| ```bash | |
| func azure functionapp publish <YOUR_FUNCTION_APP_NAME> | |
| ``` | |
| ```bash showLineNumbers=false | |
| func azure functionapp publish <YOUR_FUNCTION_APP_NAME> |
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @docs/source/deployment/azure-functions.mdx around lines 178 - 186, The code
fence for the Azure Functions publish command is currently showing line numbers
which breaks copy/paste; update the markdown code block that contains "func
azure functionapp publish <YOUR_FUNCTION_APP_NAME>" to disable line numbers by
changing the opening fence to bash showLineNumbers=false (i.e., replace bash with ```bash showLineNumbers=false for that specific block) so the
snippet is copy/paste friendly.
</details>
<!-- fingerprinting:phantom:triton:grasshopper -->
<!-- This is an auto-generated comment by CodeRabbit -->
I maintain the Azure Functions npm package. These docs are completely outdated.
Summary by CodeRabbit