3

I have some REST API that is proxied over Azure API Management. For some reason I'd like make it available public for all requests. From developer point of view I would like to get rid of setting key in header (or request):

Ocp-Apim-Subscription-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is it ever possible?

Dewfy
  • 23,277
  • 13
  • 73
  • 121

1 Answers1

6

Create a new product and make sure to unckeck "require subscription" in its settings. Add your api to that product and publish it.

Such products are called Open. And any API included in any open product will not require subscription key to be invoked. If API is included into both open and non-open product it will accept subscription key if given, but would not require it still.

Mind that without subscription keys it is impossible to collect any per-used call statistics, thus all such calls would be attributed to Anonymous user.

Vitaliy Kurokhtin
  • 7,205
  • 1
  • 19
  • 18
  • 1
    I have already tried this - anyway without `Ocp-Apim-Subscription-Key` response gives 401 error – Dewfy Jan 21 '17 at 11:40
  • Do you pass any key with your request? If you pass key to an API included into open product it would still try to validate that key and if it's invalid - return 401. Key may as well be passed in query as subscription-key parameter. Which URL do you call? Do you have anything like that in there? – Vitaliy Kurokhtin Jan 22 '17 at 14:27
  • Url is absolutely plain without any keys. Saying if I pass this URL directly to origin service it works. – Dewfy Jan 23 '17 at 10:48
  • Could you send an email with your service name and problem description (or link to this SO question) to apimgmt[at]microsoft[dot]com? We'll be able to take a closer look on your config. – Vitaliy Kurokhtin Jan 23 '17 at 19:03
  • 1
    What was the solution? I have the same problem as @Dewfy. I suppose I could create an extra account and hardcode that key as a default value for Ocp-Apim-Subscription-Key for Open endpoints, but I'd rather not have to. – Ð.. Nov 27 '17 at 15:38
  • I found the problem for me - I forgot to *publish* the product. – Ð.. Nov 27 '17 at 16:20