crossplane-contrib / provider-upjet-azure

Azure Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-azure/
Apache License 2.0
63 stars 75 forks source link

[Bug]: Blob content update is not working #821

Open vinish86 opened 1 month ago

vinish86 commented 1 month ago

Is there an existing issue for this?

Affected Resource(s)

storage.azure.upbound.io/v1beta1 - Blob

Resource MRs required to reproduce the bug

I'm trying to update the blob's sourceContent, but it's not working.

MR

apiVersion: storage.azure.upbound.io/v1beta1
kind: Blob
metadata:
  name: test-blob
spec:
  forProvider:
    sourceContent: inline content for this blob edit1
    storageAccountName: testsa16252729
    storageContainerName: test-data
    type: Block
  providerConfigRef:
    name: default

Steps to Reproduce

First, I submit the MR with the initial source content. Once the blob is created, I update the MR file with new source content and resubmit it. Although sync and readiness show as true, the content in the blob isn't updated.

image

What happened?

This works in Terraform, where I notice that if there's any change to the blob content, the Terraform provider deletes the blob and re-creates it.

resource "azurerm_storage_blob" "create_blob" {
  name                   = local.blob_location
  storage_account_name   = local.storageAccountName
  storage_container_name = "application"
  type                   = "Block"
  source_content         = local.json_content
  lifecycle {
    create_before_destroy = true
  }
}

Relevant Error Output Snippet

No response

Crossplane Version

1.15.2

Provider Version

1.5.0

Kubernetes Version

1.28.2

Kubernetes Distribution

No response

Additional Info

No response

mergenci commented 1 month ago

@vinish86, The behavior you reported is the expected behavior. By design, Crossplane doesn't delete external resources implicitly.

For reference, sourceContent is a ForceNew attribute in Terraform — also noted in the resource's Terraform documentation.