Skip to content
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

Bug: Bootstrap fails on Microsoft Hosted Virtual Machines - Need to upgrade AzAPI to v2 #252

Closed
1 task done
integyjc opened this issue Nov 18, 2024 · 4 comments
Closed
1 task done
Assignees
Labels
Type: Bug 🪲 Something isn't working

Comments

@integyjc
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Infrastructure as Code Type? (Required)

bicep

PowerShell Module Version (Optional)

4.1.0

Bootstrap Module Version (Optional)

No response

Starter Module? (Required)

bicep - complete

Starter Module Version (Optional)

No response

Input arguments of the ALZ-PowerShell-Module (Optional)

No response

Debug Output/Panic Output (Optional)

Expected Behaviour (Required)

Terraform plan should have started

Actual Behaviour (Required)

Error: Failed to perform action

│ with data.azapi_resource_action.locations,
│ on main.tf line 12, in data "azapi_resource_action" "locations":
│ 12: data "azapi_resource_action" "locations" {

│ performing action locations of "Resource: (ResourceId "/subscriptions/fd134809-7884-405a-redacted" / Api
│ Version "2022-12-01")": ChainedTokenCredential authentication failed
│ GET http://169.254.169.254/metadata/identity/oauth2/token
│ --------------------------------------------------------------------------------
│ RESPONSE 400 Bad Request
│ --------------------------------------------------------------------------------
│ {
│ "error": "invalid_request",
│ "error_description": "Identity not found"
│ }
│ --------------------------------------------------------------------------------

Steps to Reproduce (Optional)

No response

Important Factoids (Optional)

First time following the new process so this could well be user error. I've got to the point of running Deploy-Accelerator -inputs "c:\accelerator\config\inputs.yaml" -output "c:\accelerator\output" and receive the error shown

Has anyone else hit this or have I missed something?

The user account im using is logged in via az login - I have also tried with -t to fix the tenant. The user is owner at tenant root

References (Optional)

No response

@integyjc integyjc added Needs: Triage 🔍 Needs triaging by the team Type: Bug 🪲 Something isn't working labels Nov 18, 2024
@jaredfholgate
Copy link
Member

jaredfholgate commented Nov 19, 2024

Looks like you are running on an Azure VM? If so, you can fix by setting the env var ARM_USE_MSI to false.

$env:ARM_USE_MSI = $false

This was a limitation with AzAPI, but has been fixed in v2. I will update the code to fix this moving forward.

@integyjc
Copy link
Author

Thats done the trick thank you!

$env:ARM_USE_MSI = "false"

Yes we're using Azure DevBox and I obviously didn't google enough to find this known issue!

Much appreciated

@jaredfholgate
Copy link
Member

I'll leave this issue open as a prompt for me to upgrade to azapi v2.

@jaredfholgate jaredfholgate added Needs: Attention 👋 Needs attention from the maintainers and removed Needs: Triage 🔍 Needs triaging by the team labels Nov 19, 2024
@jaredfholgate jaredfholgate self-assigned this Nov 19, 2024
@jaredfholgate jaredfholgate changed the title Bug: Identity not found error Bug: Bootstrap fails on Microsoft Hosted Virtual Machines - Need to upgrade AzAPI to v2 Nov 19, 2024
@jaredfholgate
Copy link
Member

This was fixed in #236 and released in https://github.com/Azure/ALZ-PowerShell-Module/releases/tag/4.1.2

@jaredfholgate jaredfholgate removed the Needs: Attention 👋 Needs attention from the maintainers label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants