Skip to content
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
38 changes: 35 additions & 3 deletions specification/compute/Compute.Management/models.tsp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import "@typespec/rest";
import "@typespec/http";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Rest;
using TypeSpec.Http;
using Versioning;
using Azure.Core;
using Azure.ResourceManager;

Expand Down Expand Up @@ -1254,6 +1256,24 @@ union ExecutionState {
Canceled: "Canceled",
}

/**
* Script shell types.
*/
@added(Versions.v2025_04_01)
union ScriptShellTypes {
string,

/**
* Default script shell type.
*/
Default: "Default",

/**
* Powershell7 script shell type.
*/
Powershell7: "Powershell7",
}

/**
* Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
*/
Expand Down Expand Up @@ -8342,7 +8362,7 @@ model VirtualMachineRunCommandProperties {
}

/**
* Describes the script sources for run command. Use only one of script, scriptUri, commandId.
* Describes the script sources for run command. Use only one of these script sources: script, scriptUri, commandId, galleryScriptReferenceId.
*/
model VirtualMachineRunCommandScriptSource {
/**
Expand All @@ -8356,14 +8376,26 @@ model VirtualMachineRunCommandScriptSource {
scriptUri?: string;

/**
* Specifies a commandId of predefined built-in script.
* Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.
*/
commandId?: string;

/**
* User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
*/
scriptUriManagedIdentity?: RunCommandManagedIdentity;

/**
* Optional. Specify which shell to use for running the script. These values must match those expected by the extension. Currently supported only for Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be already installed on the machine to use Powershell7 parameter value.
*/
@added(Versions.v2025_04_01)
scriptShell?: ScriptShellTypes;

/**
* The resource ID of a Gallery Script version that needs to be executed. Example ID looks like /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}.
*/
@added(Versions.v2025_04_01)
galleryScriptReferenceId?: string;
}

/**
Expand Down Expand Up @@ -8460,7 +8492,7 @@ model VirtualMachineRunCommandUpdate extends UpdateResource {
*/
model RunCommandInput {
/**
* The run command id.
* Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.
*/
commandId: string;

Expand Down
2 changes: 1 addition & 1 deletion specification/compute/Compute.Management/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ interface VirtualMachineRunCommandsOperationGroup {
...LocationResourceParameter,

/**
* The command id.
* Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.
*/
@path
commandId: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@
{
"name": "commandId",
"in": "path",
"description": "The command id.",
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.",
"required": true,
"type": "string"
},
Expand Down Expand Up @@ -16941,7 +16941,7 @@
"properties": {
"commandId": {
"type": "string",
"description": "The run command id."
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands."
},
"script": {
"type": "array",
Expand Down Expand Up @@ -19566,7 +19566,7 @@
},
"VirtualMachineRunCommandScriptSource": {
"type": "object",
"description": "Describes the script sources for run command. Use only one of script, scriptUri, commandId.",
"description": "Describes the script sources for run command. Use only one of these script sources: script, scriptUri, commandId, galleryScriptReferenceId.",
"properties": {
"script": {
"type": "string",
Expand All @@ -19578,7 +19578,7 @@
},
"commandId": {
"type": "string",
"description": "Specifies a commandId of predefined built-in script."
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands."
},
"scriptUriManagedIdentity": {
"$ref": "#/definitions/RunCommandManagedIdentity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@
{
"name": "commandId",
"in": "path",
"description": "The command id.",
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.",
"required": true,
"type": "string"
},
Expand Down Expand Up @@ -16941,7 +16941,7 @@
"properties": {
"commandId": {
"type": "string",
"description": "The run command id."
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands."
},
"script": {
"type": "array",
Expand Down Expand Up @@ -17118,6 +17118,30 @@
}
}
},
"ScriptShellTypes": {
"type": "string",
"description": "Script shell types.",
"enum": [
"Default",
"Powershell7"
],
"x-ms-enum": {
"name": "ScriptShellTypes",
"modelAsString": true,
"values": [
{
"name": "Default",
"value": "Default",
"description": "Default script shell type."
},
{
"name": "Powershell7",
"value": "Powershell7",
"description": "Powershell7 script shell type."
}
]
}
},
"SecurityEncryptionTypes": {
"type": "string",
"description": "Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs.",
Expand Down Expand Up @@ -19566,7 +19590,7 @@
},
"VirtualMachineRunCommandScriptSource": {
"type": "object",
"description": "Describes the script sources for run command. Use only one of script, scriptUri, commandId.",
"description": "Describes the script sources for run command. Use only one of these script sources: script, scriptUri, commandId, galleryScriptReferenceId.",
"properties": {
"script": {
"type": "string",
Expand All @@ -19578,11 +19602,19 @@
},
"commandId": {
"type": "string",
"description": "Specifies a commandId of predefined built-in script."
"description": "Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands."
},
"scriptUriManagedIdentity": {
"$ref": "#/definitions/RunCommandManagedIdentity",
"description": "User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged."
},
"scriptShell": {
"$ref": "#/definitions/ScriptShellTypes",
"description": "Optional. Specify which shell to use for running the script. These values must match those expected by the extension. Currently supported only for Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be already installed on the machine to use Powershell7 parameter value."
},
"galleryScriptReferenceId": {
"type": "string",
"description": "The resource ID of a Gallery Script version that needs to be executed. Example ID looks like /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}."
}
}
},
Expand Down
Loading