added git, fixed clone location, fixed import of modules (#2202)

Added git to the requirements
Fixed clone location (as further is referenced to c:\ )
Fixed import of modules (current command gives error! )
This commit is contained in:
michawets
2020-12-10 08:17:43 +01:00
committed by GitHub
parent b392aa60bd
commit 693b6a0809

View File

@@ -13,6 +13,7 @@ After successful image generation, a snapshot of the temporary VM will be conver
- `PowerShell 5.0 or higher` or `PSCore` for linux distributes.
- `Azure CLI ` - https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
- `Azure Powershell module` - https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-4.6.1
- `Git for Windows` - https://gitforwindows.org/
### Azure DevOps self-hosted pool requirements
To connect to a temporary VM packer use WinRM or SSH connections on public IP interfaces.
@@ -39,15 +40,16 @@ Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI
Download Virtual-Environments repository.
```
Set-Location c:\
git clone https://github.com/actions/virtual-environments.git
```
Import [GenerateResourcesAndImage](helpers/GenerateResourcesAndImage.ps1) script from `/helpers` folder, and run `GenerateResourcesAndImage` function via Powershell.
```
cd C:\virtual-environments
Set-Location C:\virtual-environments
Import-Module "helpers\GenerateResourcesAndImage.ps1"
Import-Module .\helpers\GenerateResourcesAndImage.ps1
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "myTestResourceGroup" -ImageGenerationRepositoryRoot "$pwd" -ImageType Ubuntu1604 -AzureLocation "East US"
```
@@ -66,9 +68,9 @@ The function automatically creates all required Azure resources and kicks off pa
After the successful image generation, Virtual Machine can be created from the generated VHD using [CreateAzureVMFromPackerTemplate](helpers/CreateAzureVMFromPackerTemplate.ps1) script.
```
cd C:\virtual-environments
Set-Location C:\virtual-environments
Import-Module helpers\CreateAzureVMFromPackerTemplate.ps1
Import-Module .\helpers\CreateAzureVMFromPackerTemplate.ps1
CreateAzureVMFromPackerTemplate -SubscriptionId {YourSubscriptionId} -ResourceGroupName {ResourceGroupName} -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "testvm1" -AdminUsername "shady1" -AdminPassword "SomeSecurePassword1" -AzureLocation "eastus"
```