Skip to content

azurerm_gallery_application_version media_link gets shortened #33171

Description

@adrianwieg

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

I have several VM Applications defined with a source block. Inside this I have the media_link and default_configuration.
In the configuration I have defined the SAS URL for the file. But in the state the SAS Part of the URL gets removed. This causes the azurerm_gallery_application_version to recreate. As the SAS is only valid for some time, this causes some problems

Terraform Version

4.241.36

AzureRM Provider Version

5.1.0

Affected Resource(s)/Data Source(s)

azurerm_gallery_application_version

Affected Location(s)

Azure GermanyWestCentral

Terraform Configuration Files

resource "azurerm_gallery_application_version" "netcease-ws" {
  name                   = "1.0.0"
  gallery_application_id = azurerm_gallery_application.apd-prod-ws-netcease-gwc.id
  location               = azurerm_gallery_application.apd-prod-ws-netcease-gwc.location
  package_file           = "Netcease.ps1"
  tags = merge(var.tags, {
    CreationDate = "04.12.2024",
  })

  manage_action {
    install = "powershell.exe -Command \"& .\\Netcease.ps1\""
    remove  = "*"
  }

  source {
    media_link = "https://*******.blob.core.windows.net/netcease/Netcease.ps1?sp=r&st=2026-08-19T08:37:13Z&se=2026-08-19T16:52:13Z&sv=2026-02-06&sr=b&sig=******"
  }

  target_region {
    name                   = azurerm_gallery_application.apd-prod-ws-netcease-gwc.location
    regional_replica_count = 1
  }
  target_region {
    name                   = "westeurope"
    regional_replica_count = 1
  }
  target_region {
    name                   = "eastus2"
    regional_replica_count = 1
  }
  target_region {
    name                   = "southeastasia"
    regional_replica_count = 1
  }
}

Debug Output/Panic Output

module.hcs-deployment-infrastructure.azurerm_gallery_application_version.netcease-ws must be replaced

Expected Behaviour

Full Link with SAS in the state

Actual Behaviour

No response

Steps to Reproduce

  1. Create a vm application version with SAS URL Link
  2. Run the code again (this will cause a re-create)

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions