Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/api-service/__app__/onefuzzlib/workers/scalesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ def setup(self) -> None:
self.scaleset_id,
)

auto_scaling = self.try_to_enable_auto_scaling()
if isinstance(auto_scaling, Error):
self.set_failed(auto_scaling)
return

identity_result = self.try_set_identity(vmss)
if identity_result:
self.set_failed(identity_result)
Expand Down Expand Up @@ -869,6 +874,8 @@ def try_to_enable_auto_scaling(self) -> Optional[Error]:
logging.error(capacity_failed)
return capacity_failed

auto_scale_profile = create_auto_scale_profile(1, capacity, pool_queue_uri)
auto_scale_profile = create_auto_scale_profile(
capacity, capacity, pool_queue_uri
)
logging.info("Added auto scale resource to scaleset: %s" % self.scaleset_id)
return add_auto_scale_to_vmss(self.scaleset_id, auto_scale_profile)
16 changes: 16 additions & 0 deletions src/deployment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"Storage Account Contributor": "17d1049b-9a84-46fb-8f53-869881c3d3ab",
"Virtual Machine Contributor": "9980e02c-c2be-4d73-94e8-173b1dc7cf3c",
"Storage Blob Data Reader": "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1",
"Contributor": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"keyVaultName": "[concat('of-kv-', uniquestring(resourceGroup().id))]"
},
"functions": [
Expand Down Expand Up @@ -819,6 +820,21 @@
"OWNER": "[parameters('owner')]"
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2017-09-01",
"name": "[guid(concat(resourceGroup().id, '-contributor'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Contributor'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-07-01",
Expand Down