Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Azure
GitHub Repository: Azure/Azure-Sentinel-Notebooks
Path: blob/master/src/SentinelUtilities/SentinelUtils/config_reader.py
3255 views
1
# -------------------------------------------------------------------------
2
# Copyright (c) Microsoft Corporation. All rights reserved.
3
# Licensed under the MIT License. See License.txt in the project root for
4
# license information.
5
# --------------------------------------------------------------------------
6
"""
7
Config Reader:
8
This module is used to read JSON config file populated by Azure Notebooks API.
9
"""
10
11
import json
12
13
# pylint: disable-msg=R0903
14
class ConfigReader:
15
""" class to read configuration """
16
17
# pylint: disable-msg=E0213
18
def read_config_values(file_path):
19
""" read configuration """
20
with open(file_path) as json_file:
21
if json_file:
22
json_config = json.load(json_file)
23
return (json_config["tenant_id"],
24
json_config["subscription_id"],
25
json_config["resource_group"],
26
json_config["workspace_id"],
27
json_config["workspace_name"])
28
return None
29
30