Skip to content

azure-instance-identity authentication uses different instance_id than provisioner #3315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Jul 29, 2022 · 1 comment · Fixed by #3355
Closed
Assignees
Labels
api Area: HTTP API

Comments

@spikecurtis
Copy link
Contributor

when using the azurerm terraform provider, the coder provisioner returns an instance_id like

/subscriptions/05e8b285-4ce1-46a3-b4c9-f51ba67d6acc/resourceGroups/coder-spike-spikeaz-resources/providers/Microsoft.Compute/virtualMachines/coder-spike-spikeaz-vm

However the Coder Agent, using the Azure metadata service, calls Coder Server with vmId like: 90c8eeb0-597a-4df8-8ab6-dc25521d0989

This is rejected by Coder Server.

2022-07-29 17:58:40.865 [WARN]	<./cli/agent.go:152>	workspaceAgent.func1	authenticate workspace	{"method": "azure-instance-identity", "error": "POST https://fccac451dc692c5a665d211025e3015e.pit-1.try.coder.app/api/v2/workspaceagents/azure-instance-identity: unexpected status code 404: Instance with id \"90c8eeb0-597a-4df8-8ab6-dc25521d0989\" not found."}
@spikecurtis spikecurtis added bug api Area: HTTP API labels Jul 29, 2022
@spikecurtis spikecurtis self-assigned this Jul 29, 2022
@spikecurtis
Copy link
Contributor Author

Examining the terraform state, it looks like we need to grab virtual_machine_id from the state, rather than id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants