Azure APIM APIOps

David Athukuni 0 Reputation points
2025-06-26T09:08:01.26+00:00

Hello,

I am trying to run the APIOps toolkit with Azure DevOps by following this doc :

We are just a beginner to this tool, so while running the run-extractor.yml file we are facing the below 2 errors. Kindly help us to fix this so that we can proceed further.

  1. Authenticaltion error.
  2. JWT token error

Env variables set for extractor are as below,

AZURE_SUBSCRIPTION_ID = "dev"

AZURE_RESOURCE_GROUP_NAME = "rg-dev"

API_MANAGEMENT_SERVICE_NAME = "apim"

API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH = "$(Build.ArtifactsStagingDirectory)\extracted

CLIENT_ID = "app id"

CLIENT_SECRET = "value"image

image (1)

Thanks,

David

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,465 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Durga Reshma Malthi 6,205 Reputation points Microsoft External Staff Moderator
    2025-06-26T13:07:14.5333333+00:00

    Hi jhansi nallamothu

    The extractor.yaml does not automatically apply those secrets to the environment, the APIOps tool does not load credentials from extractor.yaml directly for authentication.

    Instead, it uses Azure SDK's DefaultAzureCredential, which pulls values from environment variables, not from extractor.yaml.

    Add a step in your Azure DevOps pipeline before the extractor runs to export these variables:

    variables:
      AZURE_SUBSCRIPTION_ID: 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
      AZURE_RESOURCE_GROUP_NAME: 'rg-dev'
      API_MANAGEMENT_SERVICE_NAME: 'apim'
      API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH: '$(Build.ArtifactsStagingDirectory)/extracted'
      # Azure credentials - must be exact variable names for DefaultAzureCredential to work
      AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
      AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
      AZURE_TENANT_ID: $(AZURE_TENANT_ID)
    

    Then in Azure DevOps UI, Go to Pipelines -> Library -> Create a Variable Group -> Add variables -> AZURE_CLIENT_ID, AZURE_CLIENT_SECRET (mark as secret) and AZURE_TENANT_ID

    then link this group in your pipeline with:

    variables:
      - group: <variable group name>
    

    Hope this helps!

    Please Let me know if you have any queries.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.