Skip to content

Commit

Permalink
Merge pull request #20 from Azure/users/alsehr/cleanup
Browse files Browse the repository at this point in the history
Generalized parameters & variables
  • Loading branch information
AlexanderSehr authored Dec 3, 2022
2 parents 6f86633 + 9551400 commit 567650d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .azuredevops/azureDevOpsScaleSet/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ variables:
poolName_dev: '' # Use this for self-hosted agents
poolName_prd: '' # Use this for self-hosted agents

serviceConnection_sbx: 'ModulePlaygroundPrivate'
serviceConnection_dev: 'ModulePlaygroundPrivate'
serviceConnection_prd: 'ModulePlaygroundPrivate'
serviceConnection_sbx: 'sbxConnection'
serviceConnection_dev: 'devConnection'
serviceConnection_prd: 'prdConnection'
#endregion

#region specific
Expand Down
6 changes: 3 additions & 3 deletions .azuredevops/azureImageBuilder/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ variables:
poolName_dev: '' # Use this for self-hosted agents
poolName_prd: '' # Use this for self-hosted agents

serviceConnection_sbx: 'ModulePlaygroundPrivate'
serviceConnection_dev: 'ModulePlaygroundPrivate'
serviceConnection_prd: 'ModulePlaygroundPrivate'
serviceConnection_sbx: 'sbxConnection'
serviceConnection_dev: 'devConnection'
serviceConnection_prd: 'prdConnection'
#endregion

