mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 20:38:06 +00:00
Reverting Enable/Disable App Function Changes - Force -net
App Function To Only Run Agent
Functions (#2660)
* Testing app function. * Addding functions back. * Fixing name. * updating to string. * Fixing bicep. * Fixing function names. * Update src/ApiService/ApiService/Functions/ReproVmss.cs Co-authored-by: George Pollard <gpollard@microsoft.com> * Adding route specifier. * Update src/ApiService/ApiService/Functions/NodeAddSshKey.cs Co-authored-by: George Pollard <gpollard@microsoft.com> * Update src/ApiService/ApiService/Functions/WebhookLogs.cs Co-authored-by: George Pollard <gpollard@microsoft.com> * Update src/ApiService/ApiService/Functions/WebhookPing.cs Co-authored-by: George Pollard <gpollard@microsoft.com> * Fixing function names. * Increasing pool_size * Adding logging statements. * Adding check for transient failure. * Adding check to else. * Fix var * Adding retry logic to dbg_lnx * FIxing retry. * Maybe fixed integration test. * Formatting. * Adding try and fail logic. * Changing error. * Refactoring logic. * Fixing logic. * Logic. * Removing bad comparison. * Fixing. * All ready. * Switching back to call. * Add. * Fixing * Adding quit back. * Reversing cli changes. * Removing bad file. * Formatting. Co-authored-by: George Pollard <gpollard@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
d17d50d536
commit
7fc6fc3668
@ -46,7 +46,7 @@ public class NodeAddSshKey {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Function("node_add_ssh_key")]
|
[Function("NodeAddSshKey")]
|
||||||
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "node/add_ssh_key")] HttpRequestData req) {
|
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "node/add_ssh_key")] HttpRequestData req) {
|
||||||
return _auth.CallIfUser(req, r => r.Method switch {
|
return _auth.CallIfUser(req, r => r.Method switch {
|
||||||
"POST" => Post(r),
|
"POST" => Post(r),
|
||||||
|
@ -16,7 +16,7 @@ public class Proxy {
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Function("proxy")]
|
[Function("Proxy")]
|
||||||
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "PATCH", "POST", "DELETE")] HttpRequestData req) {
|
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "PATCH", "POST", "DELETE")] HttpRequestData req) {
|
||||||
return _auth.CallIfUser(req, r => r.Method switch {
|
return _auth.CallIfUser(req, r => r.Method switch {
|
||||||
"GET" => Get(r),
|
"GET" => Get(r),
|
||||||
|
@ -15,8 +15,8 @@ public class ReproVmss {
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Function("repro_vms")]
|
[Function("ReproVms")]
|
||||||
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "POST", "DELETE")] HttpRequestData req) {
|
public Async.Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "POST", "DELETE", Route = "repro_vms")] HttpRequestData req) {
|
||||||
return _auth.CallIfUser(req, r => r.Method switch {
|
return _auth.CallIfUser(req, r => r.Method switch {
|
||||||
"GET" => Get(r),
|
"GET" => Get(r),
|
||||||
"POST" => Post(r),
|
"POST" => Post(r),
|
||||||
|
@ -15,7 +15,7 @@ public class WebhookLogs {
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Function("Webhook_logs")]
|
[Function("WebhookLogs")]
|
||||||
public Async.Task<HttpResponseData> Run(
|
public Async.Task<HttpResponseData> Run(
|
||||||
[HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/logs")] HttpRequestData req) {
|
[HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/logs")] HttpRequestData req) {
|
||||||
return _auth.CallIfUser(req, r => r.Method switch {
|
return _auth.CallIfUser(req, r => r.Method switch {
|
||||||
|
@ -15,7 +15,7 @@ public class WebhookPing {
|
|||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Function("Webhook_ping")]
|
[Function("WebhookPing")]
|
||||||
public Async.Task<HttpResponseData> Run(
|
public Async.Task<HttpResponseData> Run(
|
||||||
[HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/ping")] HttpRequestData req) {
|
[HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/ping")] HttpRequestData req) {
|
||||||
return _auth.CallIfUser(req, r => r.Method switch {
|
return _auth.CallIfUser(req, r => r.Method switch {
|
||||||
|
@ -278,6 +278,46 @@ module functionSettings 'bicep-templates/function-settings.bicep' = {
|
|||||||
monitor_account_name: operationalInsights.outputs.monitorAccountName
|
monitor_account_name: operationalInsights.outputs.monitorAccountName
|
||||||
multi_tenant_domain: multi_tenant_domain
|
multi_tenant_domain: multi_tenant_domain
|
||||||
enable_profiler: enable_profiler
|
enable_profiler: enable_profiler
|
||||||
|
functions_disabled: '0'
|
||||||
|
agent_function_names: [
|
||||||
|
'AgentCanSchedule' //0
|
||||||
|
'AgentCommands' //1
|
||||||
|
'AgentEvents' //2
|
||||||
|
'AgentRegistration' //3
|
||||||
|
'Containers' //4
|
||||||
|
'Download' //5
|
||||||
|
'Info' //6
|
||||||
|
'InstanceConfig' //7
|
||||||
|
'Jobs' //8
|
||||||
|
'JobTemplates' //9
|
||||||
|
'JobTemplatesManage' //10
|
||||||
|
'Negotiate' //11
|
||||||
|
'Node' //12
|
||||||
|
'NodeAddSshKey' //13
|
||||||
|
'Notifications' //14
|
||||||
|
'Pool' //15
|
||||||
|
'Proxy' //16
|
||||||
|
'QueueFileChanges' //17
|
||||||
|
'QueueNodeHeartbeat' //18
|
||||||
|
'QueueProxyUpdate' //19
|
||||||
|
'QueueSignalrEvents' //20
|
||||||
|
'QueueTaskHeartbeat' //21
|
||||||
|
'QueueUpdates' //22
|
||||||
|
'QueueWebhooks' //23
|
||||||
|
'ReproVms' //24
|
||||||
|
'Scaleset' //25
|
||||||
|
'Tasks' //26
|
||||||
|
'TimerDaily' //27
|
||||||
|
'TimerProxy' //28
|
||||||
|
'TimerRepro' //29
|
||||||
|
'TimerRetention' //30
|
||||||
|
'TimerTasks' //31
|
||||||
|
'TimerWorkers' //32
|
||||||
|
'Tools' //33
|
||||||
|
'Webhooks' //34
|
||||||
|
'WebhooksLogs' //35
|
||||||
|
'WebhooksPing' //36
|
||||||
|
]
|
||||||
}
|
}
|
||||||
dependsOn: [
|
dependsOn: [
|
||||||
function
|
function
|
||||||
@ -304,6 +344,46 @@ module netFunctionSettings 'bicep-templates/function-settings.bicep' = {
|
|||||||
monitor_account_name: operationalInsights.outputs.monitorAccountName
|
monitor_account_name: operationalInsights.outputs.monitorAccountName
|
||||||
multi_tenant_domain: multi_tenant_domain
|
multi_tenant_domain: multi_tenant_domain
|
||||||
enable_profiler: enable_profiler
|
enable_profiler: enable_profiler
|
||||||
|
functions_disabled: '1'
|
||||||
|
agent_function_names: [
|
||||||
|
'AgentCanSchedule' //0
|
||||||
|
'AgentCommands' //1
|
||||||
|
'AgentEvents' //2
|
||||||
|
'AgentRegistration' //3
|
||||||
|
'Containers' //4
|
||||||
|
'Download' //5
|
||||||
|
'Info' //6
|
||||||
|
'InstanceConfig' //7
|
||||||
|
'Jobs' //8
|
||||||
|
'JobTemplates' //9
|
||||||
|
'JobTemplatesManage' //10
|
||||||
|
'Negotiate' //11
|
||||||
|
'Node' //12
|
||||||
|
'NodeAddSshKey' //13
|
||||||
|
'Notifications' //14
|
||||||
|
'Pool' //15
|
||||||
|
'Proxy' //16
|
||||||
|
'QueueFileChanges' //17
|
||||||
|
'QueueNodeHeartbeat' //18
|
||||||
|
'QueueProxyUpdate' //19
|
||||||
|
'QueueSignalrEvents' //20
|
||||||
|
'QueueTaskHeartbeat' //21
|
||||||
|
'QueueUpdates' //22
|
||||||
|
'QueueWebhooks' //23
|
||||||
|
'ReproVms' //24
|
||||||
|
'Scaleset' //25
|
||||||
|
'Tasks' //26
|
||||||
|
'TimerDaily' //27
|
||||||
|
'TimerProxy' //28
|
||||||
|
'TimerRepro' //29
|
||||||
|
'TimerRetention' //30
|
||||||
|
'TimerTasks' //31
|
||||||
|
'TimerWorkers' //32
|
||||||
|
'Tools' //33
|
||||||
|
'Webhooks' //34
|
||||||
|
'WebhookLogs' //35
|
||||||
|
'WebhookPing' //36
|
||||||
|
]
|
||||||
}
|
}
|
||||||
dependsOn: [
|
dependsOn: [
|
||||||
netFunction
|
netFunction
|
||||||
|
@ -5,10 +5,10 @@ param allFunctions array
|
|||||||
var disabledFunctions = [for f in allFunctions: 'AzureWebJobs.${f}.Disabled' ]
|
var disabledFunctions = [for f in allFunctions: 'AzureWebJobs.${f}.Disabled' ]
|
||||||
|
|
||||||
var disabledFunctionsAppSettings = {
|
var disabledFunctionsAppSettings = {
|
||||||
'${disabledFunctions[0]}' : functions_disabled_setting
|
'${disabledFunctions[0]}' : 0
|
||||||
'${disabledFunctions[1]}' : functions_disabled_setting
|
'${disabledFunctions[1]}' : 0
|
||||||
'${disabledFunctions[2]}' : functions_disabled_setting
|
'${disabledFunctions[2]}' : 0
|
||||||
'${disabledFunctions[3]}' : functions_disabled_setting
|
'${disabledFunctions[3]}' : 0
|
||||||
'${disabledFunctions[4]}' : functions_disabled_setting
|
'${disabledFunctions[4]}' : functions_disabled_setting
|
||||||
|
|
||||||
'${disabledFunctions[5]}' : functions_disabled_setting
|
'${disabledFunctions[5]}' : functions_disabled_setting
|
||||||
|
@ -26,14 +26,27 @@ param monitor_account_name string
|
|||||||
param functions_worker_runtime string
|
param functions_worker_runtime string
|
||||||
param functions_extension_version string
|
param functions_extension_version string
|
||||||
|
|
||||||
|
param agent_function_names array
|
||||||
|
param functions_disabled string
|
||||||
|
|
||||||
param enable_profiler bool
|
param enable_profiler bool
|
||||||
|
|
||||||
|
var disabledFunctionName = 'disabledFunctions-${name}'
|
||||||
|
|
||||||
var telemetry = 'd7a73cf4-5a1a-4030-85e1-e5b25867e45a'
|
var telemetry = 'd7a73cf4-5a1a-4030-85e1-e5b25867e45a'
|
||||||
|
|
||||||
resource function 'Microsoft.Web/sites@2021-02-01' existing = {
|
resource function 'Microsoft.Web/sites@2021-02-01' existing = {
|
||||||
name: name
|
name: name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module disabledFunctions 'function-settings-disabled-apps.bicep' = {
|
||||||
|
name: disabledFunctionName
|
||||||
|
params:{
|
||||||
|
functions_disabled_setting: functions_disabled
|
||||||
|
allFunctions: agent_function_names
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var enable_profilers = enable_profiler ? {
|
var enable_profilers = enable_profiler ? {
|
||||||
APPINSIGHTS_PROFILERFEATURE_VERSION : '1.0.0'
|
APPINSIGHTS_PROFILERFEATURE_VERSION : '1.0.0'
|
||||||
DiagnosticServices_EXTENSION_VERSION: '~3'
|
DiagnosticServices_EXTENSION_VERSION: '~3'
|
||||||
@ -63,5 +76,5 @@ resource functionSettings 'Microsoft.Web/sites/config@2021-03-01' = {
|
|||||||
ONEFUZZ_KEYVAULT: keyvault_name
|
ONEFUZZ_KEYVAULT: keyvault_name
|
||||||
ONEFUZZ_OWNER: owner
|
ONEFUZZ_OWNER: owner
|
||||||
ONEFUZZ_CLIENT_SECRET: client_secret
|
ONEFUZZ_CLIENT_SECRET: client_secret
|
||||||
}, enable_profilers)
|
}, disabledFunctions.outputs.appSettings, enable_profilers)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user