Getting error in Linux printing Security group in azure

Hassan Turi 21 Reputation points
2022-05-20T16:55:53.027+00:00

I have this code and I have written it in windows. and it works fine in windows but when I run it on Linux and I have to run it on Linux as of my project needs and it does not work there and gives me the following error

AttributeError: 'ServicePrincipalCredentials' object has no attribute 'get_token'

from azure.mgmt.security import SecurityCenter
from azure.common.credentials import ServicePrincipalCredentials
import Credentials
from pprint import pprint

client = SecurityCenter(Credentials.credential,Credentials.subscription_id,asc_location="")

for score in client.secure_scores.list():
   print(score)
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,881 questions
{count} votes