Skip to main content

script_executions

Creates, updates, deletes, gets or lists a script_executions resource.

Overview

Namescript_executions
TypeResource
Idazure_isv.avs.script_executions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
errorsarrayStandard error output stream from the powershell execution.
failureReasonstringError message if the script was able to run, but if the script itself had errors or powershell threw an exception.
finishedAtstring (date-time)Time the script execution was finished.
hiddenParametersarrayParameters that will be hidden/not visible to ARM, such as passwords and credentials.
informationarrayStandard information out stream from the powershell execution.
namedOutputsobjectUser-defined dictionary.
outputarrayStandard output stream from the powershell execution.
parametersarrayParameters the script will accept.
provisioningStatestringThe state of the script execution resource. Known values are: "Succeeded", "Failed", "Canceled", "Pending", "Running", "Cancelling", "Cancelled", and "Deleting". (Succeeded, Failed, Canceled, Pending, Running, Cancelling, Cancelled, Deleting)
retentionstringTime to live for the resource. If not provided, will be available for 60 days.
scriptCmdletIdstringA reference to the script cmdlet resource if user is running a AVS script.
startedAtstring (date-time)Time the script execution was started.
submittedAtstring (date-time)Time the script execution was submitted.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
timeoutstringTime limit for execution. Required.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
warningsarrayStandard warning out stream from the powershell execution.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, private_cloud_name, script_execution_name, subscription_idGet a ScriptExecution.
listselectresource_group_name, private_cloud_name, subscription_idList ScriptExecution resources by PrivateCloud.
create_or_updateinsertresource_group_name, private_cloud_name, script_execution_name, subscription_idCreate a ScriptExecution.
create_or_updatereplaceresource_group_name, private_cloud_name, script_execution_name, subscription_idCreate a ScriptExecution.
deletedeleteresource_group_name, private_cloud_name, script_execution_name, subscription_idDelete a ScriptExecution.
get_execution_logsexecresource_group_name, private_cloud_name, script_execution_name, subscription_idReturn the logs for a script execution resource.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
private_cloud_namestringName of the private cloud. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
script_execution_namestringName of the script cmdlet. Required.
subscription_idstring

SELECT examples

Get a ScriptExecution.

SELECT
id,
name,
errors,
failureReason,
finishedAt,
hiddenParameters,
information,
namedOutputs,
output,
parameters,
provisioningState,
retention,
scriptCmdletId,
startedAt,
submittedAt,
systemData,
timeout,
type,
warnings
FROM azure_isv.avs.script_executions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND private_cloud_name = '{{ private_cloud_name }}' -- required
AND script_execution_name = '{{ script_execution_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a ScriptExecution.

INSERT INTO azure_isv.avs.script_executions (
properties,
resource_group_name,
private_cloud_name,
script_execution_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ private_cloud_name }}',
'{{ script_execution_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Create a ScriptExecution.

REPLACE azure_isv.avs.script_executions
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND private_cloud_name = '{{ private_cloud_name }}' --required
AND script_execution_name = '{{ script_execution_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a ScriptExecution.

DELETE FROM azure_isv.avs.script_executions
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND private_cloud_name = '{{ private_cloud_name }}' --required
AND script_execution_name = '{{ script_execution_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Return the logs for a script execution resource.

EXEC azure_isv.avs.script_executions.get_execution_logs 
@resource_group_name='{{ resource_group_name }}' --required,
@private_cloud_name='{{ private_cloud_name }}' --required,
@script_execution_name='{{ script_execution_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;