Azure / Azure/azure-functions-host
Cannot Read Base64 Encoded Message with Queue Trigger
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### Investigative information
Please provide the following:
- Timestamp: 12:30p, 12/12/2018
- Function App version (1.0 or 2.0): 2.0 (Public Preview)
- Function App name: QueueTrigger (unpublished), ReadFromStorage(unpublished)
- Function name(s) (as appropriate): __init__.py
Please note: The functions are not published yet.
#### Repro steps
Provide the steps required to reproduce the problem:
1) Create a function to insert a json string into Functions in Python. The code for the insertion should look like this:
```import base64
queue_name = "example"
queue_service = QueueService(account_name = "sample", account_key = "sample")
datapoint = json.dumps({"date": "123", "location" : "somewhere"})
datapoint = base64.b64encode(bytes(datapoint, 'utf-8'))
queue_service.put_message(queue_name, str(datapoint))
```
2) Execute the function successfully.
3) Create another function for queue triggers.
```
def main(msg: func.QueueMessage) -> None:
logging.info(msg.get_body.decode('utf-8')
```
#### Expected behavior
The function in 3) executes, showing all the queue messages.
#### Actual behavior
The function in 3) fails with the following error:

#### Known workarounds
None
#### Related information
Provide any related information
* Programming language used: Python
* Bindings used: Queues for the second function. Blobs for the first. Both are input bindings.
Contributor guide
Research direction
The issue provides a Python queue-trigger reproduction in __init__.py but names no repository files or tests. Start by reproducing the failure with the shown queue message and examining the queue binding behavior; done means the trigger can read and log the message as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100