How to set optional route value in azure function?

ykl
ykl
Member
242 Points
13 Posts

I'm trying to put optional rout value something like:

ResolveKey/{key}/{resolver?}

But it's not allowing to save it in azure.

Is there any other way to make it optional?

Views: 250
Total Answered: 2
Total Marked As Answer: 2
Posted On: 08-Oct-2023 23:12

Share:   fb twitter linkedin
Answers
Brian
Brian
Moderator
2342 Points
13 Posts
         

Use * before the key name instead of ? as:

ResolveKey/{key}/{*resolver}
Posted On: 10-Oct-2023 01:19
beginer
beginer
Participant
1478 Points
49 Posts
         

Azure Functions now support regular expressions. You can change your routing template to:

ResolveKey/{key}/{*resolver}
Posted On: 10-Oct-2023 04:07
 Log In to Chat