#region specific
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Organization": "alsehr",
"Project": "Module Playground",
"ServiceConnectionName": "ModulePlaygroundPrivate",
"Organization": "<YourOrganization>",
"Project": "<YourProject>",
"ServiceConnectionName": "<YourServiceConnection>",
"AgentPoolProperties": {
"ScaleSetPoolName": "moduleplayground-scaleset",
"ScaleSetPoolName": "<YourPoolName>",
"RecycleAfterEachUse": false,
"MaxSavedNodeCount": 0,
"MaxCapacity": 10,
Expand Down
4 changes: 2 additions & 2 deletions constructs/azureImageBuilder/parameters/sbx.imageInfra.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module imageInfraDeployment '../templates/imageInfra.deploy.bicep' = {
params: {
location: location
deploymentsToPerform: deploymentsToPerform
computeGalleryName: 'aibgallery'
storageAccountName: 'shaibstorage'
computeGalleryName: '<YourComputeGallery>'
storageAccountName: '<YourStorageAccount>'
}
}
14 changes: 7 additions & 7 deletions constructs/azureImageBuilder/parameters/sbx.imageTemplate.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param baseTime string = utcNow('u')

// Misc
resource existingStorage 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
name: 'shaibstorage'
name: '<YourStorageAccount>'
scope: resourceGroup(subscription().subscriptionId, 'agents-vmss-rg')
}
var sasConfig = {
Expand All @@ -45,7 +45,7 @@ module imageTemplateDeployment '../templates/imageTemplate.deploy.bicep' = {
params: {
location: location
deploymentsToPerform: deploymentsToPerform
imageTemplateComputeGalleryName: 'aibgallery'
imageTemplateComputeGalleryName: '<YourComputeGallery>'

// Linux Example
imageTemplateImageSource: {
Expand All @@ -56,19 +56,19 @@ module imageTemplateDeployment '../templates/imageTemplate.deploy.bicep' = {
version: 'latest'
// Custom image example
// type: 'SharedImageVersion'
// imageVersionID: '${subscription().id}/resourceGroups/myRg/providers/Microsoft.Compute/galleries/aibgallery/images/linux-sid/versions/0.24470.675'
// imageVersionID: '${subscription().id}/resourceGroups/myRg/providers/Microsoft.Compute/galleries/<YourComputeGallery>/images/linux-sid/versions/0.24470.675'
}
imageTemplateCustomizationSteps: [
{
type: 'Shell'
name: 'PowerShell installation'
scriptUri: 'https://shaibstorage.blob.${environment().suffixes.storage}/aibscripts/LinuxInstallPowerShell.sh?${sasKey}'
scriptUri: 'https://<YourStorageAccount>.blob.${environment().suffixes.storage}/aibscripts/LinuxInstallPowerShell.sh?${sasKey}'
}
{
type: 'Shell'
name: 'Software installation'
inline: [
'wget \'https://shaibstorage.blob.${environment().suffixes.storage}/aibscripts/LinuxPrepareMachine.ps1?${sasKey}\' -O \'LinuxPrepareMachine.ps1\''
'wget \'https://<YourStorageAccount>.blob.${environment().suffixes.storage}/aibscripts/LinuxPrepareMachine.ps1?${sasKey}\' -O \'LinuxPrepareMachine.ps1\''
'sed -i \'s/\r$//\' \'LinuxPrepareMachine.ps1\''
'pwsh \'LinuxPrepareMachine.ps1\''
]
Expand All @@ -91,7 +91,7 @@ module imageTemplateDeployment '../templates/imageTemplate.deploy.bicep' = {
// name: 'PowerShell installation'
// inline: [
// 'Write-Output "Download"'
// 'wget \'https://shaibstorage.blob.${environment().suffixes.storage}/aibscripts/WindowsInstallPowerShell.ps1?${sasKey}\' -O \'WindowsInstallPowerShell.ps1\''
// 'wget \'https://<YourStorageAccount>.blob.${environment().suffixes.storage}/aibscripts/WindowsInstallPowerShell.ps1?${sasKey}\' -O \'WindowsInstallPowerShell.ps1\''
// 'Write-Output "Invocation"'
// '. \'WindowsInstallPowerShell.ps1\''
// ]
Expand All @@ -101,7 +101,7 @@ module imageTemplateDeployment '../templates/imageTemplate.deploy.bicep' = {
// type: 'PowerShell'
// name: 'Software installation'
// inline: [
// 'wget \'https://shaibstorage.blob.${environment().suffixes.storage}/aibscripts/WindowsPrepareMachine.ps1?${sasKey}\' -O \'WindowsPrepareMachine.ps1\''
// 'wget \'https://<YourStorageAccount>.blob.${environment().suffixes.storage}/aibscripts/WindowsPrepareMachine.ps1?${sasKey}\' -O \'WindowsPrepareMachine.ps1\''
// 'pwsh \'WindowsPrepareMachine.ps1\''
// ]
// runElevated: true
Expand Down
4 changes: 2 additions & 2 deletions docs/wiki/Creating images with the Azure Image Builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ imageTemplateCustomizationSteps: [
{
type: 'Shell'
name: 'PowerShell installation'
scriptUri: 'https://shaibstorage.blob.core.windows.net/aibscripts/LinuxInstallPowerShell.sh?${sasKey}'
scriptUri: 'https://<YourStorageAccount>.blob.core.windows.net/aibscripts/LinuxInstallPowerShell.sh?${sasKey}'
}
{
type: 'Shell'
name: 'Prepare software installation'
inline: [
'wget \'https://shaibstorage.blob.core.windows.net/aibscripts/LinuxPrepareMachine.ps1?${sasKey}\' -O \'LinuxPrepareMachine.ps1\''
'wget \'https://<YourStorageAccount>.blob.core.windows.net/aibscripts/LinuxPrepareMachine.ps1?${sasKey}\' -O \'LinuxPrepareMachine.ps1\''
'sed -i \'s/\r$//' 'LinuxPrepareMachine.ps1\''
'pwsh \'LinuxPrepareMachine.ps1\''
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The file comes with out-of-the box parameters that you can use aside from a few
- For the image reference you can choose an image from a Shared Image Gallery using both the `virtualMachineScaleSetComputeGalleryName` & `virtualMachineScaleSetComputeGalleryImageDefinitionName` parameters. If you don't define the `virtualMachineScaleSetComputeGalleryImageDefinitionName` parameter with a specific version, it will assume `latest`.
Example
```Bicep
virtualMachineScaleSetComputeGalleryName: 'aibgallery'
virtualMachineScaleSetComputeGalleryName: '<YourComputeGallery>'
virtualMachineScaleSetComputeGalleryImageDefinitionName: 'linux-sid'
virtualMachineScaleSetImageVersion: '0.24470.675' // (optional)
```
Expand Down

0 comments on commit 567650d

Please sign in to comment.