Skip to content

Commit

Permalink
Fix Issue with System-Assigned Managed Identity in Azure Functions (#829
Browse files Browse the repository at this point in the history
)

For some reason, userId is coming as empty in this block, as reported in issue 815
  • Loading branch information
cheenamalhotra committed Dec 4, 2020
1 parent e286592 commit 4f4f412
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public override async Task<SqlAuthenticationToken> AcquireTokenAsync(SqlAuthenti
string objectIdParameter = string.Empty;

// If user assigned managed identity is specified, include object ID parameter in request
if (parameters.UserId != default)
if (!string.IsNullOrWhiteSpace(parameters.UserId))
{
objectIdParameter = $"&object_id={Uri.EscapeDataString(parameters.UserId)}";
SqlClientEventSource.Log.TryTraceEvent("AcquireTokenAsync | Identity Object id received and will be used for acquiring access token {0}", parameters.UserId);
Expand Down

0 comments on commit 4f4f412

Please sign in to comment.