Skip to content

Commit

Permalink
[DeploymentScripts] inclusion of storage account settings (#9157)
Browse files Browse the repository at this point in the history
* inclusion of storage account settings

* included examples

* removed restartPolicy

* updated sample response

* updated based on feedback

* renamed file

* updated file name to prevent case sensitive error

Co-authored-by: Jorge Cotillo <jorge.cotillo@cotillo-corp.com>
  • Loading branch information
jorgecotillo and jorgecotillo-fork authored Apr 28, 2020
1 parent de43e7f commit 0abe9e9
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
},
"DeploymentScriptsCreate_MinCreate": {
"$ref": "./examples/DeploymentScripts_Min_Create.json"
},
"DeploymentScriptsCreate_UsingCustomACIName": {
"$ref": "./examples/DeploymentScripts_Create_Using_Custom_Aci_Name.json"
},
"DeploymentScriptsCreate_UsingExistingStorageAccount": {
"$ref": "./examples/DeploymentScripts_Create_Using_Existing_StorageAccount.json"
}
},
"parameters": [
Expand Down Expand Up @@ -614,6 +620,11 @@
"description": "Container settings.",
"$ref": "#/definitions/ContainerConfiguration"
},
"storageAccountSettings": {
"type": "object",
"description": "Storage Account settings.",
"$ref": "#/definitions/StorageAccountConfiguration"
},
"cleanupPreference": {
"type": "string",
"description": "The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.",
Expand Down Expand Up @@ -673,6 +684,21 @@
}
}
},
"StorageAccountConfiguration": {
"type": "object",
"description": "Settings to use an existing storage account. Valid storage account kinds are: Storage, StorageV2 and FileStorage",
"properties": {
"storageAccountName": {
"type": "string",
"description": "The storage account name."
},
"storageAccountKey": {
"type": "string",
"description": "The storage account access key.",
"x-ms-secret": true
}
}
},
"ScriptStatus": {
"type": "object",
"description": "Generic object modeling results of script execution.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"parameters": {
"api-version": "2019-10-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "script-rg",
"scriptName": "MyDeploymentScript",
"deploymentScript": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"properties": {
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"containerSettings": {
"containerGroupName": "contoso-aci"
},
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"retentionInterval": "PT7D",
"timeout": "PT1H",
"cleanupPreference": "Always"
}
}
},
"responses": {
"201": {
"body": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-01T01:01:01.1075056Z"
},
"properties": {
"provisioningState": "Creating",
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"retentionInterval": "P7D",
"timeout": "PT1H",
"containerSettings": {
"containerGroupName": "contoso-aci"
},
"cleanupPreference": "Always",
"status": {
"containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage",
"startTime": "2018-11-13T15:19:45-08:00",
"endTime": "2018-11-13T15:19:45-08:00",
"expirationTime": "2018-11-13T15:19:45-08:00"
}
}
}
},
"200": {
"body": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"properties": {
"provisioningState": "Succeeded",
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"retentionInterval": "P7D",
"timeout": "PT1H",
"containerSettings": {
"containerGroupName": "contoso-aci"
},
"cleanupPreference": "Always",
"status": {
"containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage",
"startTime": "2018-11-13T15:19:45-08:00",
"endTime": "2018-11-13T15:19:45-08:00",
"expirationTime": "2018-11-13T15:19:45-08:00"
},
"outputs": {
"output1": "value1"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"parameters": {
"api-version": "2019-10-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "script-rg",
"scriptName": "MyDeploymentScript",
"deploymentScript": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"properties": {
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"storageAccountSettings": {
"storageAccountName": "contosostorage",
"storageAccountKey": "contosostoragekey"
},
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"retentionInterval": "PT7D",
"timeout": "PT1H",
"cleanupPreference": "Always"
}
}
},
"responses": {
"201": {
"body": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-01T01:01:01.1075056Z"
},
"properties": {
"provisioningState": "Creating",
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"storageAccountSettings": {
"storageAccountName": "contosostorage"
},
"retentionInterval": "P7D",
"timeout": "PT1H",
"cleanupPreference": "Always",
"status": {
"containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage",
"startTime": "2018-11-13T15:19:45-08:00",
"endTime": "2018-11-13T15:19:45-08:00",
"expirationTime": "2018-11-13T15:19:45-08:00"
}
}
}
},
"200": {
"body": {
"kind": "AzurePowerShell",
"location": "westus",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}
}
},
"properties": {
"provisioningState": "Succeeded",
"azPowerShellVersion": "1.7.0",
"scriptContent": "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
"arguments": "-Location 'westus' -Name \"*rg2\"",
"supportingScriptUris": [
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script"
],
"storageAccountSettings": {
"storageAccountName": "contosostorage"
},
"retentionInterval": "P7D",
"timeout": "PT1H",
"cleanupPreference": "Always",
"status": {
"containerInstanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer",
"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage",
"startTime": "2018-11-13T15:19:45-08:00",
"endTime": "2018-11-13T15:19:45-08:00",
"expirationTime": "2018-11-13T15:19:45-08:00"
},
"outputs": {
"output1": "value1"
}
}
}
}
}
}

0 comments on commit 0abe9e9

Please sign in to comment.