Integrate with API Management
- Dominant language
- TypeScript
- Stars
- 147
- Forks
- 96
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 87
Description
### 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.

### 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**

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**

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

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**
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file or test is named. Start by locating the TypeScript SDK entry points for REST invocation and JWT generation, then reproduce the APIM setup and health check described in the issue. Done means requests use the APIM URL while the JWT aud remains the Web PubSub service URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100