Share via


Passing Subscription Key

Question

Tuesday, May 26, 2015 7:42 PM

Is there a way to have the Azure subscription key passed back to my rest services that they are connected to?

Thanks

Ralph

All replies (2)

Tuesday, May 26, 2015 8:10 PM âś…Answered

Hi Ralph,

Yes, you can use policy expressions to pass the subscription key forward with the set query parameter policy:

<set-query-parametername="key" exists-action="override"><value>@(context.Subscription.Key)</value></set-query-parameter>

If this doesn't work, here's the documentation for policies and expressions:

https://msdn.microsoft.com/en-us/library/azure/7406a8ce-5f9c-4fae-9b0f-e574befb2ee9#SetQueryStringParameter

https://msdn.microsoft.com/en-us/library/azure/dn910913.aspx

Thanks,

Anton


Friday, May 29, 2015 9:17 PM

Great thanks.