DeploymentScriptsClient icon

DeploymentScriptsClient

The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager

COMMUNITYBEARER0 INSTALLS
OpenAPI Specificationv3.0
{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "The APIs listed in this specification can be used to manage Deployment Scripts resource through the Azure Resource Manager.",
    "title": "DeploymentScriptsClient",
    "version": "2019-10-01-preview",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/resources/resource-manager/Microsoft.Resources/preview/2019-10-01-preview/deploymentScripts.json",
        "version": "2.0"
      }
    ],
    "x-providerName": "azure.com",
    "x-serviceName": "resources-deploymentScripts",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "azure_auth": {
      "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
      "description": "Azure Active Directory OAuth2 Flow",
      "flow": "implicit",
      "scopes": {
        "user_impersonation": "impersonate your user account"
      },
      "type": "oauth2"
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "parameters": {
    "ApiVersionParameter": {
      "description": "Client Api version.",
      "in": "query",
      "name": "api-version",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "client"
    },
    "ResourceGroupNameParameter": {
      "description": "The name of the resource group. The name is case insensitive.",
      "in": "path",
      "maxLength": 90,
      "minLength": 1,
      "name": "resourceGroupName",
      "pattern": "^[-\\w\\._\\(\\)]+$",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "ScriptNameParameter": {
      "description": "Name of the deployment script.",
      "in": "path",
      "maxLength": 90,
      "minLength": 1,
      "name": "scriptName",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "SubscriptionIdParameter": {
      "description": "Subscription Id which forms part of the URI for every service call.",
      "in": "path",
      "name": "subscriptionId",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "client"
    }
  },
  "paths": {
    "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentScripts": {
      "get": {
        "description": "Lists all deployment scripts for a given subscription.",
        "operationId": "DeploymentScripts_ListBySubscription",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Returns a list of deployment scripts.",
            "schema": {
              "$ref": "#/definitions/DeploymentScriptListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsListBySubscription": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "identity": {
                        "type": "UserAssigned",
                        "userAssignedIdentities": {
                          "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                        }
                      },
                      "kind": "AzurePowerShell",
                      "location": "westus",
                      "properties": {
                        "arguments": "-Location 'westus' -Name \"*rg2\"",
                        "azPowerShellVersion": "1.7.0",
                        "cleanupPreference": "Always",
                        "outputs": {
                          "output1": "value1"
                        },
                        "provisioningState": "Succeeded",
                        "retentionInterval": "PT7D",
                        "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                        "status": {
                          "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                          "endTime": "2018-11-13T15:19:45-08:00",
                          "expirationTime": "2018-11-13T15:19:45-08:00",
                          "startTime": "2018-11-13T15:19:45-08:00",
                          "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                        },
                        "timeout": "PT1H"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts": {
      "get": {
        "description": "Lists deployments scripts.",
        "operationId": "DeploymentScripts_ListByResourceGroup",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Returns a list of deployment scripts.",
            "schema": {
              "$ref": "#/definitions/DeploymentScriptListResult"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsList": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "identity": {
                        "type": "UserAssigned",
                        "userAssignedIdentities": {
                          "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                        }
                      },
                      "kind": "AzurePowerShell",
                      "location": "westus",
                      "properties": {
                        "arguments": "-Location 'westus' -Name \"*rg2\"",
                        "azPowerShellVersion": "1.7.0",
                        "cleanupPreference": "Always",
                        "outputs": {
                          "output1": "value1"
                        },
                        "provisioningState": "Succeeded",
                        "retentionInterval": "P7D",
                        "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                        "status": {
                          "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                          "endTime": "2018-11-13T15:19:45-08:00",
                          "expirationTime": "2018-11-13T15:19:45-08:00",
                          "startTime": "2018-11-13T15:19:45-08:00",
                          "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                        },
                        "supportingScriptUris": [
                          "https://uri1.to.supporting.script",
                          "https://uri2.to.supporting.script"
                        ],
                        "timeout": "PT1H"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}": {
      "delete": {
        "description": "Deletes a deployment script. When operation completes, status code 200 returned without content.",
        "operationId": "DeploymentScripts_Delete",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Deployment script deleted."
          },
          "204": {
            "description": "Deployment script does not exist."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsDelete": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "deploymentScript": {
                "identity": {
                  "type": "UserAssigned",
                  "userAssignedIdentities": {
                    "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                  }
                },
                "kind": "AzurePowerShell",
                "location": "westus",
                "properties": {
                  "arguments": "user script arguments",
                  "azPowerShellVersion": "1.7.0",
                  "cleanupPreference": "Always",
                  "outputs": {
                    "output1": "value1"
                  },
                  "provisioningState": "Succeeded",
                  "results": {
                    "aciId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                    "endTime": "2018-11-13T15:19:45-08:00",
                    "expirationTime": "2018-11-13T15:19:45-08:00",
                    "startTime": "2018-11-13T15:19:45-08:00",
                    "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                  },
                  "retentionInterval": "PT7D",
                  "scriptContent": "user script body",
                  "supportingScriptUris": [
                    "https://uri1.to.supporting.script",
                    "https://uri2.to.supporting.script"
                  ],
                  "timeout": "PT1H"
                }
              },
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {},
              "204": {}
            }
          }
        }
      },
      "get": {
        "description": "Gets a deployment script with a given name.",
        "operationId": "DeploymentScripts_Get",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Returns information about the deployment script.",
            "schema": {
              "$ref": "#/definitions/DeploymentScript"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsGet": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "outputs": {
                      "output1": "value1"
                    },
                    "provisioningState": "Succeeded",
                    "retentionInterval": "PT7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "timeout": "PT1H"
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Updates deployment script tags with specified values.",
        "operationId": "DeploymentScripts_Update",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "description": "Deployment script resource with the tags to be updated.",
            "in": "body",
            "name": "deploymentScript",
            "schema": {
              "$ref": "#/definitions/DeploymentScriptUpdateParameter"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Deployment script tags are updated.",
            "schema": {
              "$ref": "#/definitions/DeploymentScript"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsUpdate": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "deploymentScript": {
                "tags": {}
              },
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "outputs": {
                      "output1": "value1"
                    },
                    "provisioningState": "Succeeded",
                    "retentionInterval": "P7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "supportingScriptUris": [
                      "https://uri1.to.supporting.script",
                      "https://uri2.to.supporting.script"
                    ],
                    "timeout": "PT1H"
                  },
                  "tags": {}
                }
              }
            }
          }
        }
      },
      "put": {
        "description": "Creates a deployment script.",
        "operationId": "DeploymentScripts_Create",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "description": "Deployment script supplied to the operation.",
            "in": "body",
            "name": "deploymentScript",
            "required": true,
            "schema": {
              "$ref": "#/definitions/DeploymentScript"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Deployment script is updated.",
            "schema": {
              "$ref": "#/definitions/DeploymentScript"
            }
          },
          "201": {
            "description": "Created -- Deployment script created.",
            "schema": {
              "$ref": "#/definitions/DeploymentScript"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsCreate": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "deploymentScript": {
                "identity": {
                  "type": "UserAssigned",
                  "userAssignedIdentities": {
                    "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                  }
                },
                "kind": "AzurePowerShell",
                "location": "westus",
                "properties": {
                  "arguments": "-Location 'westus' -Name \"*rg2\"",
                  "azPowerShellVersion": "1.7.0",
                  "cleanupPreference": "Always",
                  "retentionInterval": "PT7D",
                  "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                  "supportingScriptUris": [
                    "https://uri1.to.supporting.script",
                    "https://uri2.to.supporting.script"
                  ],
                  "timeout": "PT1H"
                }
              },
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "outputs": {
                      "output1": "value1"
                    },
                    "provisioningState": "Succeeded",
                    "retentionInterval": "P7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "supportingScriptUris": [
                      "https://uri1.to.supporting.script",
                      "https://uri2.to.supporting.script"
                    ],
                    "timeout": "PT1H"
                  }
                }
              },
              "201": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "provisioningState": "Creating",
                    "retentionInterval": "P7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "supportingScriptUris": [
                      "https://uri1.to.supporting.script",
                      "https://uri2.to.supporting.script"
                    ],
                    "timeout": "PT1H"
                  }
                }
              }
            }
          },
          "DeploymentScriptsCreate_MinCreate": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "deploymentScript": {
                "identity": {
                  "type": "UserAssigned",
                  "userAssignedIdentities": {
                    "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                  }
                },
                "kind": "AzurePowerShell",
                "location": "westus",
                "properties": {
                  "arguments": "-Location 'westus' -Name \"*rg2\"",
                  "azPowerShellVersion": "1.7.0",
                  "retentionInterval": "P7D",
                  "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"
                }
              },
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "outputs": {
                      "output1": "value1"
                    },
                    "provisioningState": "Succeeded",
                    "retentionInterval": "P7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "timeout": "PT1H"
                  }
                }
              },
              "201": {
                "body": {
                  "identity": {
                    "type": "UserAssigned",
                    "userAssignedIdentities": {
                      "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
                    }
                  },
                  "kind": "AzurePowerShell",
                  "location": "westus",
                  "properties": {
                    "arguments": "-Location 'westus' -Name \"*rg2\"",
                    "azPowerShellVersion": "1.7.0",
                    "cleanupPreference": "Always",
                    "provisioningState": "Creating",
                    "retentionInterval": "P7D",
                    "scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
                    "status": {
                      "containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
                      "endTime": "2018-11-13T15:19:45-08:00",
                      "expirationTime": "2018-11-13T15:19:45-08:00",
                      "startTime": "2018-11-13T15:19:45-08:00",
                      "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"
                    },
                    "timeout": "PT1H"
                  }
                }
              }
            }
          }
        },
        "x-ms-long-running-operation": true
      }
    },
    "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs": {
      "get": {
        "description": "Gets deployment script logs for a given deployment script name.",
        "operationId": "DeploymentScripts_GetLogs",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Returns deployment script logs if available.",
            "schema": {
              "$ref": "#/definitions/ScriptLogsList"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsGetLogs": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "properties": {
                        "log": "script execution stdout/stderr logs"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs/default": {
      "get": {
        "description": "Gets deployment script logs for a given deployment script name.",
        "operationId": "DeploymentScripts_GetLogsDefault",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/ResourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/ScriptNameParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK -- Returns deployment script logs if available.",
            "schema": {
              "$ref": "#/definitions/ScriptLog"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/DefaultErrorResponse"
            }
          }
        },
        "tags": [
          "DeploymentScripts"
        ],
        "x-ms-examples": {
          "DeploymentScriptsGetLogs": {
            "parameters": {
              "api-version": "2019-10-01-preview",
              "resourceGroupName": "script-rg",
              "scriptName": "MyDeploymentScript",
              "subscriptionId": "00000000-0000-0000-0000-000000000000"
            },
            "responses": {
              "200": {
                "body": {
                  "properties": {
                    "log": "script execution stdout/stderr logs"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "AzureCliScript": {
      "allOf": [
        {
          "$ref": "#/definitions/DeploymentScript"
        }
      ],
      "description": "Object model for the Azure CLI script.",
      "properties": {
        "properties": {
          "$ref": "#/definitions/AzureCliScriptProperties",
          "description": "Properties of the Azure CLI script object.",
          "x-ms-client-flatten": true
        }
      },
      "required": [
        "properties"
      ],
      "type": "object",
      "x-ms-discriminator-value": "AzureCLI"
    },
    "AzureCliScriptProperties": {
      "allOf": [
        {
          "$ref": "#/definitions/DeploymentScriptPropertiesBase"
        },
        {
          "$ref": "#/definitions/ScriptConfigurationBase"
        }
      ],
      "description": "Properties of the Azure CLI script object.",
      "properties": {
        "azCliVersion": {
          "description": "Azure CLI module version to be used.",
          "type": "string"
        }
      },
      "required": [
        "azCliVersion"
      ],
      "type": "object"
    },
    "AzurePowerShellScript": {
      "allOf": [
        {
          "$ref": "#/definitions/DeploymentScript"
        }
      ],
      "description": "Object model for the Azure PowerShell script.",
      "properties": {
        "properties": {
          "$ref": "#/definitions/AzurePowerShellScriptProperties",
          "description": "Properties of the Azure PowerShell script object.",
          "x-ms-client-flatten": true
        }
      },
      "required": [
        "properties"
      ],
      "type": "object",
      "x-ms-discriminator-value": "AzurePowerShell"
    },
    "AzurePowerShellScriptProperties": {
      "allOf": [
        {
          "$ref": "#/definitions/DeploymentScriptPropertiesBase"
        },
        {
          "$ref": "#/definitions/ScriptConfigurationBase"
        }
      ],
      "description": "Properties of the Azure PowerShell script object.",
      "properties": {
        "azPowerShellVersion": {
          "description": "Azure PowerShell module version to be used.",
          "type": "string"
        }
      },
      "required": [
        "azPowerShellVersion"
      ],
      "type": "object"
    },
    "AzureResourceBase": {
      "description": "Common properties for all Azure resources.",
      "properties": {
        "id": {
          "description": "String Id used to locate any resource on Azure.",
          "readOnly": true,
          "type": "string"
        },
        "name": {
          "description": "Name of this resource.",
          "readOnly": true,
          "type": "string"
        },
        "type": {
          "description": "Type of this resource.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object",
      "x-ms-azure-resource": true
    },
    "DefaultErrorResponse": {
      "description": "The details of the error.",
      "properties": {
        "code": {
          "description": "One of a server-defined set of error codes.",
          "type": "string"
        },
        "details": {
          "description": "Detailed errors.",
          "items": {
            "$ref": "#/definitions/DefaultErrorResponse"
          },
          "type": "array"
        },
        "message": {
          "description": "A human-readable representation of the error.",
          "type": "string"
        },
        "target": {
          "description": "The target of the particular error.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "DeploymentScript": {
      "allOf": [
        {
          "$ref": "#/definitions/AzureResourceBase"
        }
      ],
      "description": "Deployment script object.",
      "discriminator": "kind",
      "properties": {
        "identity": {
          "$ref": "#/definitions/ManagedServiceIdentity",
          "description": "Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported."
        },
        "kind": {
          "description": "Type of the script.",
          "enum": [
            "AzurePowerShell",
            "AzureCLI"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "ScriptType"
          }
        },
        "location": {
          "description": "The location of the ACI and the storage account for the deployment script.",
          "type": "string",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Resource tags.",
          "type": "object"
        }
      },
      "required": [
        "identity",
        "location",
        "kind"
      ],
      "type": "object"
    },
    "DeploymentScriptListResult": {
      "description": "List of deployment scripts.",
      "properties": {
        "nextLink": {
          "description": "The URL to use for getting the next set of results.",
          "readOnly": true,
          "type": "string"
        },
        "value": {
          "description": "An array of deployment scripts.",
          "items": {
            "$ref": "#/definitions/DeploymentScript"
          },
          "type": "array"
        }
      }
    },
    "DeploymentScriptPropertiesBase": {
      "description": "Common properties for the deployment script.",
      "properties": {
        "cleanupPreference": {
          "description": "The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.",
          "enum": [
            "Always",
            "OnSuccess",
            "OnExpiration"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "cleanupOptions"
          }
        },
        "outputs": {
          "additionalProperties": {
            "description": "Script output in <name, value> pair.",
            "type": "object"
          },
          "description": "List of script outputs.",
          "readOnly": true,
          "type": "object"
        },
        "provisioningState": {
          "description": "State of the script execution. This only appears in the response.",
          "enum": [
            "Creating",
            "ProvisioningResources",
            "Running",
            "Succeeded",
            "Failed",
            "Canceled"
          ],
          "readOnly": true,
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "ScriptProvisioningState"
          }
        },
        "status": {
          "$ref": "#/definitions/ScriptStatus",
          "description": "Contains the results of script execution.",
          "readOnly": true,
          "type": "object"
        }
      },
      "type": "object",
      "x-ms-external": true
    },
    "DeploymentScriptUpdateParameter": {
      "allOf": [
        {
          "$ref": "#/definitions/AzureResourceBase"
        }
      ],
      "description": "Deployment script parameters to be updated. ",
      "properties": {
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Resource tags to be updated.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "EnvironmentVariable": {
      "description": "The environment variable to pass to the script in the container instance.",
      "properties": {
        "name": {
          "description": "The name of the environment variable.",
          "type": "string"
        },
        "secureValue": {
          "description": "The value of the secure environment variable.",
          "type": "string"
        },
        "value": {
          "description": "The value of the environment variable.",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "LogProperties": {
      "description": "Script log properties.",
      "properties": {
        "log": {
          "description": "Script execution logs in text format.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "ManagedServiceIdentity": {
      "description": "Managed identity generic object.",
      "properties": {
        "type": {
          "description": "Type of the managed identity.",
          "enum": [
            "UserAssigned"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "ManagedServiceIdentityType"
          }
        },
        "userAssignedIdentities": {
          "additionalProperties": {
            "$ref": "#/definitions/UserAssignedIdentity",
            "description": "User-assigned managed identity."
          },
          "description": "The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed identity.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "ScriptConfigurationBase": {
      "description": "Common configuration settings for both Azure PowerShell and Azure CLI scripts.",
      "properties": {
        "arguments": {
          "description": "Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' ",
          "type": "string"
        },
        "environmentVariables": {
          "description": "The environment variables to pass over to the script.",
          "items": {
            "$ref": "#/definitions/EnvironmentVariable"
          },
          "type": "array"
        },
        "forceUpdateTag": {
          "description": "Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID.",
          "type": "string"
        },
        "primaryScriptUri": {
          "description": "Uri for the script. This is the entry point for the external script.",
          "type": "string"
        },
        "retentionInterval": {
          "description": "Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P7D means one week).",
          "format": "duration",
          "type": "string"
        },
        "scriptContent": {
          "description": "Script body.",
          "maxLength": 32000,
          "type": "string"
        },
        "supportingScriptUris": {
          "description": "Supporting files for the external script.",
          "items": {
            "description": "Supporting file Uri.",
            "type": "string"
          },
          "type": "array"
        },
        "timeout": {
          "description": "Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H",
          "format": "duration",
          "type": "string"
        }
      },
      "required": [
        "retentionInterval"
      ],
      "type": "object",
      "x-ms-external": true
    },
    "ScriptLog": {
      "allOf": [
        {
          "$ref": "#/definitions/AzureResourceBase"
        }
      ],
      "description": "Script execution log object.",
      "properties": {
        "properties": {
          "$ref": "#/definitions/LogProperties",
          "x-ms-client-flatten": true
        }
      },
      "type": "object"
    },
    "ScriptLogsList": {
      "description": "Deployment script execution logs.",
      "properties": {
        "value": {
          "description": "Deployment scripts logs.",
          "items": {
            "$ref": "#/definitions/ScriptLog"
          },
          "type": "array"
        }
      }
    },
    "ScriptStatus": {
      "description": "Generic object modeling results of script execution.",
      "properties": {
        "containerInstanceId": {
          "description": "ACI resource Id.",
          "readOnly": true,
          "type": "string"
        },
        "endTime": {
          "description": "End time of the script execution.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "error": {
          "$ref": "#/definitions/DefaultErrorResponse",
          "description": "Error that is relayed from the script execution."
        },
        "expirationTime": {
          "description": "Time the deployment script resource will expire.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "startTime": {
          "description": "Start time of the script execution.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "storageAccountId": {
          "description": "Storage account resource Id.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "UserAssignedIdentity": {
      "description": "User-assigned managed identity.",
      "properties": {
        "clientId": {
          "description": "Client App Id associated with this identity.",
          "type": "string"
        },
        "principalId": {
          "description": "Azure Active Directory principal ID associated with this identity.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}