Add --use_dotnet_agent_functions to deploy.py and Python service (#2292)

This commit is contained in:
George Pollard
2022-08-25 11:50:01 +12:00
committed by GitHub
parent 0133b3e42f
commit e263b245f5
4 changed files with 56 additions and 34 deletions

View File

@ -82,16 +82,13 @@ def get_instance_url() -> str:
@cached
def python_agent_functions_are_disabled() -> bool:
# note that we only check one function here;
# these should be enabled or disabled as a group
return os.environ["AzureWebJobs_agent_can_schedule_Disabled"] == "1"
# periods become underscores here
def use_dotnet_agent_functions() -> bool:
return os.environ.get("ONEFUZZ_USE_DOTNET_AGENT_FUNCTIONS") == "1"
@cached
def get_agent_instance_url() -> str:
if python_agent_functions_are_disabled():
if use_dotnet_agent_functions():
return "https://%s-net.azurewebsites.net" % get_instance_name()
else:
return get_instance_url()