DisplayName
My Microservice (#{Octopus.Environment.Name})
The environment is named “TestInstance01” and I would expect it to produce
My.Microservice.TestInstance01 as service name. and “My Microservice (TestInstance01)” as Displayname
It doesn’t. It’s My.Microservice.Default and “My Microservice (Default)”.
Looking through variables preview (System) I see:
Octopus.Action[Install as a service].WindowsService.ServiceName =
My.Microservice.TestInstance01, so it looks like it should be ok, just not in the actual deploy
I made sure to update all variables, and I have tried recreating the “Windows Service” step - same result.
It does look like this is configured correctly, and the test I just ran does successfully replace the values.
It may be worth adding a project variable named OctopusPrintEvaluatedVariables with a value of true. Then if you check the full deployment log it will output all variables including the system ones such as Octopus.Environment.Name.
It would be interesting to see what the results of this are.
So, yesterday trying to figure stuff out, I put in a Step : “Install My Service”. Then in order to start fresh I deleted said step and created a new one “Install as a service”. But the log from the build says.
[Octopus.Action[Install My Service].WindowsService.Description] = ‘My microservice (Default)’
where I would expect
[Octopus.Action[Install as a service].WindowsService.Description] = ‘My microservice (TestInstance01)’
Interestingly - I initially experimented with Service Name = "My.Service.#{Octopus.Channel.Name} which is now “default”.
So maybe it’s a matter of the Release remembering the former Process steps?
That does make more sense, as Octopus.Channel.Name does explain where the ‘default’ value is coming from.
When a release is created it snapshots the current process step, if a change is then made to those process steps a new release must be created for them to be applied.
So, if your service process is currently set to Service Name = "My.Service.#{Octopus.Environment.Name} I would recommend creating a new release and re-trying the deploy.
Since it is able to monitor changes to Variables and update the snapshot for those, I would suggest a new feature: Octopus should be able to do the same for Process Steps