May 16 2020 07:53 AM
Hi Team,
I have a requirement to create a release pipeline as below :
I have a linux VM and I would like to automatically create a deployment group using azure cli/powershell and assign existing linux vm to be a part of deployment group.
Thanks for the reply
May 16 2020 11:12 AM
#create VM
#First-Level
New-AzResourceGroup -Name PSAzureBootCampRG -Location westus
$gatewaysubnet = New-AzVirtualNetworkSubnetConfig -Name PSGatewaySubnet -AddressPrefix "10.172.100.0/27"
$virtualNetwork = New-AzVirtualNetwork -Name PSAzureBCVnet -ResourceGroupName PSAzureBootCampRG -Location westus -AddressPrefix "10.172.100.0/24" -Subnet $gatewaysubnet
Add-AzVirtualNetworkSubnetConfig -Name AzureFirewallSubnet -VirtualNetwork $virtualNetwork -AddressPrefix "10.172.100.32/27"
Add-AzVirtualNetworkSubnetConfig -Name PSDMZSubnet -VirtualNetwork $virtualNetwork -AddressPrefix "10.172.100.96/27"
$virtualNetwork | Set-AzVirtualNetwork
#Second-Level
$publicipvm = New-AzPublicIpAddress -ResourceGroupName "PSAzureBootCampRG" -name "VMIP" -location "westus" -AllocationMethod Static -Sku Standard
$resourceGroup = "PSAzureBootCampRG"
$location = "westus"
$vmName = "VMName"
$cred = Get-Credential -Message "Enter a username and password for the virtual machine."
New-AzResourceGroup -Name $resourceGroup -Location $location
New-AzVM -ResourceGroupName $resourceGroup -Name $vmName -Location $location -ImageName "RHEL" -Size "Standard_D2_v3" -VirtualNetworkName "PSAzureBCVnet" -SubnetName "PSDMZSubnet" -PublicIpAddressName $publicipvm -Credential $cred -OpenPorts 22
May 17 2020 08:41 AM
Hi @emreozanmemis ,
Thanks for the reply.
It seems my requirement is bit different.
1) I already have one resource group,Linux VM created.
2) I would like to create deployment group assigned to existing Linux VM using Powershell/CLI etc.
Could you guide me on how to achieve the same?
May 17 2020 10:53 AM
May 18 2020 11:00 AM
May 20 2020 08:06 AM
Hi @emreozanmemis ,
Thanks for sharing the link.
I have gone through the Microsoft link but it seems that links is more about how to install devops agent.
I am looking for an option create deployment group using powershell
May 21 2020 12:22 AM
SolutionMay 21 2020 08:10 AM
May 21 2020 12:22 AM
Solution