Hello,
I'm trying to update a record from Dataverse using an Azure function.
My first step is to try to get the service/client, the variable that's used in any plugin to CRUD the Dataverse.
My code is:
public static void Run([TimerTrigger("0 0 0 * * *")]TimerInfo myTimer, ILogger log)
{
var service = DataverseConnection();
}
private static ServiceClient DataverseConnection()
{
var clientID = Environment.GetEnvironmentVariable("cdsclientid", EnvironmentVariableTarget.Process);
var clientSecret = Environment.GetEnvironmentVariable("cdsclientsecret", EnvironmentVariableTarget.Process);
var crmBaseUrl = Environment.GetEnvironmentVariable("cdsurl", EnvironmentVariableTarget.Process);
var connectionString = @$"Url={crmBaseUrl};AuthType=ClientSecret;ClientId={clientID};ClientSecret={clientSecret};RequireNewInstance=true";
var service = new ServiceClient(connectionString);
return service;
}
I know the environment variables are correct because I can fetch data like in this guide PL-400_Microsoft-Power-Platform-Developer (microsoftlearning.github.io)
The error I get is:
I'm using netcoreapp 3.1 and my dependencies are:
Thanks.


Report
All responses (
Answers (