You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error -
Non-Deterministic workflow detected: A previous execution of this orchestration scheduled an activity task with sequence ID 0 and name 'AzureMonitorConnectorActivityFunction' (version ''), but the current replay execution hasn't (yet?) scheduled this task. Was a change made to the orchestrator code after this instance had already started running?
From the error message, it looks like the first call itself hasn't taken place.
We had the below code for auth using federated MI in the code -
publicTokenCredentialGetClientCredential(stringtenantId){try{logger.LogInformation($"Getting client credentials for tenant {tenantId} using clientId: {authOptions.ClientId}");ManagedIdentityClientAssertionmanagedIdentityClientAssertion=newManagedIdentityClientAssertion(authOptions.FederatedManagedIdentityClientId);ClientAssertionCredentialcredential=newClientAssertionCredential(tenantId,authOptions.ClientId,managedIdentityClientAssertion.GetSignedAssertion);returncredential;}catch(Exceptionex){logger.LogError(ex,$"Failed to get client credential for tenant {tenantId}.");throw;}}
With the upgrade of Microsoft.Azure.Functions.Worker.Extensions.DurableTask to 1.1.6, there was a breaking change that the sync method for 'GetSignedAssertion' no longer exists and is replaced by 'GetSignedAssertionAsync'. To support this, we made the below change -
publicTokenCredentialGetClientCredential(stringtenantId){try{logger.LogInformation($"Getting client credentials for tenant {tenantId} using clientId: {authOptions.ClientId}");stringauthority=$"https://login.microsoftonline.com/{tenantId}";logger.LogInformation($"Getting client credentials for tenant {tenantId} using authority: {authority}");AssertionRequestOptionsassertionOptions=new(){ClientID=authOptions.ClientId,TokenEndpoint=authority,};Func<CancellationToken,Task<string>>returnMSIToken=async(CancellationTokencancellationToken)=>{stringmsiToken=awaitnewManagedIdentityClientAssertion(authOptions.FederatedManagedIdentityClientId).GetSignedAssertionAsync(assertionOptions).ConfigureAwait(false);returnmsiToken;};logger.LogInformation($"Getting client credentials for tenant {tenantId} using MSIToken: {authOptions.FederatedManagedIdentityClientId}");ClientAssertionCredentialcredential=newClientAssertionCredential(tenantId,authOptions.ClientId,returnMSIToken);logger.LogInformation($"Successfully acquired client credentials for tenant {tenantId}.");returncredential;}catch(Exceptionex){logger.LogError(ex,$"Failed to get client credential for tenant {tenantId}.");throw;}}
This method is being wrapped in a sync call from the orchestrator, and this has been the only change in our code with the package upgrades.
Orchestrator and Service calls -
publicasyncTaskRunOrchestrator([OrchestrationTrigger]TaskOrchestrationContextcontext){...try{// Call the method synchronously, as orchestrator code cannot contain 'non-durable async calls' [https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp#async-apis]connectors=rpaasService.GetAllAsync().GetAwaiter().GetResult();}catch(Exceptionex){logger.LogError(ex,$"Error gettingresponse. Check the inner exception for details.");throw;}..}publicasyncTask<IEnumerable<Response>>GetAllAsync(){...ClientAssertionCredentialcredential=(ClientAssertionCredential)GetClientCredential(tenantId);TokenRequestContexttokenRequestContext=newTokenRequestContext(newstring[]{scope});accessToken=awaitcredential.GetTokenAsync(tokenRequestContext);returnaccessToken;..
Since the orchestrator is calling GetAllAsync() synchronously, we shouldn't be running into this issue, right?
We do some processing after we get this response and only then trigger the first activity function.
Kindly help us figure out what the issue is.
The text was updated successfully, but these errors were encountered:
Error -
Non-Deterministic workflow detected: A previous execution of this orchestration scheduled an activity task with sequence ID 0 and name 'AzureMonitorConnectorActivityFunction' (version ''), but the current replay execution hasn't (yet?) scheduled this task. Was a change made to the orchestrator code after this instance had already started running?
From the error message, it looks like the first call itself hasn't taken place.
Package Update Info
before package update
We had the below code for auth using federated MI in the code -
after package update
With the upgrade of Microsoft.Azure.Functions.Worker.Extensions.DurableTask to 1.1.6, there was a breaking change that the sync method for 'GetSignedAssertion' no longer exists and is replaced by 'GetSignedAssertionAsync'. To support this, we made the below change -
This method is being wrapped in a sync call from the orchestrator, and this has been the only change in our code with the package upgrades.
Orchestrator and Service calls -
Since the orchestrator is calling GetAllAsync() synchronously, we shouldn't be running into this issue, right?
We do some processing after we get this response and only then trigger the first activity function.
Kindly help us figure out what the issue is.
The text was updated successfully, but these errors were encountered: