Skip to content

Commit c26f80b

Browse files
Fix queue auth: use user-assigned managed identity
The preview slot has both system-assigned and user-assigned identities. DefaultAzureCredential can't disambiguate, so use ManagedIdentityCredential with the explicit client ID (matching how AzureStorageService does it). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1900503 commit c26f80b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/pwabuilder/Services/AzureStorageAnalysisJobQueue.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ public AzureStorageAnalysisJobQueue(
2727
this.healthMonitor = healthMonitor;
2828
this.logger = logger;
2929

30+
var managedIdentityAppId = appSettings.Value.AzureManagedIdentityApplicationId;
31+
var credential = new ManagedIdentityCredential(clientId: managedIdentityAppId);
32+
3033
var queueUri = new Uri($"{appSettings.Value.AzureStorageQueueUri.TrimEnd('/')}/{QueueName}");
31-
this.queueClient = new QueueClient(queueUri, new DefaultAzureCredential());
34+
this.queueClient = new QueueClient(queueUri, credential);
3235
}
3336

3437
/// <summary>

0 commit comments

Comments
 (0)