Azure Synapse Analytics :- Managed Identity Credential Set Default
Hello Team,
How could we set default manage identity for Azure synapse resources without mentioning param while creating a synapse resource client?
Like below code -
LinkedServiceClient client = new LinkedServiceClient(endpoint: new Uri("url"), credential: new DefaultAzureCredential());
For
credential: new DefaultAzureCredential()
The mentioned code works fine for local env but doesn't work after deployed on the server. It is throwing an exception "ManagedIdentityCredential authentication failed: No MSI found for specified ClientId/ResourceId. Status: 400 (Bad Request)"
If we specify a Managed Identity ClientId for credentials, then it works smoothly on local and server env too.
Code :-
var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions { ManagedIdentityClientId = "abcs"});
var client = new LinkedServiceClient(endpoint: new Uri("url"), credential: credential);
We don't want to set any ManagedIdentityClientId for DefaultAzureCredentialOptions. This could be set by default on the server.
The default value should be picked up from the azure portal.
How could we manage this ? Is there any way to do this ?