is it possible to parameterize QueueTrigger name?
I'm writing a queue-triggered azure function:
[FunctionName("OnTranslationEventQueueTriggered")]
public static void Run([QueueTrigger("translationsqueue", Connection = "TranslationsQueueConnectionString")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
The name of the queue is translationsqueue
, but I'd like to be able to parameterize this.
How do we pull the name of the queue from configuration?
c# .net visual-studio-2017 azure-functions
|
show 1 more comment
I'm writing a queue-triggered azure function:
[FunctionName("OnTranslationEventQueueTriggered")]
public static void Run([QueueTrigger("translationsqueue", Connection = "TranslationsQueueConnectionString")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
The name of the queue is translationsqueue
, but I'd like to be able to parameterize this.
How do we pull the name of the queue from configuration?
c# .net visual-studio-2017 azure-functions
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
@Nkosi i dont want to hardcodetranslationsqueue
- i want to be able to set this name in configurationn
– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
2
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06
|
show 1 more comment
I'm writing a queue-triggered azure function:
[FunctionName("OnTranslationEventQueueTriggered")]
public static void Run([QueueTrigger("translationsqueue", Connection = "TranslationsQueueConnectionString")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
The name of the queue is translationsqueue
, but I'd like to be able to parameterize this.
How do we pull the name of the queue from configuration?
c# .net visual-studio-2017 azure-functions
I'm writing a queue-triggered azure function:
[FunctionName("OnTranslationEventQueueTriggered")]
public static void Run([QueueTrigger("translationsqueue", Connection = "TranslationsQueueConnectionString")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
The name of the queue is translationsqueue
, but I'd like to be able to parameterize this.
How do we pull the name of the queue from configuration?
c# .net visual-studio-2017 azure-functions
c# .net visual-studio-2017 azure-functions
asked Dec 27 '18 at 18:23
l--''''''---------''''''''''''
9,977232533876
9,977232533876
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
@Nkosi i dont want to hardcodetranslationsqueue
- i want to be able to set this name in configurationn
– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
2
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06
|
show 1 more comment
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
@Nkosi i dont want to hardcodetranslationsqueue
- i want to be able to set this name in configurationn
– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
2
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
@Nkosi i dont want to hardcode
translationsqueue
- i want to be able to set this name in configurationn– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
@Nkosi i dont want to hardcode
translationsqueue
- i want to be able to set this name in configurationn– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
2
2
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06
|
show 1 more comment
1 Answer
1
active
oldest
votes
Based on the Binding expressions and patterns the app setting binding expression is wrapped in percent signs, see the following example:
in the class:
QueueTrigger("%translationsqueue%", …)
in the bindings:
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%translationsqueue%",
"connection": "TranslationsQueueConnectionString"
}
]
}
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53949290%2fis-it-possible-to-parameterize-queuetrigger-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Based on the Binding expressions and patterns the app setting binding expression is wrapped in percent signs, see the following example:
in the class:
QueueTrigger("%translationsqueue%", …)
in the bindings:
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%translationsqueue%",
"connection": "TranslationsQueueConnectionString"
}
]
}
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
add a comment |
Based on the Binding expressions and patterns the app setting binding expression is wrapped in percent signs, see the following example:
in the class:
QueueTrigger("%translationsqueue%", …)
in the bindings:
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%translationsqueue%",
"connection": "TranslationsQueueConnectionString"
}
]
}
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
add a comment |
Based on the Binding expressions and patterns the app setting binding expression is wrapped in percent signs, see the following example:
in the class:
QueueTrigger("%translationsqueue%", …)
in the bindings:
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%translationsqueue%",
"connection": "TranslationsQueueConnectionString"
}
]
}
Based on the Binding expressions and patterns the app setting binding expression is wrapped in percent signs, see the following example:
in the class:
QueueTrigger("%translationsqueue%", …)
in the bindings:
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%translationsqueue%",
"connection": "TranslationsQueueConnectionString"
}
]
}
answered Dec 27 '18 at 21:12
Roman Kiss
1,865128
1,865128
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
add a comment |
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
whats the benefit of using the bindings vs regular configuration like from environment variables?
– l--''''''---------''''''''''''
Dec 27 '18 at 21:19
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53949290%2fis-it-possible-to-parameterize-queuetrigger-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I am uncertain about what you mean by parameterize the trigger name and how it relates to configuration. Can you clarify. I must be misunderstanding what is being asked.
– Nkosi
Dec 27 '18 at 18:31
have a look at docs.microsoft.com/en-us/azure/azure-functions
– Roman Kiss
Dec 27 '18 at 18:34
@Nkosi i dont want to hardcode
translationsqueue
- i want to be able to set this name in configurationn– l--''''''---------''''''''''''
Dec 27 '18 at 18:36
2
QueueTrigger("%translationsqueue%", …)
– Roman Kiss
Dec 27 '18 at 18:40
Ok now I understand.
– Nkosi
Dec 27 '18 at 19:06