Open alexander-kastil opened 11 months ago
@arambazamba Thanks for your feedback! We will investigate and update as appropriate.
Some how a bit of information is missing in your docs ... VSCode is reporting: The attribute 'EntityTriggerAttribute' is a WebJobs attribute and not supported in the .NET Worker (Isolated Process).
host.json
{ "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" }, "enableLiveMetricsFilters": true } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.*, 5.0.0)" } }
Also adding
<PackageReference Include="Microsoft.DurableTask.Generators" Version="1.0.0-preview.1" />
does not help ... Having a sample that compiles would help a lot to get the initial setup done!
I found it quite hard to migrate from a very common sample to migrate. My VSCode did not recognize the new attributes. Can you document which .Net Version, Packages, Function Template you are using or provide a link to a running sample please?
[FunctionName(nameof(DurableBankAccount.BankAccount))] public static void BankAccount([EntityTrigger] IDurableEntityContext context) { switch (context.OperationName.ToLowerInvariant()) { case "deposit": context.SetState(context.GetState() + context.GetInput());
break;
case "withdraw":
var balance = context.GetState() - context.GetInput();
context.SetState(balance);
break;
}
}
[FunctionName("UpdateBalance")] public static async Task Run(
[HttpTrigger(AuthorizationLevel.Function, Route = "bankAccount/updateBalance/{entityKey}/{amount}")] HttpRequestMessage req,
[DurableClient] IDurableEntityClient client,
string entityKey, string amount)
{
var entityId = new EntityId(nameof(BankAccount), entityKey);
}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.