Azure / Azure/azure-sdk-for-python

Typo in the sample code of the "Create and Deploy Azure Function" section of the SDK reference for Python

Open
#40,607 3 comments 0 reactions 1 assignee Claimed by @jhakulin View on GitHub
customer-reported Docs Functions needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

### Type of issue

Typo

### Description

In the "Create and Deploy Azure Function" section (next to [Create Agent With Azure Function Call](https://learn.microsoft.com/en-us/python/api/overview/azure/ai-projects-readme?view=azure-python-preview#create-agent-with-azure-function-call)) the following code is mentioned:

```import azure.functions as func
import logging
import json

app = func.FunctionApp()

@app.get_weather(arg_name="inputQueue",
queue_name="input",
connection="AzureWebJobsStorage")
@app.queue_output(arg_name="outputQueue",
queue_name="output",
connection="AzureWebJobsStorage")
def get_weather(inputQueue: func.QueueMessage, outputQueue: func.Out[str]):
try:
...
```

The line `@app.get_weather(arg_name="inputQueue",` has an error, since the `app.get_weather` decorator does not exist. (Exception: AttributeError: 'FunctionApp' object has no attribute 'get_weather')

The correct form would be: `@app.queue_trigger(arg_name="inputQueue",`

I hope I have been clear so that you can perform the review. Thank you!

### Page URL

https://learn.microsoft.com/es-mx/python/api/overview/azure/ai-projects-readme?view=azure-python-preview&context=%2Fazure%2Fai-services%2Fagents%2Fcontext%2Fcontext

### Content source URL

https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/main/docs-ref-services/preview/ai-projects-readme.md

### Document Version Independent Id

cbce1de4-1962-d40e-dc99-230e62d876f7

### Platform Id

d6057e52-faa6-3d36-81a9-6ed154db32d3

### Article author

@azure-sdk

### Metadata

* ID: cc6e78de-3a52-894f-4a3f-4298ba475c16
* PlatformId: d6057e52-faa6-3d36-81a9-6ed154db32d3
* Service: **ai**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.