infrastructure as code - meetupfiles.meetup.com/20381497/infrastructureascode.pdf · infrastructure...
TRANSCRIPT
![Page 1: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/1.jpg)
![Page 2: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/2.jpg)
![Page 3: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/3.jpg)
https://aka.ms/seattleazure
https://aka.ms/seattlebizspark
![Page 4: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/4.jpg)
![Page 5: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/5.jpg)
![Page 6: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/6.jpg)
Setup
Xplat install via npm, Win/Mac Installer, Docker container
Reference
![Page 7: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/7.jpg)
![Page 8: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/8.jpg)
![Page 9: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/9.jpg)
![Page 10: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/10.jpg)
GitHubhttps://resources.azure.com/
![Page 11: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/11.jpg)
$ErrorActionPreference = "Stop"
# sign in and select subscriptionLogin-AzureRmAccount -SubscriptionID $subscriptionId;
# load the parameters so we can use them in the script$params = ConvertFrom-Json -InputObject (Gc $parametersFilePath -Raw)
$resourceGroup = Get-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinueif(!$resourceGroup){
Write-Host "Creating resource group '$resourceGroupName' in location $($params.parameters.location.value)";New-AzureRmResourceGroup -Name $resourceGroupName -Location $params.parameters.location.value -Verbose
}
# Test$testResult = Test-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile$parametersFilePath -ErrorAction Stop;if ($testResult.Count -gt 0){
write-host ($testResult | ConvertTo-Json -Depth 5 | Out-String);write-output "Errors in template - Aborting";exit;
}
# Start the deploymentNew-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $templateFilePath -TemplateParameterFile $parametersFilePath -Verbose;
![Page 12: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/12.jpg)
{"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#","contentVersion": "1.0.0.0","parameters": {
"location": {"value": "centralus"
},"virtualMachineName": {
"value": "myvm"},"virtualMachineSize": {
"value": "Standard_DS1_v2"},"adminUsername": {
"value": "myuser"},"adminPublicKey": {
"reference": {"keyVault": {
"id": "/subscriptions/{subid}/resourceGroups/{rgid}/providers/Microsoft.KeyVault/vaults/{vaultname}"},"secretName": "VMSSSHKey"
} }
}}
![Page 13: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/13.jpg)
![Page 14: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/14.jpg)
![Page 15: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/15.jpg)
![Page 16: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/16.jpg)
![Page 17: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/17.jpg)
![Page 18: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/18.jpg)
![Page 19: Infrastructure as Code - Meetupfiles.meetup.com/20381497/InfrastructureAsCode.pdf · Infrastructure as Code Author: Scott Semyan Created Date: 12/13/2016 9:59:19 PM](https://reader033.vdocuments.us/reader033/viewer/2022042310/5ed7a33d48b98015c20209f2/html5/thumbnails/19.jpg)
https://blogs.msdn.microsoft.com/cloud_solution_architect/2016/11/11/creating-azure-resources-with-arm-templates-step-by-step/
https://aka.ms/seattleazure