0

我正在研究 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': []
    }
    
4

1 回答 1

0

当你第一次在 Azure 上注册你的应用程序时,你的安全分数可能不会立即可用,但你仍然会有其他信息,例如警报和控制配置文件。如果您仍然没有获得安全分数数据,您也可以在此处联系并提交 Github 问题

于 2019-11-05T18:54:25.793 回答