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

Abierto
#40,607 3 comentarios 0 reacciones 1 asignado Reclamado por @jhakulin Ver en GitHub
customer-reported Docs Functions needs-team-attention question Service Attention
Lenguaje dominante
Python
Estrellas
5.6k
Forks
3.4k
Merge medio
2 d 2 h
PR fusionados (30 d)
213

Descripción

### 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**

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.