Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danycontre committed May 16, 2022
1 parent c8fbc85 commit bd4d62b
Show file tree
Hide file tree
Showing 2,658 changed files with 235,366 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .azuredevops/ado/deploy-template-sub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
parameters:
- name: location
- name: templateFile
- name: workingDir
type: string
- name: deployOperation
type: string
default: 'create'
- name: parameterArray
type: object
default: []
- name: jobName
default: Deploy_Bicep_Main_Module_Sub_level
- name: preDeploySteps
type: stepList
default: []
- name: postDeploySteps
type: stepList
default: []
- name: variableOverrides
type: object
default: {}

jobs:
- job: ${{ parameters.jobName }}
displayName: Deploy ${{ parameters.templateFile }}
variables:
${{ insert }}: ${{ parameters.variableOverrides }}

steps:
- ${{ parameters.preDeploySteps }}

- task: PowerShell@2
displayName: Converting parameters array
inputs:
targetType: 'inline'
script: |
$myArray = ConvertFrom-Json $Env:PARAMETER_ARRAY
# Need to add depth for embedded json arrays.
$jsonmyArray = $myArray | ConvertTo-Json -Compress -Depth 100
Write-Host "json_my_Array is: $jsonmyArray"
# Converting into json into hash array to extract the string array
$hasharray=@{}
$jsonObjmyArray= ConvertFrom-Json $jsonmyArray
foreach ( $property in $jsonObjmyArray.PSObject.Properties ) {
$hasharray[$property.Name]=$property.Value
}
# Getting values from the hash array into string array
$stringmyArray=@()
foreach ($parameter in $hasharray.SyncRoot) {
$stringmyArray += $parameter
}
Write-Host "Here is our string array: $stringmyArray"
# Formatting for the bicep deployment
$stringparameterArray=@()
foreach ( $string in $stringmyArray) {
$string1 = $string -replace ' ', '='
$stringparameterArray += $string1
}
Write-Host "Here is final format of parameters for deployment with Bicep"
$stringparameterArray
$stringparameters=[string]::Join(" ", $stringparameterArray)
$stringparameters
Write-Host "##vso[task.setvariable variable=bicep_parameters]$stringparameters"
env:
PARAMETER_ARRAY: ${{convertToJson(parameters.parameterArray)}}

- task: AzureCLI@2
displayName: Resource deployment at subscription scope
inputs:
azureSubscription: $(serviceConnection)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
$(var-bashPreInjectScript)
ls
echo "Deploying ${{ parameters.templateFile }} using ${{ parameters.deployOperation}} operation..."
az deployment sub ${{ parameters.deployOperation }} \
--location ${{ parameters.location }} \
--name $(Build.BuildNumber) \
--template-file ${{ parameters.templateFile}} \
--parameters $(bicep_parameters)
workingDirectory: ${{ parameters.workingDir }}
85 changes: 85 additions & 0 deletions .azuredevops/ado/main-ado-avd-accelerator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
trigger:
- none

pr:
- none

variables:
- name: deploymentRegion
value: canadacentral
- name: serviceConnection
value: AzureLabCACN-Sponosored
- name: vmWinImage
value: windows-latest
- name: vmImage
value: ubuntu-latest
- name: deployOperation
value: create
- name: var-bashPostInjectScript
value: ':'
- name: var-bashPreInjectScript
value: 'set -E; function catch { echo "##vso[task.logissue type=error]Caller: $(caller), LineNo: $LINENO, Command: $BASH_COMMAND" ; exit 1 ; } ; echo ; echo "Current working directory: $(pwd)" ; echo ; trap catch ERR'
- name: avdShrdlSubsId
value: a165ed8a-0e83-46f1-9994-b216229c2da7
- name: avdWrklSubsId
value: a165ed8a-0e83-46f1-9994-b216229c2da7
- name: avdWrklSecretAccess
value: 8e23a491-5178-4c69-9fce-1377e52a29c6
- name: createAvdVnet
value: false
- name: useSharedImage
value: false
- name: avdOsImage
#value: win11_21h2_office
#value: win10_21h2
value: win10_21h2_office
#value: win11_21h2
- name: avdIdentityDomainName
value: azureminilab.com
- name: avdDomainJoinUserName
value: '[email protected]'
- name: avdDomainJoinUserPassword
value: '!V0ipc@123'
- name: avdVmLocalUserName
value: azadmin
- name: avdVmLocalUserPassword
value: '!R37fallacy1505'


