Hi Team,
I am using powershell to add octopus extension in azure vm, though i am able to add it but i am unable to assign them in the deployment targets from PowerShell, because publicHostNameConfiguration is not acceptable in the PowerShell commands
It would be really helpful to add this command as this will reduce the level of manual work as we need to deploy extensions of 100’s of VM’s
I went to the Json method, it might not be suitable in, our case and i find the powershell very useful in adding the extension
I am using the following script
Login-AzureRmAccount -SubscriptionName “subscription”
$vmname=(Find-AzureRmResource -TagName ‘MachineType’ -TagValue Ocotpus).Name
$publicSettings = @{
OctopusServerUrl = “octopusurl”;
Environments = @(“envname”);
Roles = @(“app-server”, “web-server”);
CommunicationMode = “Listen”;
Port = 10933;
publicHostNameConfiguration= ComputerName
}
$privateSettings = @{“ApiKey” = “APIKey”}
foreach($name in $vmname){
Set-AzureRmVMExtension -ResourceGroupName “RG” -Location “Location” -VMName $name -Name “OctopusDeployWindowsTentacle” -Publisher “OctopusDeploy.Tentacle” -TypeHandlerVersion “2.0” -Settings $publicSettings -ProtectedSettings $privateSettings -ExtensionType “OctopusDeployWindowsTentacle”
}