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

Terraform azurerm backend not listing all workspaces #35703

Open
ljalonen opened this issue Sep 10, 2024 · 1 comment
Open

Terraform azurerm backend not listing all workspaces #35703

ljalonen opened this issue Sep 10, 2024 · 1 comment
Labels
backend/azure bug new new issue not yet triaged

Comments

@ljalonen
Copy link

Terraform Version

Terraform v1.9.5
on linux_amd64

Terraform Configuration Files

terraform {
  backend "azurerm" {
    resource_group_name  = "xxx"
    storage_account_name = "yyy"
    container_name       = "zzz"
    key                  = "ddd"
  }
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=4.1.0"
    }
  }
}

Debug Output

Debugs shows that terraform receives a XML response from Azure Storage which contains states for listed workspaces. There is NextMarker in response which indicates that there should be followup request happening to Azure Storage but Terraform does not request next page which has the most of the states. This can be verified with trace debugging where there is no second request generated and only workspaces from page 1 get listed.

Sanitized version of XML returned.

<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="https://xxx.blob.core.windows.net/"
  ContainerName="yyy">
  <Prefix>aaa</Prefix>
  <Blobs>
    <Blob>
      <Name>bbb</Name>
      <Properties>
        ...
      </Properties>
    </Blob>
    <Blob>
      <Name>ccc</Name>
      <Properties>
        ...
      </Properties>
    </Blob>
    <Blob>
      <Name>ddd</Name>
      <Properties>
        ...
      </Properties>
    </Blob>
    ...
  </Blobs>
  <NextMarker>example-Zu8p6ve2dXYV8wMEGzFsgWSlRSSzh0v1-1-23-a!</NextMarker>
</EnumerationResults>

Expected Behavior

All the workspaces from all pages get listed and terraform follows NextMarker until there is not one defined in response (last page).

Actual Behavior

Only states listed in page 1 get listed by terraform and NextMarker provided in response is not followed.

Steps to Reproduce

  1. Requires condition from Azure storage where blob listing spans multiple response pages - this could happen due to partitioning etc. on Azure side.
  2. terraform init
  3. terrafowm workspace list / select XXX

Additional Context

No response

References

@ljalonen ljalonen added bug new new issue not yet triaged labels Sep 10, 2024
@crw
Copy link
Collaborator

crw commented Sep 11, 2024

Thanks for filing this issue! Azure backend issues are triaged by the Azure Provider team at HashiCorp, and they have been notified. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/azure bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants