Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

handle OperationNotAllowed errors when creating VMSS #614

Merged
Merged
5 changes: 3 additions & 2 deletions src/api-service/__app__/onefuzzlib/azure/vmss.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,10 @@ def create_vmss(
resource_group, name, params
)
except ResourceExistsError as err:
if "SkuNotAvailable" in repr(err):
err_str = str(err)
if "SkuNotAvailable" in err_str or "OperationNotAllowed" in err_str:
return Error(
code=ErrorCode.VM_CREATE_FAILED, errors=["creating vmss: %s" % err]
code=ErrorCode.VM_CREATE_FAILED, errors=[f"creating vmss: {err_str}"]
)
raise err
except (ResourceNotFoundError, CloudError) as err:
Expand Down