JetBrains / teamcity-azure-agent

TeamCity support for Azure cloud build agents
Apache License 2.0
48 stars 22 forks source link

Windows Azure CustomData not getting set #141

Open megakid opened 1 year ago

megakid commented 1 year ago

Description

I am creating a sysprep'd template using Packer on a Windows 2022 Datacenter build. I am installing the agent during the packer process and then using the standard "Image" approach:

image

I can see in the Azure Deployment that custom data is being injected here:

image

The issue I'm seeing is when the agent boots up, it doesn't see the C:\AzureData directory - inside teamcity-agent.log I only see this. I've manually RDP'd into the box and the AzureData directory is not there so I can rule out permission issues.

[2022-10-13 09:12:52,911]   INFO - ds.azure.AzurePropertiesReader - Azure plugin initializing...
...
[2022-10-13 09:13:31,390]   INFO - SpotInstanceTerminationChecker - Subscribe on Azure scheduledEvents metadata
[2022-10-13 09:13:31,390]   INFO - ds.azure.AzureCustomDataReader - Azure integration is disabled. Failed to read azure custom data file C:\AzureData\CustomData.bin: C:\AzureData\CustomData.bin

I am struggling to find much documentation on the Azure customdata - when it is added and removed - but I suspect this is something to do with my image's unattend.xml setup which does an unattended domain join using Microsoft-Windows-UnattendedJoin during the specialize step.

I've run scripts during this process and still can't see the C:\AzureData folder at all. Does anyone have an idea why this is occurring?

This is obviously causing significant issues with the agents, first appearing as unauthorized and then not within the cloud agent sub-pool once authorized manually.

Environment

Diagnostic logs

See above.