我正在研究 Microsoft Graph API (python3)。get_alerts()
and返回结果get_secure_score_control_profiles()
但get_secure_score()
正在返回'None'
。
Azure 门户显示安全分数,但该函数返回,尽管响应状态为 200。任何指针?
def get_secure_score():
base_url = 'https://graph.microsoft.com/beta/security/secureScores'
#or
#base_url = 'https://graph.microsoft.com/v1.0/security/secureScores'
secure_scores = MSGRAPH.get(base_url).json()
print(secure_scores)
secure_scores = secure_scores.json()
print(secure_scores)
if b'' in secure_scores:
print("Please Sign-in using a on.microsoft.com account for demo data")
secure_scores = None
elif 'error' in secure_scores:
secure_scores = None
elif len(secure_scores.get('value')) > 0:
secure_scores = secure_scores.get('value')[0]
else:
secure_scores = None
return secure_scores
- 网址:
https://graph.microsoft.com/beta/security/secureScores
- 回复:
Response [200]
- 响应输出:
{ '@odata.context': 'https://graph.microsoft.com/beta/$metadata#Security/secureScores', 'value': [] }