Hi,
i am trying to install the Octopus Tentacle VM Extension to an Azure VM in our DevTestLab.
When i use the powershell commands like in your documentation (https://octopus.com/docs/installation/installing-tentacles/azure-virtual-machines/via-powershell) it fails with the following error:
Cannot bind parameter ‘Settings’. Cannot convert the
"{“OctopusServerUrl”: “”, “Environments”: [
""], “Roles”: [ “” ], “CommunicationMode”: “Listen”,
“Port”: 10933 }" value of type “System.String” to type
"System.Collections.Hashtable".
At C:\Users\jenkins\AppData\Local\Temp\jenkins3178889207261319953.ps1:19
char:15
-
-Settings $publicSettings `
-
~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: ( [Set-AzureRmVMExtension], P
arameterBindingException - FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.C
ommands.Compute.SetAzureVMExtensionCommand
- CategoryInfo : InvalidArgument: ( [Set-AzureRmVMExtension], P
When changing the declaration of the variable $publicSettings, to cast it to a hashtable like:
$publicSettings = @“
OctopusServerUrl=
Environments = {”"}
Roles = {""}
CommunicationMode = Listen
Port = 10933
"@
$hash = ConvertFrom-StringData -StringData $publicSettings
this error occurs:
ErrorCode: VMExtensionProvisioningError
ErrorMessage: VM has reported a failure when processing extension ‘OctopusDeployWindowsTentacle’. Error message: “System.InvalidCastException: Unable to cast object of type
’Newtonsoft.Json.Linq.JValue’ to type ‘Newtonsoft.Json.Linq.JArray’.
at AzureVMExtension.Configuration.ApplicationConfig.GetPublicArraySetting(JToken publicSettings, String property) in
Z:\buildAgent\workDir\8d5946312b69ad91\src\AzureVMExtension\Configuration\ApplicationConfig.cs:line 158
at AzureVMExtension.Configuration.ApplicationConfig.ParseFile(String filename) in Z:\buildAgent\workDir\8d5946312b69ad91\src\AzureVMExtension\Configuration\ApplicationConfig.cs:line 74
at Polly.RetrySyntax.<>c__DisplayClass10_0.b__1() in C:\projects\polly\src\Polly.Shared\RetrySyntax.cs:line 211
at Polly.Retry.RetryEngine.Implementation[TResult](Func1 action, IEnumerable
1 shouldRetryExceptionPredicates, IEnumerable1 shouldRetryResultPredicates, Func
1 policyStateFactory) in
C:\projects\polly\src\Polly.Shared\Retry\RetryEngine.cs:line 40
at Polly.RetrySyntax.<>c__DisplayClass10_1.b__0(Action action, Context context) in C:\projects\polly\src\Polly.Shared\RetrySyntax.cs:line 210
at AzureVMExtension.Configuration.ApplicationConfig.Parse(String configFolder, Int32 sequenceNumber) in
Z:\buildAgent\workDir\8d5946312b69ad91\src\AzureVMExtension\Configuration\ApplicationConfig.cs:line 47
at AzureVMExtension.Program.Execute(String[] args) in Z:\buildAgent\workDir\8d5946312b69ad91\src\AzureVMExtension\Program.cs:line 75”.
StartTime: 04.10.2017 14:52:54
EndTime: 04.10.2017 14:53:29
OperationID: f72fc0f6-a803-4da5-b9b2-a7a1b17a02cb
Status: Failed
In Zeile:28 Zeichen:1
- Set-AzureRmVMExtension -ResourceGroupName $resourceGroup `
-
+ CategoryInfo : CloseError: (:) [Set-AzureRmVMExtension], ComputeCloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.SetAzureVMExtensionCommand
Would be very happy if you could give me a working example of how this parameter $publicSettings should look like.