Skip to content

Commit

Permalink
merege EVENT_CONFIG into CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
lrakai committed Nov 18, 2023
1 parent b5eaf89 commit 031b555
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
18 changes: 5 additions & 13 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import os

CONFIG = {
'subscription_id': os.environ.get('AZURE_SUBSCRIPTION_ID'),
'client_id' : os.environ.get('AZURE_CLIENT_ID'),
'client_secret' : os.environ.get('AZURE_CLIENT_SECRET'),
'tenant_id' : os.environ.get('AZURE_TENANT_ID'),
'resource_group' : os.environ.get('AZURE_RESOURCE_GROUP', 'my-rg')
}

EVENT_CONFIG = {
'credentials': {
'credential_id' : CONFIG['client_id'],
'credential_key': CONFIG['client_secret']
'credential_id' : os.environ.get('AZURE_CLIENT_ID'),
'credential_key': os.environ.get('AZURE_CLIENT_SECRET')
},
'environment_params': {
'subscription_id': CONFIG['subscription_id'],
'tenant' : CONFIG['tenant_id'],
'resource_group' : CONFIG['resource_group']
'subscription_id': os.environ.get('AZURE_SUBSCRIPTION_ID'),
'tenant' : os.environ.get('AZURE_TENANT_ID'),
'resource_group' : os.environ.get('AZURE_RESOURCE_GROUP', 'my-rg')
}
}
4 changes: 2 additions & 2 deletions src/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
load_dotenv()

import time
from config import EVENT_CONFIG
from config import CONFIG
from vcf import handler


Expand All @@ -14,7 +14,7 @@ def timed_handler(event, context):
return result

def entry():
result = timed_handler(EVENT_CONFIG, None)
result = timed_handler(CONFIG, None)
print(result)

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions src/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time

from config import EVENT_CONFIG
from config import CONFIG

# Beginning of VCF block
from azure.identity import ClientSecretCredential
Expand Down Expand Up @@ -55,5 +55,5 @@ def timed_handler(event, context):


if __name__ == "__main__":
result = timed_handler(EVENT_CONFIG, None)
result = timed_handler(CONFIG, None)
print(result)
4 changes: 2 additions & 2 deletions src/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pkg_resources import resource_stream

from config import EVENT_CONFIG
from config import CONFIG

# Beginning of VCF block
from azure.identity import ClientSecretCredential
Expand Down Expand Up @@ -53,5 +53,5 @@ def timed_handler(event, context):


if __name__ == "__main__":
result = timed_handler(EVENT_CONFIG, None)
result = timed_handler(CONFIG, None)
print(result)

0 comments on commit 031b555

Please sign in to comment.