Search code examples
python-3.xazure-devopsazure-pipelines-tasks

Azure release syntax error with Python script task accessing the predefined variables


In azure devops I have release task run python script. Its giving me syntax error while accessing the predefined variable.

SyntaxError: invalid decimal literal

import requests
import adal
import json

clientId = $(app-id)
tenantId =$(app-id)
clientSecret = $(secret)
subscription_id = $(SUBSid)

Solution

  • I can reproduce your issue.

    Suggest you to use these code to get the variables you defined:

      import requests
      import adal
      import json
      
      clientId = "$(app-id)"
      tenantId = "$(app-id)"
      clientSecret = "$(secret)"
      subscription_id = "$(SUBSid)"
    

    Let me know whether this can help you solve the issue.