stages:
- stage: Deploy_AVD_Accelerator
displayName: Deploy AVD Accelerator
jobs:
# Deploy template deploy-baseline.bicep for AVD Accelerator
- template: deploy-template-sub.yml
parameters:
jobName: Deploy_AVD_Accelerator
location: $(deploymentRegion)
workingDir: $(System.DefaultWorkingDirectory)/workload
templateFile: deploy-baseline.bicep
parameterArray:
- deploymentPrefix 'app1'
- avdDeploySessionHostsCount 1
- avdWorkloadSubsId $(avdWrklSubsId)
- avdEnterpriseAppObjectId '82205950-fef1-4f88-8801-86e60c2e9318'
- avdManagementPlaneLocation $(deploymentRegion)
- avdSessionHostLocation $(deploymentRegion)
- fsLogixstorageSku 'Standard_LRS'
# - avdWrklSecretAccess $(avdWrklSecretAccess)
- existingVnetSubnetResourceId '/subscriptions/a165ed8a-0e83-46f1-9994-b216229c2da7/resourceGroups/azurelab-avd-networking/providers/Microsoft.Network/virtualNetworks/vnet-avd-canadacentral/subnets/subnet1'
- existingHubVnetResourceId '/subscriptions/4f6c98e1-04a4-49f0-abce-6240b1726c3f/resourceGroups/pubsec-hub-networking-rg/providers/Microsoft.Network/virtualNetworks/hub-vnet'
- useSharedImage $(useSharedImage)
- avdOsImage $(avdOsImage)
- createAvdVnet $(createAvdVnet)
- avdIdentityDomainName $(avdIdentityDomainName)
- avdDomainJoinUserName $(avdDomainJoinUserName)
- avdDomainJoinUserPassword $(avdDomainJoinUserPassword)
- avdVmLocalUserName $(avdVmLocalUserName)
- avdVmLocalUserPassword $(avdVmLocalUserPassword)
- avdDeployRAppGroup true
- avdDeploySessionHosts true
- avdStartVMOnConnect true
- createStartVmOnConnectCustomRole true
- vNetworkGatewayOnHub false
- createOUforStorage true
- storageOUName 'FsLogix User Profiles'
52 changes: 52 additions & 0 deletions .azuredevops/modulePipelines/ms.analysisservices.servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'AnalysisServices - Servers'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.analysisservices.servers.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.AnalysisServices/servers/*'
exclude:
- '/**/*.md'

variables:
- template: '/.azuredevops/pipelineVariables/global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.AnalysisServices/servers'

stages:
- stage: Validation
displayName: Pester tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml

- stage: Deployment
displayName: Deployment tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/min.parameters.json
- path: $(modulePath)/.parameters/parameters.json

- stage: Publishing
displayName: Publish module
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true')))
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml
52 changes: 52 additions & 0 deletions .azuredevops/modulePipelines/ms.apimanagement.service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'ApiManagement - Service'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: false # Soft-delete prevents re-deployment
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.apimanagement.service.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.ApiManagement/service/*'
exclude:
- '/**/*.md'

variables:
- template: '/.azuredevops/pipelineVariables/global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.ApiManagement/service'

stages:
- stage: Validation
displayName: Pester tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml

- stage: Deployment
displayName: Deployment tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/max.parameters.json
- path: $(modulePath)/.parameters/parameters.json

- stage: Publishing
displayName: Publish module
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true')))
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Authorization - PolicyAssignments'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.authorization.policyassignments.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.Authorization/policyAssignments/*'
exclude:
- '/**/*.md'

variables:
- template: '/.azuredevops/pipelineVariables/global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.Authorization/policyAssignments'

stages:
- stage: Validation
displayName: Pester tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml

- stage: Deployment
displayName: Deployment tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/mg.min.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/mg.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/sub.min.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/sub.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/rg.min.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/rg.parameters.json
templateFilePath: $(modulePath)/deploy.bicep

- stage: Publishing
displayName: Publish module
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true')))
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Authorization - PolicyDefinitions'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.authorization.policydefinitions.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.Authorization/policyDefinitions/*'
exclude:
- '/**/*.md'

variables:
- template: '/.azuredevops/pipelineVariables/global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.Authorization/policyDefinitions'

stages:
- stage: Validation
displayName: Pester tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml

- stage: Deployment
displayName: Deployment tests
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/mg.min.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/mg.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/sub.min.parameters.json
templateFilePath: $(modulePath)/deploy.bicep
- path: $(modulePath)/.parameters/sub.parameters.json
templateFilePath: $(modulePath)/deploy.bicep

- stage: Publishing
displayName: Publish module
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true')))
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml
Loading

0 comments on commit bd4d62b

Please sign in to comment.