[Logic Apps Hybrid] Adding a File System connection is not idempotent / doesn't safely preserve existing volume mounts (duplicates & corrupts azurestorageaccounts/template.volumes)

Aperta
#9,439 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
azure, typescript

Direzione di ricerca

Inizia con i rami ibrido e non ibrido di FileSystemConnectionCreationClient.ts nei percorsi AzureUX-LogicAppsPortal e LogicAppsUX, quindi confronta il mirror di CodelessWorkflows. Traccia come vengono letti e scritti template.volumes, volumeMounts e azurestorageaccounts, usando #9438 per il contesto correlato alla conservazione dei mount. Il lavoro è completato quando il salvataggio nuovamente è idempotente, tutti i mount e le condivisioni dei container esistenti rimangono intatti, il mount riservato non viene modificato e i percorsi Linux rimangono in stile POSIX.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug needs-investigation

Platform

Azure Logic Apps Hybrid (Azure Container Apps on connected/Arc environment). A parallel non-hybrid (Logic Apps Standard on App Service, Microsoft.Web/sites/config/azurestorageaccounts) path exists in the same client and is noted below.

Summary

Adding a new File System connection mutates the container app's template.volumes / template.volumeMounts (hybrid) or azurestorageaccounts (Standard) in a way that does not safely preserve prior mounts, corrupting existing volume-mount configuration (including, in combination with #9438, the reserved /home/site/wwwroot mount).

Where it happens (code)

FileSystemConnectionCreationClient.ts — same files as #9438:

  • AzureUX-LogicAppsPortal: src/Extension/Client/React/Services/FileSystemConnectionCreationClient.ts (+ CodelessWorkflows/Services/ mirror).
  • LogicAppsUX: apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Services/FileSystemConnectionCreationClient.ts.
Hybrid branch (~L167–247)
const newVolumes = [ { name: fileShareName, storageName: fileShareName, storageType: 'Smb' },
                     ...containerAppResponse.properties.template.volumes ];
const newVolumeMounts = [ { volumeName: fileShareName, mountPath: `/mounts/${fileShareName}` },
                          ...containerAppResponse.properties.template.containers[0].volumeMounts ];

Problems:

  1. Not idempotent — it unconditionally prepends. Re-saving the same connection, or reusing a displayName, appends duplicate volumes/volumeMounts entries for the same share.
  2. Only containers[0] is updated; mounts on other containers are dropped when the reconstructed template is PATCHed back.
  3. The reconstructed template becomes the write-back source of truth (see #9438), so any drift drops existing mounts.
Non-hybrid branch (~L248–285)
const response = await httpClient.post(configFetchUrl, ...);        // POST azurestorageaccounts/list
response.properties[connectionName] = newFileShareConfig;           // merge
await httpClient.put(configBaseUrl, response, ...);                 // PUT full collection

This read-modify-writes the whole azurestorageaccounts dictionary. It preserves other entries only if the /list response returns every existing share with a usable accessKey; any masked/omitted entry is corrupted on write-back. Also emits a Windows-style mount path (\mounts\<name> → C:\mounts\<name>) which is invalid for Linux Logic Apps Standard.

Suggested fix direction

  • Key each mount by a stable connector-specific name and add/update only that entry (idempotent re-save); never blind-prepend.
  • Preserve every existing volume/volumeMount (all containers) and never touch /home/site/wwwroot (see #9438).
  • Non-hybrid: verify /list returns all shares with resolvable keys before PUT; emit an OS-appropriate mountPath (POSIX on Linux).

Impact

High — File System connectors are not composable (duplicate/broken mounts), and existing mounts (incl. the runtime content mount) can be corrupted.

References

Lingua principale
TypeScript
Stelle
114
Fork
115
Merge medio
1g 3h
PR unite (30g)
40

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/LogicAppsUX

Tutte le issue di Azure/LogicAppsUX

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.