Skip to content

Integrate with API Management #194

@vicancy

Description

@vicancy

Feature requirement

It requires SDK support when invoking REST API: to successfully call Web PubSub through APIM, the request URL should be the APIM URL, while the aud of JWT token should be Web PubSub URL.

image

How to integrate with API Management service

  1. Create the API Management service using default settings following https://docs.microsoft.com/en-us/azure/api-management/get-started-create-service-instance

  2. Go to APIs => Create from definition => OpenAPI
    a. OpenAPI specification: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/webpubsub/data-plane/WebPubSub/preview/2021-05-01-preview/webpubsub.json
    b. Create
    image

  3. Settings
    a. set Web service URL to the Web PubSub service URL: https://xxxx.webpubsub.azure.com
    b. Uncheck Subscription required (for quick test purpose)
    c. Others remain default settings
    d. Save
    image

  4. All set, now let's test the API
    a. Use the Test tab, choose the API HEAD Get service health status. which does not require Auth, it should return Response 200 OK
    image

    b. Test if the API Management service works, try using the APIM URL https://xxxx.azure-api.net to invoke the health check:
    In terminal,
    batch curl https://xxxx.azure-api.net/api/health?api-version=2021-05-01-preview --head
    It should return HTTP/1.1 200 OK

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions