I hereby claim:
- I am andrewmatveychuk on github.
- I am andrewmatveychuk (https://keybase.io/andrewmatveychuk) on keybase.
- I have a public key ASCfE9REYe1B1oIPZGf_pD4Lsj2v0opDlVMw-fAe5ZySZQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| Configuration sampleConfiguration { | |
| #Importing required DSC resources | |
| Import-DscResource -ModuleName @{ModuleName="PackageManagement"; RequiredVersion="1.4.5"} | |
| Import-DscResource -ModuleName xPSDesiredStateConfiguration | |
| #Common variables | |
| #Download location for software package | |
| $packageLocalPath = "C:\Deploy\<package_name>.exe" |
| #Install Chocolatey as a package manager | |
| cChocoInstaller installChocolatey { | |
| InstallDir = "C:\ProgramData\Chocolatey" | |
| DependsOn = "[PackageManagement]cChoco" | |
| } | |
| #Install the software package you need | |
| cChocoPackageInstaller requiredPackage { | |
| Name = "<package_name>" | |
| Ensure = "Present" |
| #Installing build tools specified in configurationData.psd1 file | |
| $Node.packages.foreach( | |
| { | |
| cChocoPackageInstaller $_ { | |
| Name = $_ | |
| Ensure = "Present" | |
| AutoUpgrade = $True | |
| DependsOn = "[cChocoInstaller]installChocolatey" | |
| } | |
| } |
| # configurationData.psd1 file | |
| @{ | |
| AllNodes = @( | |
| @{NodeName = "localhost"; | |
| #List of packages to be installed | |
| Packages = @( | |
| "netfx-4.8-devpack", | |
| "visualstudio2017buildtools", | |
| "visualstudio2017testagent", | |
| "visualstudio2017-workload-manageddesktopbuildtools", |
| steps: | |
| - task: AzurePowerShell@4 | |
| displayName: 'Enable Application Insights web avaliability tests' | |
| inputs: | |
| azureSubscription: <your_service_connection> # Your service connection, i.g., a subscription or resource group name |
| $alertResourceIds = Get-AzResource -ResourceGroupName $env:resourceGroupName | Where-Object -Property ResourceType -EQ "microsoft.insights/webtests" | Select-Object -ExpandProperty ResourceId | |
| ForEach ($Id in $alertResourceIds) { | |
| $alerts = Get-AzResource -ResourceId $Id | |
| $alerts.Properties.Enabled = "False" | |
| $alerts | Set-AzResource -Force | |
| } |
| { | |
| "field": "location", | |
| "notIn": [ | |
| "[[resourcegroup().location]", | |
| "global" | |
| ] | |
| }, | |
| { | |
| "field": "location", |
| "parameters": { | |
| "allowedLocations": { | |
| "type": "Array", | |
| "metadata": { | |
| "displayName": "Allowed locations", | |
| "description": "The list of locations that can be specified when deploying resources.", | |
| "strongType": "location" | |
| } | |
| } | |
| } |
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "variables": { | |
| "policyName": "restrict-allowed-locations-policy", | |
| "policyDisplayName": "Restrict allowed locations for resources", | |
| "policyDescription": "This policy restrict the locations you can specify when deploying resources. Excludes resource groups, Microsoft.AzureActiveDirectory/b2cDirectories, and resources that use the 'global' region." | |
| }, | |
| "resources": [ | |
| { |