Global Reach India UAE USA UK Australia
Azure APIM Subscription Keys | Secure API Access

Azure APIM Subscription Keys

APIM → Subscription Keys → Secure API Access

Learn how to use subscription keys to control access to APIs in Azure API Management

Overview (Simple Explanation)

Azure API Management (APIM) uses subscription keys to identify clients and control access to APIs. Every request to a protected API must include a subscription key.

APIM subscription responsibilities:

  • Authenticate requests using subscription keys
  • Enforce product access and usage limits
  • Monitor API consumption


Step 1: Create a Product in APIM

Products group APIs and control access via subscription keys.

  1. Azure Portal → API Management instance → Products
  2. Click Add Product
  3. Name: My-API-Product
  4. Set approval required: Yes/No depending on access policy
  5. Save the product
Products determine which APIs are accessible with the subscription key.

Step 2: Add APIs to Product

Associate your APIs with the product so subscription keys can access them.

  1. Go to the Product → APIs tab → Add APIs
  2. Select the APIs you want included
  3. Save changes

Step 3: Create or Assign Subscription Keys

Subscription keys can be auto-generated or manually assigned to users or groups.

  1. Go to Product → Subscriptions
  2. Click Add Subscription
  3. Provide name, owner (user/group), and optional primary/secondary keys
  4. Save subscription
✅ Subscription key created successfully and ready to use

Step 4: Call API Using Subscription Key

Include the subscription key in the request header or query string.

// Using header
GET https://<apim-name>.azure-api.net/myapi/endpoint
Ocp-Apim-Subscription-Key: <subscription-key>

// Using query string
GET https://<apim-name>.azure-api.net/myapi/endpoint?subscription-key=<subscription-key>

Step 5: Monitor & Manage Subscription Keys

  • Check usage and quotas for each subscription
  • Regenerate primary or secondary keys if compromised
  • Enable or disable subscriptions as needed
  • Track consumption in APIM Analytics

Final Understanding (One Line)

Subscription keys in APIM control access → Associate APIs with products → Monitor usage and enforce quotas.

💡 Clarifications & FAQ

1. What is a subscription key in APIM?

A subscription key is a unique identifier issued by APIM to clients to access APIs. It ensures authorized consumption and tracks usage.

2. How do I assign a subscription key to a user?

  1. Go to Product → Subscriptions → Add Subscription
  2. Enter the user or group as the owner
  3. Save subscription

3. Can I regenerate keys?

Yes, primary or secondary keys can be regenerated at any time to maintain security.

4. How do I use subscription keys?

Include them in HTTP requests either as a header (Ocp-Apim-Subscription-Key) or query string (?subscription-key=).

5. How do products relate to subscription keys?

Products define which APIs are accessible with a subscription key and enforce quotas, usage limits, and policies.

6. Where can I monitor API usage?

Use APIM Analytics to view request count, subscriptions, quotas, and throttling for all products and APIs.

⚠️ Important Notice: SupportDeskWorld is an independent informational platform. We provide verified, publicly available guides, tutorials, and awareness content. We do not offer direct services, financial advice, legal work, repairs, or government assistance. For official inquiries, please use our Contact Page.
Scroll to Top