Skip to content

Commit

Permalink
Merge pull request #501 from Azure/no-deployment-scripts
Browse files Browse the repository at this point in the history
No deployment scripts
  • Loading branch information
danycontre authored Oct 5, 2023
2 parents 1c7970a + 7d22bb7 commit 4c09332
Show file tree
Hide file tree
Showing 25 changed files with 948 additions and 5,182 deletions.
313 changes: 1 addition & 312 deletions workload/arm/brownfield/deployAutoIncreasePremiumFileShareQuota.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.21.1.54444",
"templateHash": "14199085282161303395"
"templateHash": "16017679103062296913"
}
},
"parameters": {
Expand Down Expand Up @@ -2986,317 +2986,6 @@
"[subscriptionResourceId(parameters('sharedServicesSubscriptionId'), 'Microsoft.Resources/deployments', format('RG-{0}', parameters('time')))]"
]
},
{
"condition": "[and(parameters('enableMonitoringAlerts'), empty(parameters('existingLogAnalyticsWorkspaceResourceId')))]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('LA-Workspace-Wait-{0}', parameters('time'))]",
"subscriptionId": "[parameters('sharedServicesSubscriptionId')]",
"resourceGroup": "[variables('varResourceGroupName')]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"name": {
"value": "[format('LA-Workspace-Wait-{0}', parameters('time'))]"
},
"location": {
"value": "[parameters('deploymentLocation')]"
},
"azPowerShellVersion": {
"value": "8.3.0"
},
"cleanupPreference": {
"value": "Always"
},
"timeout": {
"value": "PT10M"
},
"retentionInterval": {
"value": "PT1H"
},
"scriptContent": {
"value": " Write-Host \"Start\"\r\n Get-Date\r\n Start-Sleep -Seconds 60\r\n Write-Host \"Stop\"\r\n Get-Date\r\n "
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.21.1.54444",
"templateHash": "8145106657487286483"
}
},
"parameters": {
"name": {
"type": "string",
"metadata": {
"description": "Required. Display name of the script to be run."
}
},
"userAssignedIdentities": {
"type": "object",
"defaultValue": {},
"metadata": {
"description": "Optional. The ID(s) to assign to the resource."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Optional. Location for all resources."
}
},
"kind": {
"type": "string",
"defaultValue": "AzurePowerShell",
"allowedValues": [
"AzurePowerShell",
"AzureCLI"
],
"metadata": {
"description": "Optional. Type of the script. AzurePowerShell, AzureCLI."
}
},
"azPowerShellVersion": {
"type": "string",
"defaultValue": "3.0",
"metadata": {
"description": "Optional. Azure PowerShell module version to be used."
}
},
"azCliVersion": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Azure CLI module version to be used."
}
},
"scriptContent": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Script body. Max length: 32000 characters. To run an external script, use primaryScriptURI instead."
}
},
"primaryScriptUri": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Uri for the external script. This is the entry point for the external script. To run an internal script, use the scriptContent instead."
}
},
"environmentVariables": {
"type": "secureObject",
"defaultValue": {},
"metadata": {
"description": "Optional. The environment variables to pass over to the script. The list is passed as an object with a key name \"secureList\" and the value is the list of environment variables (array). The list must have a 'name' and a 'value' or a 'secretValue' property for each object."
}
},
"supportingScriptUris": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "Optional. List of supporting files for the external script (defined in primaryScriptUri). Does not work with internal scripts (code defined in scriptContent)."
}
},
"arguments": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Command-line arguments to pass to the script. Arguments are separated by spaces."
}
},
"retentionInterval": {
"type": "string",
"defaultValue": "P1D",
"metadata": {
"description": "Optional. 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)."
}
},
"runOnce": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Optional. When set to false, script will run every time the template is deployed. When set to true, the script will only run once."
}
},
"cleanupPreference": {
"type": "string",
"defaultValue": "Always",
"allowedValues": [
"Always",
"OnSuccess",
"OnExpiration"
],
"metadata": {
"description": "Optional. The clean up preference when the script execution gets in a terminal state. Specify the preference on when to delete the deployment script resources. The default value is Always, which means the deployment script resources are deleted despite the terminal state (Succeeded, Failed, canceled)."
}
},
"containerGroupName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Container group name, if not specified then the name will get auto-generated. Not specifying a 'containerGroupName' indicates the system to generate a unique name which might end up flagging an Azure Policy as non-compliant. Use 'containerGroupName' when you have an Azure Policy that expects a specific naming convention or when you want to fully control the name. 'containerGroupName' property must be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end with a dash and consecutive dashes are not allowed."
}
},
"storageAccountResourceId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. The resource ID of the storage account to use for this deployment script. If none is provided, the deployment script uses a temporary, managed storage account."
}
},
"timeout": {
"type": "string",
"defaultValue": "PT1H",
"metadata": {
"description": "Optional. Maximum allowed script execution time specified in ISO 8601 format. Default value is PT1H - 1 hour; 'PT30M' - 30 minutes; 'P5D' - 5 days; 'P1Y' 1 year."
}
},
"baseTime": {
"type": "string",
"defaultValue": "[utcNow('yyyy-MM-dd-HH-mm-ss')]",
"metadata": {
"description": "Generated. Do not provide a value! This date value is used to make sure the script run every time the template is deployed."
}
},
"lock": {
"type": "string",
"defaultValue": "",
"allowedValues": [
"",
"CanNotDelete",
"ReadOnly"
],
"metadata": {
"description": "Optional. Specify the type of lock."
}
},
"tags": {
"type": "object",
"defaultValue": {},
"metadata": {
"description": "Optional. Tags of the resource."
}
},
"enableDefaultTelemetry": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Enable telemetry via a Globally Unique Identifier (GUID)."
}
}
},
"variables": {
"containerSettings": {
"containerGroupName": "[parameters('containerGroupName')]"
},
"identityType": "[if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None')]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]"
},
"resources": [
{
"condition": "[parameters('enableDefaultTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2021-04-01",
"name": "[format('pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-{0}', uniqueString(deployment().name, parameters('location')))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": []
}
}
},
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"identity": "[variables('identity')]",
"kind": "[parameters('kind')]",
"properties": {
"azPowerShellVersion": "[if(equals(parameters('kind'), 'AzurePowerShell'), parameters('azPowerShellVersion'), null())]",
"azCliVersion": "[if(equals(parameters('kind'), 'AzureCLI'), parameters('azCliVersion'), null())]",
"containerSettings": "[if(not(empty(parameters('containerGroupName'))), variables('containerSettings'), null())]",
"storageAccountSettings": "[if(not(empty(parameters('storageAccountResourceId'))), if(not(empty(parameters('storageAccountResourceId'))), createObject('storageAccountKey', listKeys(parameters('storageAccountResourceId'), '2019-06-01').keys[0].value, 'storageAccountName', last(split(parameters('storageAccountResourceId'), '/'))), createObject()), null())]",
"arguments": "[parameters('arguments')]",
"environmentVariables": "[if(not(empty(parameters('environmentVariables'))), parameters('environmentVariables').secureList, createArray())]",
"scriptContent": "[if(not(empty(parameters('scriptContent'))), parameters('scriptContent'), null())]",
"primaryScriptUri": "[if(not(empty(parameters('primaryScriptUri'))), parameters('primaryScriptUri'), null())]",
"supportingScriptUris": "[if(not(empty(parameters('supportingScriptUris'))), parameters('supportingScriptUris'), null())]",
"cleanupPreference": "[parameters('cleanupPreference')]",
"forceUpdateTag": "[if(parameters('runOnce'), resourceGroup().name, parameters('baseTime'))]",
"retentionInterval": "[parameters('retentionInterval')]",
"timeout": "[parameters('timeout')]"
}
},
{
"condition": "[not(empty(parameters('lock')))]",
"type": "Microsoft.Authorization/locks",
"apiVersion": "2020-05-01",
"scope": "[format('Microsoft.Resources/deploymentScripts/{0}', parameters('name'))]",
"name": "[format('{0}-{1}-lock', parameters('name'), parameters('lock'))]",
"properties": {
"level": "[parameters('lock')]",
"notes": "[if(equals(parameters('lock'), 'CanNotDelete'), 'Cannot delete resource or child resources.', 'Cannot modify the resource or child resources.')]"
},
"dependsOn": [
"[resourceId('Microsoft.Resources/deploymentScripts', parameters('name'))]"
]
}
],
"outputs": {
"resourceId": {
"type": "string",
"metadata": {
"description": "The resource ID of the deployment script."
},
"value": "[resourceId('Microsoft.Resources/deploymentScripts', parameters('name'))]"
},
"resourceGroupName": {
"type": "string",
"metadata": {
"description": "The resource group the deployment script was deployed into."
},
"value": "[resourceGroup().name]"
},
"name": {
"type": "string",
"metadata": {
"description": "The name of the deployment script."
},
"value": "[parameters('name')]"
},
"location": {
"type": "string",
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference(resourceId('Microsoft.Resources/deploymentScripts', parameters('name')), '2020-10-01', 'full').location]"
},
"outputs": {
"type": "object",
"metadata": {
"description": "The output of the deployment script."
},
"value": "[if(contains(reference(resourceId('Microsoft.Resources/deploymentScripts', parameters('name')), '2020-10-01'), 'outputs'), reference(resourceId('Microsoft.Resources/deploymentScripts', parameters('name')), '2020-10-01').outputs, createObject())]"
}
}
}
},
"dependsOn": [
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', parameters('sharedServicesSubscriptionId'), variables('varResourceGroupName')), 'Microsoft.Resources/deployments', format('LA-Workspace-{0}', parameters('time')))]"
]
},
{
"condition": "[not(empty(parameters('existingAutomationAccountResourceId')))]",
"type": "Microsoft.Resources/deployments",
Expand Down
Loading

0 comments on commit 4c09332

Please sign in to comment.