API Management literal string

Casper Rubæk 246 Reputation points
2021-06-27T16:43:56.697+00:00

I need to use a string like this: "<value>SharedAccessSignature sr=servicebus&sig=secret==&se=16249999999&skn=RootManageSharedAccessKey</value>

In API Management policy but I am unable to do this because the policy does not recognize the format. How can I fix this?
I need to be able to set a literal string in the policy so the policy does not consider the format of the string.
I need to use this string in a header to authorize against Service Bus.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,739 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,516 Reputation points Microsoft Employee
    2021-06-28T11:52:48.823+00:00

    @Casper Rubæk I suppose the problem is with the & which needs to be escape with &quot;. So you would need to write it as

       <value>SharedAccessSignature sr=servicebus&quot;sig=secret==&quot;se=16249999999&quot;skn=RootManageSharedAccessKey</value>  
    

    Or use a policy expression like this

       <value>@("SharedAccessSignature sr=servicebus&sig=secret==&se=16249999999&skn=RootManageSharedAccessKey")</value>  
    

0 additional answers

Sort by: Most helpful