Azure / Azure/azure-functions-powershell-worker

Service Bus Trigger Bindings IN empty

Open
#531 4 comments 0 reactions 1 assignee Claimed by @stefanushinardi View on GitHub
investigation
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

Hy everyone, my recent experience with Azure Functions I implement Sevice Bus Trigger and when using name parameter $mySbMsg for reading content from trigger this hashtable is empty, but when I use $TriggerMetadata all content is there.
function.json
```json
{
"bindings": [
{
"name": "mySbMsg",
"type": "serviceBusTrigger",
"direction": "in",
"topicName": "topic-sbpwsh",
"subscriptionName": "mongo",
"connection": "AzureServiceBus"
}
]
}
```
settings.json
```json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "powershell",
"FUNCTIONS_WORKER_RUNTIME_VERSION": "~7",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureServiceBus": "",
"MongoConnection": "",
"MongoDatabase": "DBAcoes",
"MongoCollection": "HistoricoAcoes"
}
}
```
run.ps1
```powershell
param($TriggerMetadata,[string] $mySbMsg)
$returnFromTopic=[PSCustomObject]@{
Codigo = $TriggerMetadata.Codigo
Valor = $TriggerMetadata.valor
MessageID = $TriggerMetadata.MessageId
data = $(get-date -Format "MM/dd/yyyy HH:mm:ss K")
}
$returnFromTopic2=[PSCustomObject]@{
Codigo = $mySbMsg.Codigo
Valor = $mySbMsg.valor
MessageID = $mySbMsg.MessageId
data = $(get-date -Format "MM/dd/yyyy HH:mm:ss K")
}
Write-Host $returnFromTopic
Write-Host $returnFromTopic2
```

![ErrorServiceBusTrigger](https://user-images.githubusercontent.com/12378570/91653014-d93c4b00-ea72-11ea-8bf4-96b10f28b841.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.