diff --git a/src/ApiService/ApiService/OneFuzzTypes/Model.cs b/src/ApiService/ApiService/OneFuzzTypes/Model.cs index 24e8618f77..6580fcce08 100644 --- a/src/ApiService/ApiService/OneFuzzTypes/Model.cs +++ b/src/ApiService/ApiService/OneFuzzTypes/Model.cs @@ -972,7 +972,8 @@ public record TaskUnitConfig( TaskType TaskType, string? InstanceTelemetryKey, string? MicrosoftTelemetryKey, - Uri HeartbeatQueue + Uri HeartbeatQueue, + Dictionary Tags ) { public Uri? inputQueue { get; set; } public String? SupervisorExe { get; set; } diff --git a/src/ApiService/ApiService/onefuzzlib/Config.cs b/src/ApiService/ApiService/onefuzzlib/Config.cs index 44f7790060..14139fbed3 100644 --- a/src/ApiService/ApiService/onefuzzlib/Config.cs +++ b/src/ApiService/ApiService/onefuzzlib/Config.cs @@ -70,7 +70,8 @@ private static BlobContainerSasPermissions ConvertPermissions(ContainerPermissio TaskType: task.Config.Task.Type, InstanceTelemetryKey: _serviceConfig.ApplicationInsightsInstrumentationKey, MicrosoftTelemetryKey: _serviceConfig.OneFuzzTelemetry, - HeartbeatQueue: await _queue.GetQueueSas("task-heartbeat", StorageType.Config, QueueSasPermissions.Add) ?? throw new Exception("unable to get heartbeat queue sas") + HeartbeatQueue: await _queue.GetQueueSas("task-heartbeat", StorageType.Config, QueueSasPermissions.Add) ?? throw new Exception("unable to get heartbeat queue sas"), + Tags: task.Config.Tags ?? new Dictionary() ); if (definition.MonitorQueue != null) { diff --git a/src/agent/onefuzz-task/src/local/common.rs b/src/agent/onefuzz-task/src/local/common.rs index d7a7130633..98ecc149ad 100644 --- a/src/agent/onefuzz-task/src/local/common.rs +++ b/src/agent/onefuzz-task/src/local/common.rs @@ -266,6 +266,7 @@ pub async fn build_local_context( microsoft_telemetry_key: None, logs: None, min_available_memory_mb: 0, + tags: Default::default(), from_agent_to_task_endpoint: "/".to_string(), from_task_to_agent_endpoint: "/".to_string(), }; diff --git a/src/agent/onefuzz-task/src/tasks/config.rs b/src/agent/onefuzz-task/src/tasks/config.rs index 143dee4272..6819b6f4e8 100644 --- a/src/agent/onefuzz-task/src/tasks/config.rs +++ b/src/agent/onefuzz-task/src/tasks/config.rs @@ -18,6 +18,7 @@ use onefuzz_telemetry::{ use reqwest::Url; use serde::{self, Deserialize}; use std::{ + collections::HashMap, path::{Path, PathBuf}, sync::Arc, time::Duration, @@ -68,6 +69,9 @@ pub struct CommonConfig { pub machine_identity: MachineIdentity, + #[serde(default)] + pub tags: HashMap, + pub from_agent_to_task_endpoint: String, pub from_task_to_agent_endpoint: String, } diff --git a/src/agent/onefuzz-task/src/tasks/fuzz/generator.rs b/src/agent/onefuzz-task/src/tasks/fuzz/generator.rs index c34ccc73d8..fa999a02b1 100644 --- a/src/agent/onefuzz-task/src/tasks/fuzz/generator.rs +++ b/src/agent/onefuzz-task/src/tasks/fuzz/generator.rs @@ -308,6 +308,7 @@ mod tests { machine_name: "test".to_string(), scaleset_name: None, }, + tags: Default::default(), from_agent_to_task_endpoint: "/".to_string(), from_task_to_agent_endpoint: "/".to_string(), }, diff --git a/src/agent/onefuzz-task/src/tasks/fuzz/supervisor.rs b/src/agent/onefuzz-task/src/tasks/fuzz/supervisor.rs index fe36c8d6ee..13b7e60b3c 100644 --- a/src/agent/onefuzz-task/src/tasks/fuzz/supervisor.rs +++ b/src/agent/onefuzz-task/src/tasks/fuzz/supervisor.rs @@ -399,6 +399,7 @@ mod tests { machine_name: "test".to_string(), scaleset_name: None, }, + tags: Default::default(), from_agent_to_task_endpoint: "/".to_string(), from_task_to_agent_endpoint: "/".to_string(), },