- Run
npm i
- Create a
.env
file:CLIENT_ID=<appId-from-app-registration> CLIENT_SECRET=<clientSecret-from-app-registration>
https://docs.microsoft.com/en-us/rest/api/apimanagement/current-ga/api-operation/get
To get data from API Management
, you will have to create a new App registration
in Azure Active Directory and add this App registration
as a contributor on the subscription for which you want to retrieve data
- Go to Azure Active Directory and then App registrations
- Create a new registration, you only need to give it a name and a client secret.
- Take a note of the
Application ID
and theClient secret value
- Go to your subscription
- Go to
Access control (IAM)
- Click
Add role assignement
- Choose
Contributor
from the list - On the
Members
tab, select User, group or service principal, clickSelect members
and choose theApp registration
created in the previous step - Click
Review + assign
- Go to
- Add
API_URL
to your.env
file:API_URL=https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.ApiManagement/service/<serviceName>?api-version=2021-08-01
- Add
API_URL
to your.env
file:API_URL=https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.ApiManagement/service/<serviceName>/apis?api-version=2021-08-01
- Add
API_URL
to your.env
file:API_URL=https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.ApiManagement/service/<serviceName>/apis/<apiId>?api-version=2021-08-01
- Add
API_URL
to your.env
file:API_URL=https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.ApiManagement/service/<serviceName>/apis/<apiId>/operations?api-version=2021-08-01
- Add
API_URL
to your.env
file:API_URL=https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.ApiManagement/service/<serviceName>/apis/<apiId>/operations/<operationId>?api-version=2021-08-01
Identifier | Description |
---|---|
subscriptionId | Found in Overview on your API Management service |
resourceGroupName | Found in Overview on your API Management service |
serviceName | The name of your API Management instance |
apiId | The Name property of the API found in Settings for the API |
operationId | The name property for an operation. Found in API Management on the operation under the pencil. Or when querying for all operations |