├── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── media └── images │ ├── OrderProcessor │ ├── container-ports.png │ ├── dashboard-overview.png │ ├── dashboard-url.png │ ├── input-output.png │ ├── instance-details.png │ ├── resource-group.png │ └── taskhub.png │ ├── PdfSummarizer │ ├── architecture_v3.png │ └── dotnet-code.png │ ├── activity.png │ ├── architecture_v2.png │ ├── architecture_v3.png │ ├── code.png │ ├── connecting-dts.png │ ├── dashboard.png │ ├── dotnet-code.png │ ├── dtfx │ └── dtfx-sample-dashboard.png │ ├── dts-connected.png │ ├── dts-dashboard-resource.png │ ├── dts-overview-portal.png │ ├── durable-task-sdks │ ├── dts-in-all-computes.png │ └── portable-sample-dashboard.png │ ├── portable-sdks │ ├── dts-in-all-computes.png │ └── portable-sample-dashboard.png │ ├── sequence.png │ ├── taskhub-overview-portal.png │ ├── taskhub-overview.png │ └── video_thumbnail.png ├── quickstarts └── durable-functions │ └── dotnet │ └── HelloCities │ ├── .devcontainer │ ├── Dockerfile │ ├── devcontainer.json │ └── first-run-notice.txt │ ├── .github │ ├── CODE_OF_CONDUCT.md │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json │ ├── README.md │ ├── azure.yaml │ ├── http │ ├── DurableFunctionsOrchestrationCSharp1.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── hello_cities.csproj │ └── host.json │ ├── infra │ ├── abbreviations.json │ ├── app │ │ ├── dts-Access.bicep │ │ ├── dts.bicep │ │ ├── durable-function.bicep │ │ ├── storage-Access.bicep │ │ ├── storage-PrivateEndpoint.bicep │ │ └── vnet.bicep │ ├── core │ │ ├── host │ │ │ ├── appservice-appsettings.bicep │ │ │ ├── appservice.bicep │ │ │ ├── appserviceplan.bicep │ │ │ ├── functions-flexconsumption.bicep │ │ │ └── functions.bicep │ │ ├── identity │ │ │ └── userAssignedIdentity.bicep │ │ ├── monitor │ │ │ ├── appinsights-access.bicep │ │ │ ├── applicationinsights.bicep │ │ │ ├── loganalytics.bicep │ │ │ └── monitoring.bicep │ │ ├── security │ │ │ └── role.bicep │ │ └── storage │ │ │ └── storage-account.bicep │ ├── main.bicep │ └── main.parameters.json │ └── scripts │ ├── deploy.ps1 │ └── deploy.sh └── samples ├── dtfx └── HelloWorld │ ├── HelloWorld.csproj │ ├── HelloWorld.sln │ ├── Program.cs │ └── README.md ├── durable-functions ├── dotnet │ ├── OrderProcessor │ │ ├── Models.cs │ │ ├── .gitignore │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── Activities │ │ │ ├── NotifyCustomer.cs │ │ │ ├── ProcessPayment.cs │ │ │ ├── ReserveInventory.cs │ │ │ └── UpdateInventory.cs │ │ ├── OrderProcessingOrchestration.cs │ │ ├── OrderProcessingParallelTest.cs │ │ ├── OrderProcessor.csproj │ │ ├── OrderProcessor.sln │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── azure.yaml │ │ ├── host.json │ │ ├── infra │ │ │ ├── abbreviations.json │ │ │ ├── app │ │ │ │ ├── dts-Access.bicep │ │ │ │ ├── dts.bicep │ │ │ │ ├── durable-function.bicep │ │ │ │ ├── storage-Access.bicep │ │ │ │ ├── storage-PrivateEndpoint.bicep │ │ │ │ └── vnet.bicep │ │ │ ├── core │ │ │ │ ├── host │ │ │ │ │ ├── appservice-appsettings.bicep │ │ │ │ │ ├── appservice.bicep │ │ │ │ │ ├── appserviceplan.bicep │ │ │ │ │ └── functions.bicep │ │ │ │ ├── identity │ │ │ │ │ └── userAssignedIdentity.bicep │ │ │ │ ├── monitor │ │ │ │ │ ├── appinsights-access.bicep │ │ │ │ │ ├── applicationinsights.bicep │ │ │ │ │ ├── loganalytics.bicep │ │ │ │ │ └── monitoring.bicep │ │ │ │ ├── security │ │ │ │ │ └── role.bicep │ │ │ │ └── storage │ │ │ │ │ └── storage-account.bicep │ │ │ ├── main.bicep │ │ │ ├── main.parameters.json │ │ │ ├── modules │ │ │ │ └── fetch-container-image.bicep │ │ │ └── shared │ │ │ │ ├── apps-env.bicep │ │ │ │ ├── dashboard-web.bicep │ │ │ │ ├── keyvault.bicep │ │ │ │ ├── monitoring.bicep │ │ │ │ └── registry.bicep │ │ └── scripts │ │ │ ├── deploy.ps1 │ │ │ └── deploy.sh │ ├── PdfSummarizer │ │ ├── .gitignore │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── PdfSummarizer.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── azure.yaml │ │ ├── host.json │ │ ├── infra │ │ │ ├── abbreviations.json │ │ │ ├── app │ │ │ │ ├── documentintelligence-Access.bicep │ │ │ │ ├── dts-Access.bicep │ │ │ │ ├── dts.bicep │ │ │ │ ├── durable-function.bicep │ │ │ │ ├── openai-Access.bicep │ │ │ │ ├── storage-Access.bicep │ │ │ │ ├── storage-PrivateEndpoint.bicep │ │ │ │ └── vnet.bicep │ │ │ ├── core │ │ │ │ ├── ai │ │ │ │ │ └── openai.bicep │ │ │ │ ├── host │ │ │ │ │ ├── appservice-appsettings.bicep │ │ │ │ │ ├── appservice.bicep │ │ │ │ │ ├── appserviceplan.bicep │ │ │ │ │ ├── functions-flexconsumption.bicep │ │ │ │ │ └── functions.bicep │ │ │ │ ├── identity │ │ │ │ │ └── userAssignedIdentity.bicep │ │ │ │ ├── monitor │ │ │ │ │ ├── appinsights-access.bicep │ │ │ │ │ ├── applicationinsights.bicep │ │ │ │ │ ├── loganalytics.bicep │ │ │ │ │ └── monitoring.bicep │ │ │ │ ├── security │ │ │ │ │ └── role.bicep │ │ │ │ └── storage │ │ │ │ │ └── storage-account.bicep │ │ │ ├── main.bicep │ │ │ ├── main.parameters.json │ │ │ ├── modules │ │ │ │ └── fetch-container-image.bicep │ │ │ └── shared │ │ │ │ ├── apps-env.bicep │ │ │ │ ├── dashboard-web.bicep │ │ │ │ ├── keyvault.bicep │ │ │ │ ├── monitoring.bicep │ │ │ │ └── registry.bicep │ │ ├── pdf-summarizer-dotnet.csproj │ │ └── scripts │ │ │ ├── deploy.ps1 │ │ │ └── deploy.sh │ └── README.md └── python │ └── pdf-summarizer │ ├── .gitignore │ ├── README.md │ ├── azure.yaml │ ├── function_app.py │ ├── host.json │ ├── infra │ ├── abbreviations.json │ ├── app │ │ ├── documentintelligence-Access.bicep │ │ ├── dts-Access.bicep │ │ ├── dts.bicep │ │ ├── durable-function.bicep │ │ ├── openai-Access.bicep │ │ ├── storage-Access.bicep │ │ ├── storage-PrivateEndpoint.bicep │ │ └── vnet.bicep │ ├── core │ │ ├── ai │ │ │ └── cognitiveservices.bicep │ │ ├── host │ │ │ ├── appservice-appsettings.bicep │ │ │ ├── appservice.bicep │ │ │ ├── appserviceplan.bicep │ │ │ ├── functions-flexconsumption.bicep │ │ │ └── functions.bicep │ │ ├── identity │ │ │ └── userAssignedIdentity.bicep │ │ ├── monitor │ │ │ ├── appinsights-access.bicep │ │ │ ├── applicationinsights.bicep │ │ │ ├── loganalytics.bicep │ │ │ └── monitoring.bicep │ │ ├── security │ │ │ └── role.bicep │ │ └── storage │ │ │ └── storage-account.bicep │ ├── main.bicep │ ├── main.parameters.json │ ├── modules │ │ └── fetch-container-image.bicep │ └── shared │ │ ├── apps-env.bicep │ │ ├── dashboard-web.bicep │ │ ├── keyvault.bicep │ │ ├── monitoring.bicep │ │ └── registry.bicep │ ├── next-steps.md │ └── requirements.txt ├── durable-task-sdks ├── dotnet │ ├── .editorconfig │ ├── AspNetWebApp │ │ ├── AspNetWebApp.csproj │ │ ├── DockerFile │ │ ├── Orchestrations │ │ │ └── HelloCities.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── ScenariosController.cs │ │ ├── Utils.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ └── appsettings.json │ ├── EntitiesSample │ │ ├── AccountTransferBackend.csproj │ │ ├── Controllers │ │ │ └── AccountsController.cs │ │ ├── Entities │ │ │ └── Account.cs │ │ ├── EntitiesSample.sln │ │ ├── Models │ │ │ ├── TransactionRequest.cs │ │ │ └── TransferFundsRequest.cs │ │ ├── Orchestrations │ │ │ └── TransferFundsOrchestration.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── demo.http │ ├── FanOutFanIn │ │ ├── Client │ │ │ ├── Client.csproj │ │ │ └── Program.cs │ │ ├── README.md │ │ └── Worker │ │ │ ├── ParallelProcessingOrchestration.cs │ │ │ ├── Program.cs │ │ │ └── Worker.csproj │ ├── FunctionChaining │ │ ├── .gitignore │ │ ├── Client │ │ │ ├── Client.csproj │ │ │ ├── Dockerfile │ │ │ └── Program.cs │ │ ├── FunctionChaining.sln │ │ ├── README.md │ │ ├── Worker │ │ │ ├── Dockerfile │ │ │ ├── GreetingOrchestration.cs │ │ │ ├── Program.cs │ │ │ └── Worker.csproj │ │ ├── azure.yaml │ │ └── infra │ │ │ ├── abbreviations.json │ │ │ ├── app │ │ │ ├── app.bicep │ │ │ ├── dts.bicep │ │ │ └── user-assigned-identity.bicep │ │ │ ├── core │ │ │ ├── ai │ │ │ │ ├── cognitiveservices.bicep │ │ │ │ ├── hub-dependencies.bicep │ │ │ │ ├── hub.bicep │ │ │ │ └── project.bicep │ │ │ ├── config │ │ │ │ └── configstore.bicep │ │ │ ├── database │ │ │ │ ├── cosmos │ │ │ │ │ ├── cosmos-account.bicep │ │ │ │ │ ├── mongo │ │ │ │ │ │ ├── cosmos-mongo-account.bicep │ │ │ │ │ │ └── cosmos-mongo-db.bicep │ │ │ │ │ └── sql │ │ │ │ │ │ ├── cosmos-sql-account.bicep │ │ │ │ │ │ ├── cosmos-sql-db.bicep │ │ │ │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ │ │ │ └── cosmos-sql-role-def.bicep │ │ │ │ ├── mysql │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ ├── postgresql │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ └── sqlserver │ │ │ │ │ └── sqlserver.bicep │ │ │ ├── gateway │ │ │ │ └── apim.bicep │ │ │ ├── host │ │ │ │ ├── ai-environment.bicep │ │ │ │ ├── aks-agent-pool.bicep │ │ │ │ ├── aks-managed-cluster.bicep │ │ │ │ ├── aks.bicep │ │ │ │ ├── appservice-appsettings.bicep │ │ │ │ ├── appservice.bicep │ │ │ │ ├── appserviceplan.bicep │ │ │ │ ├── container-app-upsert.bicep │ │ │ │ ├── container-app.bicep │ │ │ │ ├── container-apps-environment.bicep │ │ │ │ ├── container-apps.bicep │ │ │ │ ├── container-apps │ │ │ │ │ ├── app.bicep │ │ │ │ │ └── managed.bicep │ │ │ │ ├── container-registry.bicep │ │ │ │ ├── functions.bicep │ │ │ │ └── staticwebapp.bicep │ │ │ ├── monitor │ │ │ │ ├── applicationinsights-dashboard.bicep │ │ │ │ ├── applicationinsights.bicep │ │ │ │ ├── loganalytics.bicep │ │ │ │ └── monitoring.bicep │ │ │ ├── networking │ │ │ │ ├── cdn-endpoint.bicep │ │ │ │ ├── cdn-profile.bicep │ │ │ │ ├── cdn.bicep │ │ │ │ └── vnet.bicep │ │ │ ├── search │ │ │ │ └── search-services.bicep │ │ │ ├── security │ │ │ │ ├── aks-managed-cluster-access.bicep │ │ │ │ ├── configstore-access.bicep │ │ │ │ ├── keyvault-access.bicep │ │ │ │ ├── keyvault-secret.bicep │ │ │ │ ├── keyvault.bicep │ │ │ │ ├── registry-access.bicep │ │ │ │ └── role.bicep │ │ │ ├── storage │ │ │ │ └── storage-account.bicep │ │ │ └── testing │ │ │ │ └── loadtesting.bicep │ │ │ ├── main.bicep │ │ │ └── main.parameters.json │ ├── HumanInteraction │ │ ├── Client │ │ │ ├── ApprovalResponseData.cs │ │ │ ├── Client.csproj │ │ │ └── Program.cs │ │ ├── README.md │ │ └── Worker │ │ │ ├── ApprovalActivityInputs.cs │ │ │ ├── ApprovalOrchestration.cs │ │ │ ├── Program.cs │ │ │ └── Worker.csproj │ ├── OrchestrationVersioning │ │ ├── DockerFile │ │ ├── OrchestrationVersioning.csproj │ │ ├── Orchestrations │ │ │ └── HelloCities.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── ScenariosController.cs │ │ ├── Utils.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ └── appsettings.json │ └── ScheduleWebApp │ │ ├── Models │ │ ├── CreateScheduleRequest.cs │ │ └── UpdateScheduleRequest.cs │ │ ├── Orchestrations │ │ └── CacheClearingOrchestrator.cs │ │ ├── Program.cs │ │ ├── README.md │ │ ├── ScheduleController.cs │ │ ├── ScheduleWebApp.csproj │ │ ├── ScheduleWebApp.http │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ └── appsettings.json ├── java │ ├── README.md │ ├── async-http-api │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── WebApi.java │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── logback-spring.xml │ │ │ └── webapi.http │ ├── eternal-orchestrations │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── EternalOrchestration.java │ │ │ └── resources │ │ │ └── logback-spring.xml │ ├── fan-out-fan-in │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── FanOutFanInPattern.java │ │ │ └── resources │ │ │ └── logback-spring.xml │ ├── function-chaining │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── azure.yaml │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── infra │ │ │ ├── abbreviations.json │ │ │ ├── app │ │ │ │ ├── app.bicep │ │ │ │ ├── dts.bicep │ │ │ │ └── user-assigned-identity.bicep │ │ │ ├── core │ │ │ │ ├── ai │ │ │ │ │ ├── cognitiveservices.bicep │ │ │ │ │ ├── hub-dependencies.bicep │ │ │ │ │ ├── hub.bicep │ │ │ │ │ └── project.bicep │ │ │ │ ├── config │ │ │ │ │ └── configstore.bicep │ │ │ │ ├── database │ │ │ │ │ ├── cosmos │ │ │ │ │ │ ├── cosmos-account.bicep │ │ │ │ │ │ ├── mongo │ │ │ │ │ │ │ ├── cosmos-mongo-account.bicep │ │ │ │ │ │ │ └── cosmos-mongo-db.bicep │ │ │ │ │ │ └── sql │ │ │ │ │ │ │ ├── cosmos-sql-account.bicep │ │ │ │ │ │ │ ├── cosmos-sql-db.bicep │ │ │ │ │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ │ │ │ │ └── cosmos-sql-role-def.bicep │ │ │ │ │ ├── mysql │ │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ │ ├── postgresql │ │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ │ └── sqlserver │ │ │ │ │ │ └── sqlserver.bicep │ │ │ │ ├── gateway │ │ │ │ │ └── apim.bicep │ │ │ │ ├── host │ │ │ │ │ ├── ai-environment.bicep │ │ │ │ │ ├── aks-agent-pool.bicep │ │ │ │ │ ├── aks-managed-cluster.bicep │ │ │ │ │ ├── aks.bicep │ │ │ │ │ ├── appservice-appsettings.bicep │ │ │ │ │ ├── appservice.bicep │ │ │ │ │ ├── appserviceplan.bicep │ │ │ │ │ ├── container-app-upsert.bicep │ │ │ │ │ ├── container-app.bicep │ │ │ │ │ ├── container-apps-environment.bicep │ │ │ │ │ ├── container-apps.bicep │ │ │ │ │ ├── container-apps │ │ │ │ │ │ ├── app.bicep │ │ │ │ │ │ └── managed.bicep │ │ │ │ │ ├── container-registry.bicep │ │ │ │ │ ├── functions.bicep │ │ │ │ │ └── staticwebapp.bicep │ │ │ │ ├── monitor │ │ │ │ │ ├── applicationinsights-dashboard.bicep │ │ │ │ │ ├── applicationinsights.bicep │ │ │ │ │ ├── loganalytics.bicep │ │ │ │ │ └── monitoring.bicep │ │ │ │ ├── networking │ │ │ │ │ ├── cdn-endpoint.bicep │ │ │ │ │ ├── cdn-profile.bicep │ │ │ │ │ ├── cdn.bicep │ │ │ │ │ └── vnet.bicep │ │ │ │ ├── search │ │ │ │ │ └── search-services.bicep │ │ │ │ ├── security │ │ │ │ │ ├── aks-managed-cluster-access.bicep │ │ │ │ │ ├── configstore-access.bicep │ │ │ │ │ ├── keyvault-access.bicep │ │ │ │ │ ├── keyvault-secret.bicep │ │ │ │ │ ├── keyvault.bicep │ │ │ │ │ ├── registry-access.bicep │ │ │ │ │ └── role.bicep │ │ │ │ ├── storage │ │ │ │ │ └── storage-account.bicep │ │ │ │ └── testing │ │ │ │ │ └── loadtesting.bicep │ │ │ ├── main.bicep │ │ │ └── main.parameters.json │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── ChainingPattern.java │ │ │ └── resources │ │ │ └── logback-spring.xml │ ├── human-interaction │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── HumanInteraction.java │ │ │ └── resources │ │ │ └── logback-spring.xml │ ├── monitoring │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── durabletask │ │ │ │ └── samples │ │ │ │ └── MonitoringPattern.java │ │ │ └── resources │ │ │ └── logback-spring.xml │ └── sub-orchestrations │ │ ├── build.gradle │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── durabletask │ │ │ └── samples │ │ │ └── SubOrchestrationPattern.java │ │ └── resources │ │ └── logback-spring.xml └── python │ ├── async-http-api │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py │ ├── eternal-orchestrations │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py │ ├── fan-out-fan-in │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py │ ├── function-chaining │ ├── Dockerfile.client │ ├── Dockerfile.worker │ ├── README.md │ ├── azure.yaml │ ├── client.py │ ├── infra │ │ ├── abbreviations.json │ │ ├── app │ │ │ ├── app.bicep │ │ │ ├── dts.bicep │ │ │ └── user-assigned-identity.bicep │ │ ├── core │ │ │ ├── ai │ │ │ │ ├── cognitiveservices.bicep │ │ │ │ ├── hub-dependencies.bicep │ │ │ │ ├── hub.bicep │ │ │ │ └── project.bicep │ │ │ ├── config │ │ │ │ └── configstore.bicep │ │ │ ├── database │ │ │ │ ├── cosmos │ │ │ │ │ ├── cosmos-account.bicep │ │ │ │ │ ├── mongo │ │ │ │ │ │ ├── cosmos-mongo-account.bicep │ │ │ │ │ │ └── cosmos-mongo-db.bicep │ │ │ │ │ └── sql │ │ │ │ │ │ ├── cosmos-sql-account.bicep │ │ │ │ │ │ ├── cosmos-sql-db.bicep │ │ │ │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ │ │ │ └── cosmos-sql-role-def.bicep │ │ │ │ ├── mysql │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ ├── postgresql │ │ │ │ │ └── flexibleserver.bicep │ │ │ │ └── sqlserver │ │ │ │ │ └── sqlserver.bicep │ │ │ ├── gateway │ │ │ │ └── apim.bicep │ │ │ ├── host │ │ │ │ ├── ai-environment.bicep │ │ │ │ ├── aks-agent-pool.bicep │ │ │ │ ├── aks-managed-cluster.bicep │ │ │ │ ├── aks.bicep │ │ │ │ ├── appservice-appsettings.bicep │ │ │ │ ├── appservice.bicep │ │ │ │ ├── appserviceplan.bicep │ │ │ │ ├── container-app-upsert.bicep │ │ │ │ ├── container-app.bicep │ │ │ │ ├── container-apps-environment.bicep │ │ │ │ ├── container-apps.bicep │ │ │ │ ├── container-apps │ │ │ │ │ ├── app.bicep │ │ │ │ │ └── managed.bicep │ │ │ │ ├── container-registry.bicep │ │ │ │ ├── functions.bicep │ │ │ │ └── staticwebapp.bicep │ │ │ ├── monitor │ │ │ │ ├── applicationinsights-dashboard.bicep │ │ │ │ ├── applicationinsights.bicep │ │ │ │ ├── loganalytics.bicep │ │ │ │ └── monitoring.bicep │ │ │ ├── networking │ │ │ │ ├── cdn-endpoint.bicep │ │ │ │ ├── cdn-profile.bicep │ │ │ │ ├── cdn.bicep │ │ │ │ └── vnet.bicep │ │ │ ├── search │ │ │ │ └── search-services.bicep │ │ │ ├── security │ │ │ │ ├── aks-managed-cluster-access.bicep │ │ │ │ ├── configstore-access.bicep │ │ │ │ ├── keyvault-access.bicep │ │ │ │ ├── keyvault-secret.bicep │ │ │ │ ├── keyvault.bicep │ │ │ │ ├── registry-access.bicep │ │ │ │ └── role.bicep │ │ │ ├── storage │ │ │ │ └── storage-account.bicep │ │ │ └── testing │ │ │ │ └── loadtesting.bicep │ │ ├── main.bicep │ │ └── main.parameters.json │ ├── requirements.txt │ └── worker.py │ ├── human-interaction │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py │ ├── monitoring │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py │ └── sub-orchestrations │ ├── README.md │ ├── client.py │ ├── requirements.txt │ └── worker.py └── scenarios └── AutoscalingInACA ├── .gitignore ├── AutoscalingInACA.sln ├── Client ├── Client.csproj ├── Dockerfile └── Program.cs ├── README.md ├── Worker ├── Dockerfile ├── GreetingOrchestration.cs ├── Program.cs └── Worker.csproj ├── azure.yaml └── infra ├── abbreviations.json ├── app ├── app.bicep ├── dts.bicep └── user-assigned-identity.bicep ├── core ├── ai │ ├── cognitiveservices.bicep │ ├── hub-dependencies.bicep │ ├── hub.bicep │ └── project.bicep ├── config │ └── configstore.bicep ├── database │ ├── cosmos │ │ ├── cosmos-account.bicep │ │ ├── mongo │ │ │ ├── cosmos-mongo-account.bicep │ │ │ └── cosmos-mongo-db.bicep │ │ └── sql │ │ │ ├── cosmos-sql-account.bicep │ │ │ ├── cosmos-sql-db.bicep │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ └── cosmos-sql-role-def.bicep │ ├── mysql │ │ └── flexibleserver.bicep │ ├── postgresql │ │ └── flexibleserver.bicep │ └── sqlserver │ │ └── sqlserver.bicep ├── gateway │ └── apim.bicep ├── host │ ├── ai-environment.bicep │ ├── aks-agent-pool.bicep │ ├── aks-managed-cluster.bicep │ ├── aks.bicep │ ├── appservice-appsettings.bicep │ ├── appservice.bicep │ ├── appserviceplan.bicep │ ├── container-app-upsert.bicep │ ├── container-app.bicep │ ├── container-apps-environment.bicep │ ├── container-apps.bicep │ ├── container-apps │ │ ├── app.bicep │ │ └── managed.bicep │ ├── container-registry.bicep │ ├── functions.bicep │ └── staticwebapp.bicep ├── monitor │ ├── applicationinsights-dashboard.bicep │ ├── applicationinsights.bicep │ ├── loganalytics.bicep │ └── monitoring.bicep ├── networking │ ├── cdn-endpoint.bicep │ ├── cdn-profile.bicep │ ├── cdn.bicep │ └── vnet.bicep ├── search │ └── search-services.bicep ├── security │ ├── aks-managed-cluster-access.bicep │ ├── configstore-access.bicep │ ├── keyvault-access.bicep │ ├── keyvault-secret.bicep │ ├── keyvault.bicep │ ├── registry-access.bicep │ └── role.bicep ├── storage │ └── storage-account.bicep └── testing │ └── loadtesting.bicep ├── main.bicep └── main.parameters.json /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd [repo-name] 31 | git checkout [branch-name] 32 | npm install 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [project-title] Changelog 2 | 3 | 4 | # x.y.z (yyyy-mm-dd) 5 | 6 | *Features* 7 | * ... 8 | 9 | *Bug Fixes* 10 | * ... 11 | 12 | *Breaking Changes* 13 | * ... 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /media/images/OrderProcessor/container-ports.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/container-ports.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/dashboard-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/dashboard-overview.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/dashboard-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/dashboard-url.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/input-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/input-output.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/instance-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/instance-details.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/resource-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/resource-group.png -------------------------------------------------------------------------------- /media/images/OrderProcessor/taskhub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/OrderProcessor/taskhub.png -------------------------------------------------------------------------------- /media/images/PdfSummarizer/architecture_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/PdfSummarizer/architecture_v3.png -------------------------------------------------------------------------------- /media/images/PdfSummarizer/dotnet-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/PdfSummarizer/dotnet-code.png -------------------------------------------------------------------------------- /media/images/activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/activity.png -------------------------------------------------------------------------------- /media/images/architecture_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/architecture_v2.png -------------------------------------------------------------------------------- /media/images/architecture_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/architecture_v3.png -------------------------------------------------------------------------------- /media/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/code.png -------------------------------------------------------------------------------- /media/images/connecting-dts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/connecting-dts.png -------------------------------------------------------------------------------- /media/images/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dashboard.png -------------------------------------------------------------------------------- /media/images/dotnet-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dotnet-code.png -------------------------------------------------------------------------------- /media/images/dtfx/dtfx-sample-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dtfx/dtfx-sample-dashboard.png -------------------------------------------------------------------------------- /media/images/dts-connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dts-connected.png -------------------------------------------------------------------------------- /media/images/dts-dashboard-resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dts-dashboard-resource.png -------------------------------------------------------------------------------- /media/images/dts-overview-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/dts-overview-portal.png -------------------------------------------------------------------------------- /media/images/durable-task-sdks/dts-in-all-computes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/durable-task-sdks/dts-in-all-computes.png -------------------------------------------------------------------------------- /media/images/durable-task-sdks/portable-sample-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/durable-task-sdks/portable-sample-dashboard.png -------------------------------------------------------------------------------- /media/images/portable-sdks/dts-in-all-computes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/portable-sdks/dts-in-all-computes.png -------------------------------------------------------------------------------- /media/images/portable-sdks/portable-sample-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/portable-sdks/portable-sample-dashboard.png -------------------------------------------------------------------------------- /media/images/sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/sequence.png -------------------------------------------------------------------------------- /media/images/taskhub-overview-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/taskhub-overview-portal.png -------------------------------------------------------------------------------- /media/images/taskhub-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/taskhub-overview.png -------------------------------------------------------------------------------- /media/images/video_thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/media/images/video_thumbnail.png -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Functions Quickstarts Codespace", 3 | "dockerFile": "Dockerfile", 4 | "features": { 5 | "azure-cli": "latest" 6 | }, 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "ms-azuretools.vscode-bicep", 11 | "ms-azuretools.vscode-docker", 12 | "ms-azuretools.vscode-azurefunctions", 13 | "GitHub.copilot", 14 | "humao.rest-client" 15 | ] 16 | } 17 | }, 18 | "mounts": [ 19 | // Mount docker-in-docker library volume 20 | "source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" 21 | ], 22 | // Always run image-defined docker-init.sh to enable docker-in-docker 23 | "overrideCommand": false, 24 | "remoteUser": "codespace", 25 | "runArgs": [ 26 | // Enable ptrace-based debugging for Go in container 27 | "--cap-add=SYS_PTRACE", 28 | "--security-opt", 29 | "seccomp=unconfined", 30 | 31 | // Enable docker-in-docker configuration 32 | "--init", 33 | "--privileged" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.devcontainer/first-run-notice.txt: -------------------------------------------------------------------------------- 1 | 👋 Welcome to the Functions Codespace! You are on the Functions Quickstarts image. 2 | It includes everything needed to run through our tutorials and quickstart applications. 3 | 4 | 📚 Functions docs can be found at: https://learn.microsoft.com/en-us/azure/azure-functions/ 5 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd [repo-name] 31 | git checkout [branch-name] 32 | npm install 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-dotnettools.csharp" 5 | ] 6 | } -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "http/bin/Release/net8.0/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~4", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish (functions)" 7 | } -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | name: functions-quickstart-dotnet-azd-sfi-wave1-premium 4 | metadata: 5 | template: functions-quickstart-dotnet-azd-sfi-wave1-premium@1.0.0 6 | services: 7 | durable-function: 8 | project: ./http/ 9 | language: dotnet 10 | host: function 11 | hooks: 12 | postprovision: 13 | windows: 14 | shell: pwsh 15 | run: ./scripts/deploy.ps1 16 | interactive: true 17 | continueOnError: false 18 | posix: 19 | shell: sh 20 | run: ./scripts/deploy.sh 21 | interactive: true 22 | continueOnError: false 23 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/http/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | var host = new HostBuilder() 6 | .ConfigureFunctionsWebApplication() 7 | .ConfigureServices(services => { 8 | services.AddApplicationInsightsTelemetryWorkerService(); 9 | services.ConfigureFunctionsApplicationInsights(); 10 | }) 11 | .Build(); 12 | 13 | host.Run(); 14 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/http/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "hello_cities": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7092", 6 | "launchBrowser": false, 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/http/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true 10 | }, 11 | "logLevel": { 12 | "DurableTask.AzureManagedBackend": "Information" 13 | } 14 | }, 15 | "extensions": { 16 | "durableTask": { 17 | "storageProvider": { 18 | "type": "azureManaged", 19 | "connectionStringName": "DURABLE_TASK_SERVICE_CONNECTION_STRING" 20 | }, 21 | "hubName": "%TASKHUB_NAME%" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/app/dts-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param dtsName string 4 | param principalType string 5 | 6 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' existing = { 7 | name: dtsName 8 | } 9 | 10 | resource dtsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(dts.id, principalID, roleDefinitionID ) 12 | scope: dts 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID ) 15 | principalId: principalID 16 | principalType: principalType 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/app/storage-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param storageAccountName string 4 | param principalType string = 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 5 | 6 | resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { 7 | name: storageAccountName 8 | } 9 | 10 | // Allow access from API to storage account using a managed identity and least priv Storage roles 11 | resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 12 | name: guid(storageAccount.id, principalID, roleDefinitionID) 13 | scope: storageAccount 14 | properties: { 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 16 | principalId: principalID 17 | principalType: principalType 18 | } 19 | } 20 | 21 | output ROLE_ASSIGNMENT_NAME string = storageRoleAssignment.name 22 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | properties: { 17 | reserved: reserved 18 | } 19 | } 20 | 21 | output id string = appServicePlan.id 22 | output name string = appServicePlan.name 23 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/identity/userAssignedIdentity.bicep: -------------------------------------------------------------------------------- 1 | param identityName string 2 | param location string 3 | param tags object = {} 4 | 5 | resource userAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-07-31-preview' = { 6 | name: identityName 7 | location: location 8 | tags: tags 9 | } 10 | 11 | output identityId string = userAssignedIdentity.id 12 | output identityName string = userAssignedIdentity.name 13 | output identityPrincipalId string = userAssignedIdentity.properties.principalId 14 | output identityClientId string = userAssignedIdentity.properties.clientId 15 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/monitor/appinsights-access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param appInsightsName string 4 | 5 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 6 | name: appInsightsName 7 | } 8 | 9 | // Allow access from API to app insights using a managed identity and least priv role 10 | resource appInsightsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(applicationInsights.id, principalID, roleDefinitionID) 12 | scope: applicationInsights 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 15 | principalId: principalID 16 | principalType: 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 17 | } 18 | } 19 | 20 | output ROLE_ASSIGNMENT_NAME string = appInsightsRoleAssignment.name 21 | 22 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceId string 6 | param disableLocalAuth bool = false 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | DisableLocalAuth: disableLocalAuth 17 | } 18 | } 19 | 20 | output connectionString string = applicationInsights.properties.ConnectionString 21 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 22 | output name string = applicationInsights.name 23 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 6 | name: name 7 | location: location 8 | tags: tags 9 | properties: any({ 10 | retentionInDays: 30 11 | features: { 12 | searchVersion: 1 13 | } 14 | sku: { 15 | name: 'PerGB2018' 16 | } 17 | }) 18 | } 19 | 20 | output id string = logAnalytics.id 21 | output name string = logAnalytics.name 22 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | param disableLocalAuth bool = false 6 | 7 | module logAnalytics 'loganalytics.bicep' = { 8 | name: 'loganalytics' 9 | params: { 10 | name: logAnalyticsName 11 | location: location 12 | tags: tags 13 | } 14 | } 15 | 16 | module applicationInsights 'applicationinsights.bicep' = { 17 | name: 'applicationinsights' 18 | params: { 19 | name: applicationInsightsName 20 | location: location 21 | tags: tags 22 | logAnalyticsWorkspaceId: logAnalytics.outputs.id 23 | disableLocalAuth: disableLocalAuth 24 | } 25 | } 26 | 27 | output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString 28 | output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey 29 | output applicationInsightsName string = applicationInsights.outputs.name 30 | output logAnalyticsWorkspaceId string = logAnalytics.outputs.id 31 | output logAnalyticsWorkspaceName string = logAnalytics.outputs.name 32 | -------------------------------------------------------------------------------- /quickstarts/durable-functions/dotnet/HelloCities/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/dtfx/HelloWorld/HelloWorld.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/dtfx/HelloWorld/HelloWorld.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.11.35327.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "HelloWorld.csproj", "{6836DA0A-484B-41EB-A82F-5F89E7039462}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6836DA0A-484B-41EB-A82F-5F89E7039462}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6836DA0A-484B-41EB-A82F-5F89E7039462}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6836DA0A-484B-41EB-A82F-5F89E7039462}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6836DA0A-484B-41EB-A82F-5F89E7039462}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {AA5A94A4-EBD1-4D7B-8752-EC501F6EB1E0} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/ Models.cs: -------------------------------------------------------------------------------- 1 | namespace Company.Function.Models 2 | { 3 | public record OrderPayload(string Name, double TotalCost, int Quantity = 1); 4 | public record InventoryRequest(string RequestId, string ItemName, int Quantity); 5 | public record InventoryResult(bool Success, OrderPayload orderPayload); 6 | public record PaymentRequest(string RequestId, string ItemBeingPurchased, int Amount, double Cost); 7 | public record OrderResult(bool Processed); 8 | public record InventoryItem(string Name, double TotalCost, int Quantity); 9 | public record Notification(string Message); 10 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-dotnettools.csharp" 5 | ] 6 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/net8.0/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~4", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish (functions)" 7 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/Activities/NotifyCustomer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Logging; 3 | using Company.Function.Models; 4 | 5 | namespace Company.Function.Activities 6 | { 7 | public static class NotifyCustomer{ 8 | [Function(nameof(NotifyCustomer))] 9 | public static async Task RunAsync([ActivityTrigger] Notification notification, 10 | FunctionContext executionContext) 11 | { 12 | ILogger logger = executionContext.GetLogger("NotifyCustomer"); 13 | logger.LogInformation(notification.Message); 14 | 15 | // Simulate async call sending notification 16 | await Task.Delay(TimeSpan.FromSeconds(5)); 17 | 18 | return null; 19 | } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/Activities/ProcessPayment.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Logging; 3 | using Company.Function.Models; 4 | 5 | namespace Company.Function.Activities 6 | { 7 | public static class ProcessPayment{ 8 | [Function(nameof(ProcessPayment))] 9 | public static async Task RunAsync([ActivityTrigger] PaymentRequest req, 10 | FunctionContext executionContext) 11 | { 12 | ILogger logger = executionContext.GetLogger("ProcessPayment"); 13 | logger.LogInformation("Processing payment: {requestId} for {amount} {item} totaling ${cost}", 14 | req.RequestId, 15 | req.Amount, 16 | req.ItemBeingPurchased, 17 | req.Cost); 18 | 19 | // Simulate slow processing 20 | await Task.Delay(TimeSpan.FromSeconds(7)); 21 | 22 | logger.LogInformation("Payment for request ID '{requestId}' processed successfully", req.RequestId); 23 | 24 | return null; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | var host = new HostBuilder() 6 | .ConfigureFunctionsWebApplication() 7 | .ConfigureServices(services => { 8 | services.AddApplicationInsightsTelemetryWorkerService(); 9 | services.ConfigureFunctionsApplicationInsights(); 10 | }) 11 | .Build(); 12 | 13 | host.Run(); 14 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "OrderProcessor": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7193", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | name: OrderProcessor 4 | metadata: 5 | template: azd-init@1.10.1 6 | services: 7 | order-processor: 8 | project: ./ 9 | language: dotnet 10 | host: function 11 | hooks: 12 | postprovision: 13 | windows: 14 | shell: pwsh 15 | run: scripts/deploy.ps1 16 | interactive: true 17 | continueOnError: false 18 | posix: 19 | shell: sh 20 | run: scripts/deploy.sh 21 | interactive: true 22 | continueOnError: false -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true, 10 | "logLevel": { 11 | "Host.Triggers.DurableTask": "Information" 12 | } 13 | }, 14 | "logLevel": { 15 | "Function": "Information" 16 | } 17 | }, 18 | "extensions": { 19 | "durableTask": { 20 | "storageProvider": { 21 | "type": "azureManaged", 22 | "connectionStringName": "DTS_CONNECTION_STRING" 23 | }, 24 | "hubName": "%TASKHUB_NAME%" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/app/dts-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param dtsName string 4 | param principalType string 5 | 6 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' existing = { 7 | name: dtsName 8 | } 9 | 10 | resource dtsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(dts.id, principalID, roleDefinitionID ) 12 | scope: dts 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID ) 15 | principalId: principalID 16 | principalType: principalType 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/app/storage-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param storageAccountName string 4 | param principalType string = 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 5 | 6 | resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { 7 | name: storageAccountName 8 | } 9 | 10 | // Allow access from API to storage account using a managed identity and least priv Storage roles 11 | resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 12 | name: guid(storageAccount.id, principalID, roleDefinitionID) 13 | scope: storageAccount 14 | properties: { 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 16 | principalId: principalID 17 | principalType: principalType 18 | } 19 | } 20 | 21 | output ROLE_ASSIGNMENT_NAME string = storageRoleAssignment.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | properties: { 17 | reserved: reserved 18 | } 19 | } 20 | 21 | output id string = appServicePlan.id 22 | output name string = appServicePlan.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/identity/userAssignedIdentity.bicep: -------------------------------------------------------------------------------- 1 | param identityName string 2 | param location string 3 | param tags object = {} 4 | 5 | resource userAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-07-31-preview' = { 6 | name: identityName 7 | location: location 8 | tags: tags 9 | } 10 | 11 | output identityId string = userAssignedIdentity.id 12 | output identityName string = userAssignedIdentity.name 13 | output identityPrincipalId string = userAssignedIdentity.properties.principalId 14 | output identityClientId string = userAssignedIdentity.properties.clientId 15 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/monitor/appinsights-access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param appInsightsName string 4 | 5 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 6 | name: appInsightsName 7 | } 8 | 9 | // Allow access from API to app insights using a managed identity and least priv role 10 | resource appInsightsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(applicationInsights.id, principalID, roleDefinitionID) 12 | scope: applicationInsights 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 15 | principalId: principalID 16 | principalType: 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 17 | } 18 | } 19 | 20 | output ROLE_ASSIGNMENT_NAME string = appInsightsRoleAssignment.name 21 | 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceId string 6 | param disableLocalAuth bool = false 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | DisableLocalAuth: disableLocalAuth 17 | } 18 | } 19 | 20 | output connectionString string = applicationInsights.properties.ConnectionString 21 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 22 | output name string = applicationInsights.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 6 | name: name 7 | location: location 8 | tags: tags 9 | properties: any({ 10 | retentionInDays: 30 11 | features: { 12 | searchVersion: 1 13 | } 14 | sku: { 15 | name: 'PerGB2018' 16 | } 17 | }) 18 | } 19 | 20 | output id string = logAnalytics.id 21 | output name string = logAnalytics.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | param disableLocalAuth bool = false 6 | 7 | module logAnalytics 'loganalytics.bicep' = { 8 | name: 'loganalytics' 9 | params: { 10 | name: logAnalyticsName 11 | location: location 12 | tags: tags 13 | } 14 | } 15 | 16 | module applicationInsights 'applicationinsights.bicep' = { 17 | name: 'applicationinsights' 18 | params: { 19 | name: applicationInsightsName 20 | location: location 21 | tags: tags 22 | logAnalyticsWorkspaceId: logAnalytics.outputs.id 23 | disableLocalAuth: disableLocalAuth 24 | } 25 | } 26 | 27 | output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString 28 | output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey 29 | output applicationInsightsName string = applicationInsights.outputs.name 30 | output logAnalyticsWorkspaceId string = logAnalytics.outputs.id 31 | output logAnalyticsWorkspaceName string = logAnalytics.outputs.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/modules/fetch-container-image.bicep: -------------------------------------------------------------------------------- 1 | param exists bool 2 | param name string 3 | 4 | resource existingApp 'Microsoft.App/containerApps@2023-05-02-preview' existing = if (exists) { 5 | name: name 6 | } 7 | 8 | output containers array = exists ? existingApp.properties.template.containers : [] 9 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/shared/apps-env.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceName string 6 | param applicationInsightsName string = '' 7 | 8 | resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | properties: { 13 | appLogsConfiguration: { 14 | destination: 'log-analytics' 15 | logAnalyticsConfiguration: { 16 | customerId: logAnalyticsWorkspace.properties.customerId 17 | sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey 18 | } 19 | } 20 | daprAIConnectionString: applicationInsights.properties.ConnectionString 21 | } 22 | } 23 | 24 | resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { 25 | name: logAnalyticsWorkspaceName 26 | } 27 | 28 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 29 | name: applicationInsightsName 30 | } 31 | 32 | output name string = containerAppsEnvironment.name 33 | output domain string = containerAppsEnvironment.properties.defaultDomain 34 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/shared/keyvault.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Service principal that should be granted read access to the KeyVault. If unset, no service principal is granted access by default') 6 | param principalId string = '' 7 | 8 | var defaultAccessPolicies = !empty(principalId) ? [ 9 | { 10 | objectId: principalId 11 | permissions: { secrets: [ 'get', 'list' ] } 12 | tenantId: subscription().tenantId 13 | } 14 | ] : [] 15 | 16 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { 17 | name: name 18 | location: location 19 | tags: tags 20 | properties: { 21 | tenantId: subscription().tenantId 22 | sku: { family: 'A', name: 'standard' } 23 | enabledForTemplateDeployment: true 24 | accessPolicies: union(defaultAccessPolicies, [ 25 | // define access policies here 26 | ]) 27 | } 28 | } 29 | 30 | output endpoint string = keyVault.properties.vaultUri 31 | output name string = keyVault.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/OrderProcessor/infra/shared/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: logAnalyticsName 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 22 | name: applicationInsightsName 23 | location: location 24 | tags: tags 25 | kind: 'web' 26 | properties: { 27 | Application_Type: 'web' 28 | WorkspaceResourceId: logAnalytics.id 29 | } 30 | } 31 | 32 | output applicationInsightsName string = applicationInsights.name 33 | output logAnalyticsWorkspaceId string = logAnalytics.id 34 | output logAnalyticsWorkspaceName string = logAnalytics.name 35 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "ms-dotnettools.csharp" 5 | ] 6 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to .NET Functions", 6 | "type": "coreclr", 7 | "request": "attach", 8 | "processId": "${command:azureFunctions.pickProcess}" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.deploySubpath": "bin/Release/net8.0/publish", 3 | "azureFunctions.projectLanguage": "C#", 4 | "azureFunctions.projectRuntime": "~4", 5 | "debug.internalConsoleOptions": "neverOpen", 6 | "azureFunctions.preDeployTask": "publish (functions)" 7 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | var host = new HostBuilder() 6 | .ConfigureFunctionsWebApplication() 7 | .ConfigureServices(services => { 8 | services.AddApplicationInsightsTelemetryWorkerService(); 9 | services.ConfigureFunctionsApplicationInsights(); 10 | }) 11 | .Build(); 12 | 13 | host.Run(); -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "pdf_summarizer_dotnet": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7040", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | name: PDF-Summarizer-Dotnet 4 | metadata: 5 | template: azd-init@1.10.1 6 | services: 7 | pdf-summarizer-dotnet: 8 | project: ./ 9 | language: dotnet 10 | host: function 11 | hooks: 12 | postprovision: 13 | windows: 14 | shell: pwsh 15 | run: scripts/deploy.ps1 16 | interactive: true 17 | continueOnError: false 18 | posix: 19 | shell: sh 20 | run: scripts/deploy.sh 21 | interactive: true 22 | continueOnError: false -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | }, 9 | "enableLiveMetricsFilters": true, 10 | "logLevel": { 11 | "Host.Triggers.DurableTask": "Information" 12 | } 13 | } 14 | }, 15 | "extensions": { 16 | "durableTask": { 17 | "storageProvider": { 18 | "type": "azureManaged", 19 | "connectionStringName": "DTS_CONNECTION_STRING" 20 | }, 21 | "hubName": "%TASKHUB_NAME%" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/app/documentintelligence-Access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/app/dts-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param dtsName string 4 | param principalType string 5 | 6 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' existing = { 7 | name: dtsName 8 | } 9 | 10 | resource dtsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(dts.id, principalID, roleDefinitionID ) 12 | scope: dts 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID ) 15 | principalId: principalID 16 | principalType: principalType 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/app/openai-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalId string 2 | param roleDefinitionIds array 3 | param openAiAccountResourceName string 4 | 5 | resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' existing = { 6 | name: openAiAccountResourceName 7 | } 8 | 9 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleDefinitionId in roleDefinitionIds: { 10 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 11 | scope: account 12 | properties: { 13 | principalId: principalId 14 | principalType: 'ServicePrincipal' 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 16 | } 17 | }] 18 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/app/storage-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param storageAccountName string 4 | param principalType string = 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 5 | 6 | resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { 7 | name: storageAccountName 8 | } 9 | 10 | // Allow access from API to storage account using a managed identity and least priv Storage roles 11 | resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 12 | name: guid(storageAccount.id, principalID, roleDefinitionID) 13 | scope: storageAccount 14 | properties: { 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 16 | principalId: principalID 17 | principalType: principalType 18 | } 19 | } 20 | 21 | output ROLE_ASSIGNMENT_NAME string = storageRoleAssignment.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | properties: { 17 | reserved: reserved 18 | } 19 | } 20 | 21 | output id string = appServicePlan.id 22 | output name string = appServicePlan.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/identity/userAssignedIdentity.bicep: -------------------------------------------------------------------------------- 1 | param identityName string 2 | param location string 3 | param tags object = {} 4 | 5 | resource userAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-07-31-preview' = { 6 | name: identityName 7 | location: location 8 | tags: tags 9 | } 10 | 11 | output identityId string = userAssignedIdentity.id 12 | output identityName string = userAssignedIdentity.name 13 | output identityPrincipalId string = userAssignedIdentity.properties.principalId 14 | output identityClientId string = userAssignedIdentity.properties.clientId 15 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/monitor/appinsights-access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param appInsightsName string 4 | 5 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 6 | name: appInsightsName 7 | } 8 | 9 | // Allow access from API to app insights using a managed identity and least priv role 10 | resource appInsightsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(applicationInsights.id, principalID, roleDefinitionID) 12 | scope: applicationInsights 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 15 | principalId: principalID 16 | principalType: 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 17 | } 18 | } 19 | 20 | output ROLE_ASSIGNMENT_NAME string = appInsightsRoleAssignment.name 21 | 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceId string 6 | param disableLocalAuth bool = false 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | DisableLocalAuth: disableLocalAuth 17 | } 18 | } 19 | 20 | output connectionString string = applicationInsights.properties.ConnectionString 21 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 22 | output name string = applicationInsights.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 6 | name: name 7 | location: location 8 | tags: tags 9 | properties: any({ 10 | retentionInDays: 30 11 | features: { 12 | searchVersion: 1 13 | } 14 | sku: { 15 | name: 'PerGB2018' 16 | } 17 | }) 18 | } 19 | 20 | output id string = logAnalytics.id 21 | output name string = logAnalytics.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | param disableLocalAuth bool = false 6 | 7 | module logAnalytics 'loganalytics.bicep' = { 8 | name: 'loganalytics' 9 | params: { 10 | name: logAnalyticsName 11 | location: location 12 | tags: tags 13 | } 14 | } 15 | 16 | module applicationInsights 'applicationinsights.bicep' = { 17 | name: 'applicationinsights' 18 | params: { 19 | name: applicationInsightsName 20 | location: location 21 | tags: tags 22 | logAnalyticsWorkspaceId: logAnalytics.outputs.id 23 | disableLocalAuth: disableLocalAuth 24 | } 25 | } 26 | 27 | output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString 28 | output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey 29 | output applicationInsightsName string = applicationInsights.outputs.name 30 | output logAnalyticsWorkspaceId string = logAnalytics.outputs.id 31 | output logAnalyticsWorkspaceName string = logAnalytics.outputs.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/modules/fetch-container-image.bicep: -------------------------------------------------------------------------------- 1 | param exists bool 2 | param name string 3 | 4 | resource existingApp 'Microsoft.App/containerApps@2023-05-02-preview' existing = if (exists) { 5 | name: name 6 | } 7 | 8 | output containers array = exists ? existingApp.properties.template.containers : [] 9 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/shared/apps-env.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceName string 6 | param applicationInsightsName string = '' 7 | 8 | resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | properties: { 13 | appLogsConfiguration: { 14 | destination: 'log-analytics' 15 | logAnalyticsConfiguration: { 16 | customerId: logAnalyticsWorkspace.properties.customerId 17 | sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey 18 | } 19 | } 20 | daprAIConnectionString: applicationInsights.properties.ConnectionString 21 | } 22 | } 23 | 24 | resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { 25 | name: logAnalyticsWorkspaceName 26 | } 27 | 28 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 29 | name: applicationInsightsName 30 | } 31 | 32 | output name string = containerAppsEnvironment.name 33 | output domain string = containerAppsEnvironment.properties.defaultDomain 34 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/shared/keyvault.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Service principal that should be granted read access to the KeyVault. If unset, no service principal is granted access by default') 6 | param principalId string = '' 7 | 8 | var defaultAccessPolicies = !empty(principalId) ? [ 9 | { 10 | objectId: principalId 11 | permissions: { secrets: [ 'get', 'list' ] } 12 | tenantId: subscription().tenantId 13 | } 14 | ] : [] 15 | 16 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { 17 | name: name 18 | location: location 19 | tags: tags 20 | properties: { 21 | tenantId: subscription().tenantId 22 | sku: { family: 'A', name: 'standard' } 23 | enabledForTemplateDeployment: true 24 | accessPolicies: union(defaultAccessPolicies, [ 25 | // define access policies here 26 | ]) 27 | } 28 | } 29 | 30 | output endpoint string = keyVault.properties.vaultUri 31 | output name string = keyVault.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/PdfSummarizer/infra/shared/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: logAnalyticsName 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 22 | name: applicationInsightsName 23 | location: location 24 | tags: tags 25 | kind: 'web' 26 | properties: { 27 | Application_Type: 'web' 28 | WorkspaceResourceId: logAnalytics.id 29 | } 30 | } 31 | 32 | output applicationInsightsName string = applicationInsights.name 33 | output logAnalyticsWorkspaceId string = logAnalytics.id 34 | output logAnalyticsWorkspaceName string = logAnalytics.name 35 | -------------------------------------------------------------------------------- /samples/durable-functions/dotnet/README.md: -------------------------------------------------------------------------------- 1 | ### Azure Durable Functions 2 | [Durable Functions](https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-overview) is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment. It allows developers to define stateful operations (durable executions) by writing orchestrations and stateful entities using the Azure Functions programming model. 3 | 4 | Durable Functions works with all Azure Functions programming languages, including .NET, JavaScript, Python, PowerShell, and Java. It supports multiple application patterns such as function chaining, fan-out/fan-in, async HTTP APIs, human interaction, and more. 5 | 6 | Durable Functions leverages a backend component, which refers to the storage provider that is used to schedule orchestrations and tasks, as well as persist the state of orchestrations and entities. The samples in this repository for Durable Functions illustrate how to effectively utilize the durable task scheduler within Azure Functions for durable function applications. 7 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | name: functions-app 4 | metadata: 5 | template: azd-init@1.10.1 6 | services: 7 | function-app: 8 | project: ./ 9 | language: python 10 | host: function 11 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request,Error" 8 | } 9 | } 10 | }, 11 | "extensions": { 12 | "durableTask": { 13 | "storageProvider": { 14 | "type": "azureManaged", 15 | "connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" 16 | }, 17 | "hubName": "TASKHUB_NAME" 18 | } 19 | }, 20 | "extensionBundle": { 21 | "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", 22 | "version": "[4.29.0, 5.0.0)" 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/app/documentintelligence-Access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/app/dts-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param dtsName string 4 | param principalType string 5 | 6 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' existing = { 7 | name: dtsName 8 | } 9 | 10 | resource dtsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(dts.id, principalID, roleDefinitionID ) 12 | scope: dts 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID ) 15 | principalId: principalID 16 | principalType: principalType 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/app/openai-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalId string 2 | param roleDefinitionIds array 3 | param openAiAccountResourceName string 4 | 5 | resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' existing = { 6 | name: openAiAccountResourceName 7 | } 8 | 9 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleDefinitionId in roleDefinitionIds: { 10 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 11 | scope: account 12 | properties: { 13 | principalId: principalId 14 | principalType: 'ServicePrincipal' 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 16 | } 17 | }] 18 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/app/storage-Access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param storageAccountName string 4 | param principalType string = 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 5 | 6 | resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { 7 | name: storageAccountName 8 | } 9 | 10 | // Allow access from API to storage account using a managed identity and least priv Storage roles 11 | resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 12 | name: guid(storageAccount.id, principalID, roleDefinitionID) 13 | scope: storageAccount 14 | properties: { 15 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 16 | principalId: principalID 17 | principalType: principalType 18 | } 19 | } 20 | 21 | output ROLE_ASSIGNMENT_NAME string = storageRoleAssignment.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | properties: { 17 | reserved: reserved 18 | } 19 | } 20 | 21 | output id string = appServicePlan.id 22 | output name string = appServicePlan.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/identity/userAssignedIdentity.bicep: -------------------------------------------------------------------------------- 1 | param identityName string 2 | param location string 3 | param tags object = {} 4 | 5 | resource userAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-07-31-preview' = { 6 | name: identityName 7 | location: location 8 | tags: tags 9 | } 10 | 11 | output identityId string = userAssignedIdentity.id 12 | output identityName string = userAssignedIdentity.name 13 | output identityPrincipalId string = userAssignedIdentity.properties.principalId 14 | output identityClientId string = userAssignedIdentity.properties.clientId 15 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/monitor/appinsights-access.bicep: -------------------------------------------------------------------------------- 1 | param principalID string 2 | param roleDefinitionID string 3 | param appInsightsName string 4 | 5 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 6 | name: appInsightsName 7 | } 8 | 9 | // Allow access from API to app insights using a managed identity and least priv role 10 | resource appInsightsRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 11 | name: guid(applicationInsights.id, principalID, roleDefinitionID) 12 | scope: applicationInsights 13 | properties: { 14 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionID) 15 | principalId: principalID 16 | principalType: 'ServicePrincipal' // Workaround for https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal 17 | } 18 | } 19 | 20 | output ROLE_ASSIGNMENT_NAME string = appInsightsRoleAssignment.name 21 | 22 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceId string 6 | param disableLocalAuth bool = false 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | DisableLocalAuth: disableLocalAuth 17 | } 18 | } 19 | 20 | output connectionString string = applicationInsights.properties.ConnectionString 21 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 22 | output name string = applicationInsights.name 23 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 6 | name: name 7 | location: location 8 | tags: tags 9 | properties: any({ 10 | retentionInDays: 30 11 | features: { 12 | searchVersion: 1 13 | } 14 | sku: { 15 | name: 'PerGB2018' 16 | } 17 | }) 18 | } 19 | 20 | output id string = logAnalytics.id 21 | output name string = logAnalytics.name 22 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | param disableLocalAuth bool = false 6 | 7 | module logAnalytics 'loganalytics.bicep' = { 8 | name: 'loganalytics' 9 | params: { 10 | name: logAnalyticsName 11 | location: location 12 | tags: tags 13 | } 14 | } 15 | 16 | module applicationInsights 'applicationinsights.bicep' = { 17 | name: 'applicationinsights' 18 | params: { 19 | name: applicationInsightsName 20 | location: location 21 | tags: tags 22 | logAnalyticsWorkspaceId: logAnalytics.outputs.id 23 | disableLocalAuth: disableLocalAuth 24 | } 25 | } 26 | 27 | output applicationInsightsConnectionString string = applicationInsights.outputs.connectionString 28 | output applicationInsightsInstrumentationKey string = applicationInsights.outputs.instrumentationKey 29 | output applicationInsightsName string = applicationInsights.outputs.name 30 | output logAnalyticsWorkspaceId string = logAnalytics.outputs.id 31 | output logAnalyticsWorkspaceName string = logAnalytics.outputs.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/modules/fetch-container-image.bicep: -------------------------------------------------------------------------------- 1 | param exists bool 2 | param name string 3 | 4 | resource existingApp 'Microsoft.App/containerApps@2023-05-02-preview' existing = if (exists) { 5 | name: name 6 | } 7 | 8 | output containers array = exists ? existingApp.properties.template.containers : [] 9 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/shared/apps-env.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | param logAnalyticsWorkspaceName string 6 | param applicationInsightsName string = '' 7 | 8 | resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | properties: { 13 | appLogsConfiguration: { 14 | destination: 'log-analytics' 15 | logAnalyticsConfiguration: { 16 | customerId: logAnalyticsWorkspace.properties.customerId 17 | sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey 18 | } 19 | } 20 | daprAIConnectionString: applicationInsights.properties.ConnectionString 21 | } 22 | } 23 | 24 | resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { 25 | name: logAnalyticsWorkspaceName 26 | } 27 | 28 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = { 29 | name: applicationInsightsName 30 | } 31 | 32 | output name string = containerAppsEnvironment.name 33 | output domain string = containerAppsEnvironment.properties.defaultDomain 34 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/shared/keyvault.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param tags object = {} 4 | 5 | @description('Service principal that should be granted read access to the KeyVault. If unset, no service principal is granted access by default') 6 | param principalId string = '' 7 | 8 | var defaultAccessPolicies = !empty(principalId) ? [ 9 | { 10 | objectId: principalId 11 | permissions: { secrets: [ 'get', 'list' ] } 12 | tenantId: subscription().tenantId 13 | } 14 | ] : [] 15 | 16 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { 17 | name: name 18 | location: location 19 | tags: tags 20 | properties: { 21 | tenantId: subscription().tenantId 22 | sku: { family: 'A', name: 'standard' } 23 | enabledForTemplateDeployment: true 24 | accessPolicies: union(defaultAccessPolicies, [ 25 | // define access policies here 26 | ]) 27 | } 28 | } 29 | 30 | output endpoint string = keyVault.properties.vaultUri 31 | output name string = keyVault.name 32 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/infra/shared/monitoring.bicep: -------------------------------------------------------------------------------- 1 | param logAnalyticsName string 2 | param applicationInsightsName string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: logAnalyticsName 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 22 | name: applicationInsightsName 23 | location: location 24 | tags: tags 25 | kind: 'web' 26 | properties: { 27 | Application_Type: 'web' 28 | WorkspaceResourceId: logAnalytics.id 29 | } 30 | } 31 | 32 | output applicationInsightsName string = applicationInsights.name 33 | output logAnalyticsWorkspaceId string = logAnalytics.id 34 | output logAnalyticsWorkspaceName string = logAnalytics.name 35 | -------------------------------------------------------------------------------- /samples/durable-functions/python/pdf-summarizer/requirements.txt: -------------------------------------------------------------------------------- 1 | # DO NOT include azure-functions-worker in this file 2 | # The Python Worker is managed by Azure Functions platform 3 | # Manually managing azure-functions-worker may cause unexpected issues 4 | 5 | cryptography 6 | azure-functions 7 | azure-functions-durable 8 | azure-ai-documentintelligence 9 | azure-storage-blob 10 | azure-identity 11 | azure-ai-formrecognizer 12 | requests 13 | pandas 14 | numpy 15 | PyPDF2 -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/AspNetWebApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | $(BaseIntermediateOutputPath)Generated 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/DockerFile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base 4 | WORKDIR /app 5 | EXPOSE 8080 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 8 | WORKDIR /src 9 | COPY ["AspNetWebApp.csproj", "."] 10 | RUN dotnet restore "./AspNetWebApp.csproj" 11 | COPY . . 12 | WORKDIR "/src/." 13 | RUN dotnet build "AspNetWebApp.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "AspNetWebApp.csproj" -c Release -o /app/publish /p:UseAppHost=false 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENV ASPNETCORE_ENVIRONMENT=Production 22 | ENTRYPOINT ["dotnet", "AspNetWebApp.dll"] 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/Orchestrations/HelloCities.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.DurableTask; 2 | using Microsoft.DurableTask.Client; 3 | 4 | namespace AspNetWebApp.Scenarios; 5 | 6 | [DurableTask] 7 | class HelloCities : TaskOrchestrator> 8 | { 9 | public override async Task> RunAsync(TaskOrchestrationContext context, string input) 10 | { 11 | List results = 12 | [ 13 | await context.CallSayHelloAsync("Seattle"), 14 | await context.CallSayHelloAsync("Amsterdam"), 15 | await context.CallSayHelloAsync("Hyderabad"), 16 | await context.CallSayHelloAsync("Shanghai"), 17 | await context.CallSayHelloAsync("Tokyo"), 18 | ]; 19 | return results; 20 | } 21 | } 22 | 23 | [DurableTask] 24 | class SayHello : TaskActivity 25 | { 26 | public override Task RunAsync(TaskActivityContext context, string cityName) 27 | { 28 | return Task.FromResult($"Hello, {cityName}!"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:36209", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "applicationUrl": "http://localhost:5008", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/Utils.cs: -------------------------------------------------------------------------------- 1 | namespace AspNetWebApp; 2 | 3 | static class Utils 4 | { 5 | public static async Task ParallelForEachAsync(this IEnumerable items, int maxConcurrency, Func action) 6 | { 7 | List tasks; 8 | if (items is ICollection itemCollection) 9 | { 10 | tasks = new List(itemCollection.Count); 11 | } 12 | else 13 | { 14 | tasks = []; 15 | } 16 | 17 | using SemaphoreSlim semaphore = new(maxConcurrency); 18 | foreach (T item in items) 19 | { 20 | tasks.Add(InvokeThrottledAction(item, action, semaphore)); 21 | } 22 | 23 | await Task.WhenAll(tasks); 24 | } 25 | 26 | static async Task InvokeThrottledAction(T item, Func action, SemaphoreSlim semaphore) 27 | { 28 | await semaphore.WaitAsync(); 29 | try 30 | { 31 | await action(item); 32 | } 33 | finally 34 | { 35 | semaphore.Release(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "DURABLE_TASK_SCHEDULER_ENDPOINT_ADDRESS": "https://{your-durable-task-endpoint}.durabletask.io", 9 | "DURABLE_TASK_SCHEDULER_TASK_HUB_NAME": "{your-task-hub-name}", 10 | "CONTAINER_APP_UMI_CLIENT_ID": "{your-user-managed-identity-client-id}" 11 | } 12 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/AspNetWebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/AccountTransferBackend.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/Entities/Account.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.DurableTask.Entities; 2 | 3 | namespace AccountTransferBackend.Entities; 4 | 5 | class Account : TaskEntity 6 | { 7 | public void Deposit(int amount) => this.State += amount; 8 | 9 | public void Withdraw(int amount) => this.State -= amount; 10 | 11 | public int GetBalance() => this.State; 12 | } 13 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/Models/TransactionRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccountTransferBackend.Models; 2 | 3 | /// 4 | /// Request to deposit funds into or withdraw funds from an account. 5 | /// 6 | /// The amount of funds to deposit. 7 | public record TransactionRequest(double Amount); -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/Models/TransferFundsRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AccountTransferBackend.Models; 2 | 3 | /// 4 | /// Request to transfer funds between two accounts. 5 | /// 6 | /// The source account to transfer funds FROM. 7 | /// The destination account to transfer funds TO. 8 | /// The amount of funds to transfer. 9 | public record TransferFundsRequest(string SourceId, string DestinationId, double Amount); 10 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": false, 8 | "applicationUrl": "http://localhost:5203", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development", 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": false, 17 | "applicationUrl": "https://localhost:7225;http://localhost:5203", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development", 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/EntitiesSample/demo.http: -------------------------------------------------------------------------------- 1 | # For more info on HTTP files go to https://aka.ms/vs/httpfile 2 | 3 | ### Deposit funds into account 123 4 | POST http://localhost:5203/accounts/123/deposit 5 | Content-Type: application/json 6 | 7 | { "amount": 100 } 8 | 9 | 10 | ### Deposit funds into account 456 11 | POST http://localhost:5203/accounts/456/deposit 12 | Content-Type: application/json 13 | 14 | { "amount": 200 } 15 | 16 | 17 | ### Check the balance for account 123 18 | GET http://localhost:5203/accounts/123/balance 19 | 20 | 21 | ### Check the balance for account 456 22 | GET http://localhost:5203/accounts/456/balance 23 | 24 | 25 | 26 | ### Transfer funds from account 123 to account 456 27 | POST http://localhost:5203/accounts/transfers 28 | Content-Type: application/json 29 | 30 | { "sourceId": "123", "destinationId": "456", "amount": 50 } 31 | 32 | 33 | ### Check the transfer status 34 | GET http://localhost:5203/accounts/transfers/{transferId} 35 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FanOutFanIn/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FanOutFanIn/Worker/Worker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | b2f26a38-2066-4051-916a-b21af6b0f10e 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/Client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 2 | WORKDIR /src 3 | 4 | # Copy csproj and restore dependencies 5 | COPY ["Client.csproj", "./"] 6 | RUN dotnet restore 7 | 8 | # Copy all files and build 9 | COPY . . 10 | RUN dotnet publish -c Release -o /app/publish 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS final 14 | WORKDIR /app 15 | COPY --from=build /app/publish . 16 | 17 | # Expose port 80 explicitly 18 | EXPOSE 8080 19 | 20 | # Set the entrypoint 21 | ENTRYPOINT ["dotnet", "Client.dll"] 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/Worker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 2 | WORKDIR /src 3 | 4 | # Copy csproj and restore dependencies 5 | COPY ["Worker.csproj", "./"] 6 | RUN dotnet restore 7 | 8 | # Copy all files and build 9 | COPY . . 10 | RUN dotnet publish -c Release -o /app/publish 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS final 14 | WORKDIR /app 15 | COPY --from=build /app/publish . 16 | 17 | EXPOSE 8080 18 | # Set the entrypoint 19 | ENTRYPOINT ["dotnet", "Worker.dll"] 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/Worker/Worker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 15db87b3-cffd-47da-a40c-a8a1f09ab2b7 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | # This is an example starter azure.yaml file containing several example services in comments below. 4 | # Make changes as needed to describe your application setup. 5 | # To learn more about the azure.yaml file, visit https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema 6 | 7 | # Name of the application. 8 | metadata: 9 | template: hello-azd-dotnet 10 | name: dts-quiockstart 11 | services: 12 | client: 13 | project: ./Client 14 | language: csharp 15 | host: containerapp 16 | apiVersion: 2025-01-01 17 | docker: 18 | path: ./Dockerfile 19 | worker: 20 | project: ./Worker 21 | language: csharp 22 | host: containerapp 23 | apiVersion: 2025-01-01 24 | docker: 25 | path: ./Dockerfile 26 | 27 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/app/user-assigned-identity.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Microsoft Entra user-assigned identity.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | } 12 | 13 | output name string = identity.name 14 | output resourceId string = identity.id 15 | output principalId string = identity.properties.principalId 16 | output clientId string = identity.properties.clientId 17 | output tenantId string = identity.properties.tenantId 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for MongoDB account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 8 | 9 | module cosmos '../../cosmos/cosmos-account.bicep' = { 10 | name: 'cosmos-account' 11 | params: { 12 | name: name 13 | location: location 14 | connectionStringKey: connectionStringKey 15 | keyVaultName: keyVaultName 16 | kind: 'MongoDB' 17 | tags: tags 18 | } 19 | } 20 | 21 | output connectionStringKey string = cosmos.outputs.connectionStringKey 22 | output endpoint string = cosmos.outputs.endpoint 23 | output id string = cosmos.outputs.id 24 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for NoSQL account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | 8 | module cosmos '../../cosmos/cosmos-account.bicep' = { 9 | name: 'cosmos-account' 10 | params: { 11 | name: name 12 | location: location 13 | tags: tags 14 | keyVaultName: keyVaultName 15 | kind: 'GlobalDocumentDB' 16 | } 17 | } 18 | 19 | output connectionStringKey string = cosmos.outputs.connectionStringKey 20 | output endpoint string = cosmos.outputs.endpoint 21 | output id string = cosmos.outputs.id 22 | output name string = cosmos.outputs.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | param roleDefinitionId string 5 | param principalId string = '' 6 | 7 | resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 8 | parent: cosmos 9 | name: guid(roleDefinitionId, principalId, cosmos.id) 10 | properties: { 11 | principalId: principalId 12 | roleDefinitionId: roleDefinitionId 13 | scope: cosmos.id 14 | } 15 | } 16 | 17 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 18 | name: accountName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { 5 | parent: cosmos 6 | name: guid(cosmos.id, accountName, 'sql-role') 7 | properties: { 8 | assignableScopes: [ 9 | cosmos.id 10 | ] 11 | permissions: [ 12 | { 13 | dataActions: [ 14 | 'Microsoft.DocumentDB/databaseAccounts/readMetadata' 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' 16 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' 17 | ] 18 | notDataActions: [] 19 | } 20 | ] 21 | roleName: 'Reader Writer' 22 | type: 'CustomRole' 23 | } 24 | } 25 | 26 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 27 | name: accountName 28 | } 29 | 30 | output id string = roleDefinition.id 31 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Adds an agent pool to an Azure Kubernetes Service (AKS) cluster.' 2 | param clusterName string 3 | 4 | @description('The agent pool name') 5 | param name string 6 | 7 | @description('The agent pool configuration') 8 | param config object 9 | 10 | resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-10-02-preview' existing = { 11 | name: clusterName 12 | } 13 | 14 | resource nodePool 'Microsoft.ContainerService/managedClusters/agentPools@2023-10-02-preview' = { 15 | parent: aksCluster 16 | name: name 17 | properties: config 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | } 17 | 18 | output id string = appServicePlan.id 19 | output name string = appServicePlan.name 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/host/container-apps/managed.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Container Apps managed environment.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource environment 'Microsoft.App/managedEnvironments@2023-05-01' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: {} 12 | } 13 | 14 | output name string = environment.name 15 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Static Web Apps instance.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param sku object = { 7 | name: 'Free' 8 | tier: 'Free' 9 | } 10 | 11 | resource web 'Microsoft.Web/staticSites@2022-03-01' = { 12 | name: name 13 | location: location 14 | tags: tags 15 | sku: sku 16 | properties: { 17 | provider: 'Custom' 18 | } 19 | } 20 | 21 | output name string = web.name 22 | output uri string = 'https://${web.properties.defaultHostname}' 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Log Analytics workspace.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | output id string = logAnalytics.id 22 | output name string = logAnalytics.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure CDN profile.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | @description('The pricing tier of this CDN profile') 7 | @allowed([ 8 | 'Custom_Verizon' 9 | 'Premium_AzureFrontDoor' 10 | 'Premium_Verizon' 11 | 'StandardPlus_955BandWidth_ChinaCdn' 12 | 'StandardPlus_AvgBandWidth_ChinaCdn' 13 | 'StandardPlus_ChinaCdn' 14 | 'Standard_955BandWidth_ChinaCdn' 15 | 'Standard_Akamai' 16 | 'Standard_AvgBandWidth_ChinaCdn' 17 | 'Standard_AzureFrontDoor' 18 | 'Standard_ChinaCdn' 19 | 'Standard_Microsoft' 20 | 'Standard_Verizon' 21 | ]) 22 | param sku string = 'Standard_Microsoft' 23 | 24 | resource profile 'Microsoft.Cdn/profiles@2022-05-01-preview' = { 25 | name: name 26 | location: location 27 | tags: tags 28 | sku: { 29 | name: sku 30 | } 31 | } 32 | 33 | output id string = profile.id 34 | output name string = profile.name 35 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/security/configstore-access.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of Azure App Configuration store') 2 | param configStoreName string 3 | 4 | @description('The principal ID of the service principal to assign the role to') 5 | param principalId string 6 | 7 | resource configStore 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = { 8 | name: configStoreName 9 | } 10 | 11 | var configStoreDataReaderRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071') 12 | 13 | resource configStoreDataReaderRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 14 | name: guid(subscription().id, resourceGroup().id, principalId, configStoreDataReaderRole) 15 | scope: configStore 16 | properties: { 17 | roleDefinitionId: configStoreDataReaderRole 18 | principalId: principalId 19 | principalType: 'ServicePrincipal' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns an Azure Key Vault access policy.' 2 | param name string = 'add' 3 | 4 | param keyVaultName string 5 | param permissions object = { secrets: [ 'get', 'list' ] } 6 | param principalId string 7 | 8 | resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { 9 | parent: keyVault 10 | name: name 11 | properties: { 12 | accessPolicies: [ { 13 | objectId: principalId 14 | tenantId: subscription().tenantId 15 | permissions: permissions 16 | } ] 17 | } 18 | } 19 | 20 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 21 | name: keyVaultName 22 | } 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates or updates a secret in an Azure Key Vault.' 2 | param name string 3 | param tags object = {} 4 | param keyVaultName string 5 | param contentType string = 'string' 6 | @description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') 7 | @secure() 8 | param secretValue string 9 | 10 | param enabled bool = true 11 | param exp int = 0 12 | param nbf int = 0 13 | 14 | resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 15 | name: name 16 | tags: tags 17 | parent: keyVault 18 | properties: { 19 | attributes: { 20 | enabled: enabled 21 | exp: exp 22 | nbf: nbf 23 | } 24 | contentType: contentType 25 | value: secretValue 26 | } 27 | } 28 | 29 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 30 | name: keyVaultName 31 | } 32 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.' 2 | param containerRegistryName string 3 | param principalId string 4 | 5 | var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') 6 | 7 | resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 8 | scope: containerRegistry // Use when specifying a scope that is different than the deployment scope 9 | name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) 10 | properties: { 11 | roleDefinitionId: acrPullRole 12 | principalType: 'ServicePrincipal' 13 | principalId: principalId 14 | } 15 | } 16 | 17 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { 18 | name: containerRegistryName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/core/testing/loadtesting.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param managedIdentity bool = false 4 | param tags object = {} 5 | 6 | resource loadTest 'Microsoft.LoadTestService/loadTests@2022-12-01' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } 11 | properties: { 12 | } 13 | } 14 | 15 | output loadTestingName string = loadTest.name 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/FunctionChaining/infra/main.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "environmentName": { 6 | "value": "${AZURE_ENV_NAME}" 7 | }, 8 | "location": { 9 | "value": "${AZURE_LOCATION}" 10 | }, 11 | "principalId": { 12 | "value": "${AZURE_PRINCIPAL_ID}" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/HumanInteraction/Client/ApprovalResponseData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HumanInteraction.Client 4 | { 5 | /// 6 | /// Data structure for the approval response 7 | /// 8 | public class ApprovalResponseData 9 | { 10 | public bool IsApproved { get; set; } 11 | public string Approver { get; set; } = string.Empty; 12 | public string Comments { get; set; } = string.Empty; 13 | public string ResponseTime { get; set; } = string.Empty; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/HumanInteraction/Client/Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/HumanInteraction/Worker/ApprovalActivityInputs.cs: -------------------------------------------------------------------------------- 1 | // filepath: /Users/nickgreenfield1/workspace/Durable-Task-Scheduler/samples/durable-task-sdks/dotnet/HumanInteraction/Worker/ApprovalActivityInputs.cs 2 | namespace HumanInteraction; 3 | 4 | /// 5 | /// Data structure for the ProcessApprovalActivity input 6 | /// 7 | public class ProcessApprovalActivityInput 8 | { 9 | public string RequestId { get; set; } = string.Empty; 10 | public bool IsApproved { get; set; } 11 | public string Approver { get; set; } = string.Empty; 12 | public string Comments { get; set; } = string.Empty; 13 | } 14 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/HumanInteraction/Worker/Worker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/DockerFile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base 4 | WORKDIR /app 5 | EXPOSE 8080 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 8 | WORKDIR /src 9 | COPY ["AspNetWebApp.csproj", "."] 10 | RUN dotnet restore "./AspNetWebApp.csproj" 11 | COPY . . 12 | WORKDIR "/src/." 13 | RUN dotnet build "AspNetWebApp.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "AspNetWebApp.csproj" -c Release -o /app/publish /p:UseAppHost=false 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENV ASPNETCORE_ENVIRONMENT=Production 22 | ENTRYPOINT ["dotnet", "AspNetWebApp.dll"] 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/OrchestrationVersioning.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | $(BaseIntermediateOutputPath)Generated 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:36209", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "applicationUrl": "http://localhost:5008", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/Utils.cs: -------------------------------------------------------------------------------- 1 | namespace AspNetWebApp; 2 | 3 | static class Utils 4 | { 5 | public static async Task ParallelForEachAsync(this IEnumerable items, int maxConcurrency, Func action) 6 | { 7 | List tasks; 8 | if (items is ICollection itemCollection) 9 | { 10 | tasks = new List(itemCollection.Count); 11 | } 12 | else 13 | { 14 | tasks = []; 15 | } 16 | 17 | using SemaphoreSlim semaphore = new(maxConcurrency); 18 | foreach (T item in items) 19 | { 20 | tasks.Add(InvokeThrottledAction(item, action, semaphore)); 21 | } 22 | 23 | await Task.WhenAll(tasks); 24 | } 25 | 26 | static async Task InvokeThrottledAction(T item, Func action, SemaphoreSlim semaphore) 27 | { 28 | await semaphore.WaitAsync(); 29 | try 30 | { 31 | await action(item); 32 | } 33 | finally 34 | { 35 | semaphore.Release(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "DURABLE_TASK_SCHEDULER_ENDPOINT_ADDRESS": "https://{your-durable-task-endpoint}.durabletask.io", 9 | "DURABLE_TASK_SCHEDULER_TASK_HUB_NAME": "{your-task-hub-name}", 10 | "CONTAINER_APP_UMI_CLIENT_ID": "{your-user-managed-identity-client-id}" 11 | } 12 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/OrchestrationVersioning/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/ScheduleWebApp/Models/UpdateScheduleRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. 2 | // Licensed under the MIT License. 3 | 4 | namespace ScheduleWebApp.Models; 5 | 6 | /// 7 | /// Represents a request to update an existing schedule. 8 | /// 9 | public class UpdateScheduleRequest 10 | { 11 | /// 12 | /// Gets or sets the name of the orchestration to be scheduled. 13 | /// 14 | public string OrchestrationName { get; set; } = default!; 15 | 16 | /// 17 | /// Gets or sets the input data for the orchestration. 18 | /// 19 | public string? Input { get; set; } 20 | 21 | /// 22 | /// Gets or sets the time interval between schedule executions. 23 | /// 24 | public TimeSpan Interval { get; set; } 25 | 26 | /// 27 | /// Gets or sets the time when the schedule should start. 28 | /// 29 | public DateTimeOffset? StartAt { get; set; } 30 | 31 | /// 32 | /// Gets or sets the time when the schedule should end. 33 | /// 34 | public DateTimeOffset? EndAt { get; set; } 35 | } 36 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/ScheduleWebApp/ScheduleWebApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | true 8 | $(BaseIntermediateOutputPath)Generated 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/ScheduleWebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/ScheduleWebApp/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/dotnet/ScheduleWebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "" 10 | } 11 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/async-http-api/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/async-http-api/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/async-http-api/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/async-http-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8083 -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/async-http-api/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/eternal-orchestrations/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | } 5 | 6 | group 'io.durabletask' 7 | version = '0.1.0' 8 | def grpcVersion = '1.59.0' 9 | archivesBaseName = 'durabletask-samples' 10 | 11 | repositories { 12 | mavenLocal() 13 | mavenCentral() 14 | } 15 | 16 | task runEternalOrchestration(type: JavaExec) { 17 | classpath = sourceSets.main.runtimeClasspath 18 | mainClass = 'io.durabletask.samples.EternalOrchestration' 19 | systemProperty 'logback.configurationFile', 'src/main/resources/logback-spring.xml' 20 | } 21 | 22 | dependencies { 23 | implementation("com.microsoft:durabletask-client:1.5.1") 24 | implementation("com.microsoft:durabletask-azuremanaged:1.5.1-preview.1") 25 | 26 | // Logging dependencies 27 | implementation 'ch.qos.logback:logback-classic:1.2.6' 28 | implementation 'org.slf4j:slf4j-api:1.7.32' 29 | 30 | // https://github.com/grpc/grpc-java#download 31 | implementation "io.grpc:grpc-protobuf:${grpcVersion}" 32 | implementation "io.grpc:grpc-stub:${grpcVersion}" 33 | runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" 34 | implementation 'com.azure:azure-identity:1.15.0' 35 | } -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/eternal-orchestrations/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/eternal-orchestrations/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/eternal-orchestrations/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/eternal-orchestrations/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/fan-out-fan-in/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | } 5 | 6 | group 'io.durabletask' 7 | version = '0.1.0' 8 | def grpcVersion = '1.59.0' 9 | archivesBaseName = 'durabletask-samples' 10 | 11 | repositories { 12 | mavenLocal() 13 | mavenCentral() 14 | } 15 | 16 | task runFanOutFanInPattern(type: JavaExec) { 17 | classpath = sourceSets.main.runtimeClasspath 18 | mainClass = 'io.durabletask.samples.FanOutFanInPattern' 19 | systemProperty 'logback.configurationFile', 'src/main/resources/logback-spring.xml' 20 | } 21 | 22 | dependencies { 23 | implementation("com.microsoft:durabletask-client:1.5.1") 24 | implementation("com.microsoft:durabletask-azuremanaged:1.5.1-preview.1") 25 | 26 | // Logging dependencies 27 | implementation 'ch.qos.logback:logback-classic:1.2.6' 28 | implementation 'org.slf4j:slf4j-api:1.7.32' 29 | 30 | // https://github.com/grpc/grpc-java#download 31 | implementation "io.grpc:grpc-protobuf:${grpcVersion}" 32 | implementation "io.grpc:grpc-stub:${grpcVersion}" 33 | runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" 34 | implementation 'com.azure:azure-identity:1.15.0' 35 | } -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/fan-out-fan-in/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/fan-out-fan-in/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/fan-out-fan-in/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/fan-out-fan-in/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:17-jdk 2 | 3 | # Install dos2unix to fix line endings 4 | RUN apt-get update && apt-get install -y dos2unix && rm -rf /var/lib/apt/lists/* 5 | 6 | WORKDIR /app 7 | 8 | # Copy all files 9 | COPY . . 10 | 11 | # Fix line endings for gradlew 12 | RUN dos2unix gradlew && chmod +x gradlew 13 | 14 | # Run the gradle task 15 | CMD ["./gradlew", "runChainingPattern"] -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | # This is an example starter azure.yaml file containing several example services in comments below. 4 | # Make changes as needed to describe your application setup. 5 | # To learn more about the azure.yaml file, visit https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema 6 | 7 | # Name of the application. 8 | metadata: 9 | template: hello-azd-java 10 | name: dts-quickstart 11 | services: 12 | sampleapp: 13 | project: . 14 | language: java 15 | host: containerapp 16 | apiVersion: 2025-01-01 17 | docker: 18 | path: ./Dockerfile 19 | 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | } 5 | 6 | group 'io.durabletask' 7 | version = '0.1.0' 8 | def grpcVersion = '1.59.0' 9 | archivesBaseName = 'durabletask-samples' 10 | 11 | repositories { 12 | mavenLocal() 13 | mavenCentral() 14 | } 15 | 16 | task runChainingPattern(type: JavaExec) { 17 | classpath = sourceSets.main.runtimeClasspath 18 | mainClass = 'io.durabletask.samples.ChainingPattern' 19 | systemProperty 'logback.configurationFile', 'src/main/resources/logback-spring.xml' 20 | } 21 | 22 | dependencies { 23 | implementation("com.microsoft:durabletask-client:1.5.1") 24 | implementation("com.microsoft:durabletask-azuremanaged:1.5.1-preview.1") 25 | 26 | // Logging dependencies 27 | implementation 'ch.qos.logback:logback-classic:1.2.6' 28 | implementation 'org.slf4j:slf4j-api:1.7.32' 29 | 30 | // https://github.com/grpc/grpc-java#download 31 | implementation "io.grpc:grpc-protobuf:${grpcVersion}" 32 | implementation "io.grpc:grpc-stub:${grpcVersion}" 33 | runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" 34 | implementation 'com.azure:azure-identity:1.15.0' 35 | } -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/function-chaining/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/app/user-assigned-identity.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Microsoft Entra user-assigned identity.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | } 12 | 13 | output name string = identity.name 14 | output resourceId string = identity.id 15 | output principalId string = identity.properties.principalId 16 | output clientId string = identity.properties.clientId 17 | output tenantId string = identity.properties.tenantId 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for MongoDB account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 8 | 9 | module cosmos '../../cosmos/cosmos-account.bicep' = { 10 | name: 'cosmos-account' 11 | params: { 12 | name: name 13 | location: location 14 | connectionStringKey: connectionStringKey 15 | keyVaultName: keyVaultName 16 | kind: 'MongoDB' 17 | tags: tags 18 | } 19 | } 20 | 21 | output connectionStringKey string = cosmos.outputs.connectionStringKey 22 | output endpoint string = cosmos.outputs.endpoint 23 | output id string = cosmos.outputs.id 24 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for NoSQL account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | 8 | module cosmos '../../cosmos/cosmos-account.bicep' = { 9 | name: 'cosmos-account' 10 | params: { 11 | name: name 12 | location: location 13 | tags: tags 14 | keyVaultName: keyVaultName 15 | kind: 'GlobalDocumentDB' 16 | } 17 | } 18 | 19 | output connectionStringKey string = cosmos.outputs.connectionStringKey 20 | output endpoint string = cosmos.outputs.endpoint 21 | output id string = cosmos.outputs.id 22 | output name string = cosmos.outputs.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | param roleDefinitionId string 5 | param principalId string = '' 6 | 7 | resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 8 | parent: cosmos 9 | name: guid(roleDefinitionId, principalId, cosmos.id) 10 | properties: { 11 | principalId: principalId 12 | roleDefinitionId: roleDefinitionId 13 | scope: cosmos.id 14 | } 15 | } 16 | 17 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 18 | name: accountName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { 5 | parent: cosmos 6 | name: guid(cosmos.id, accountName, 'sql-role') 7 | properties: { 8 | assignableScopes: [ 9 | cosmos.id 10 | ] 11 | permissions: [ 12 | { 13 | dataActions: [ 14 | 'Microsoft.DocumentDB/databaseAccounts/readMetadata' 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' 16 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' 17 | ] 18 | notDataActions: [] 19 | } 20 | ] 21 | roleName: 'Reader Writer' 22 | type: 'CustomRole' 23 | } 24 | } 25 | 26 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 27 | name: accountName 28 | } 29 | 30 | output id string = roleDefinition.id 31 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Adds an agent pool to an Azure Kubernetes Service (AKS) cluster.' 2 | param clusterName string 3 | 4 | @description('The agent pool name') 5 | param name string 6 | 7 | @description('The agent pool configuration') 8 | param config object 9 | 10 | resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-10-02-preview' existing = { 11 | name: clusterName 12 | } 13 | 14 | resource nodePool 'Microsoft.ContainerService/managedClusters/agentPools@2023-10-02-preview' = { 15 | parent: aksCluster 16 | name: name 17 | properties: config 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | } 17 | 18 | output id string = appServicePlan.id 19 | output name string = appServicePlan.name 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/host/container-apps/managed.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Container Apps managed environment.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource environment 'Microsoft.App/managedEnvironments@2023-05-01' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: {} 12 | } 13 | 14 | output name string = environment.name 15 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Static Web Apps instance.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param sku object = { 7 | name: 'Free' 8 | tier: 'Free' 9 | } 10 | 11 | resource web 'Microsoft.Web/staticSites@2022-03-01' = { 12 | name: name 13 | location: location 14 | tags: tags 15 | sku: sku 16 | properties: { 17 | provider: 'Custom' 18 | } 19 | } 20 | 21 | output name string = web.name 22 | output uri string = 'https://${web.properties.defaultHostname}' 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Log Analytics workspace.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | output id string = logAnalytics.id 22 | output name string = logAnalytics.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure CDN profile.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | @description('The pricing tier of this CDN profile') 7 | @allowed([ 8 | 'Custom_Verizon' 9 | 'Premium_AzureFrontDoor' 10 | 'Premium_Verizon' 11 | 'StandardPlus_955BandWidth_ChinaCdn' 12 | 'StandardPlus_AvgBandWidth_ChinaCdn' 13 | 'StandardPlus_ChinaCdn' 14 | 'Standard_955BandWidth_ChinaCdn' 15 | 'Standard_Akamai' 16 | 'Standard_AvgBandWidth_ChinaCdn' 17 | 'Standard_AzureFrontDoor' 18 | 'Standard_ChinaCdn' 19 | 'Standard_Microsoft' 20 | 'Standard_Verizon' 21 | ]) 22 | param sku string = 'Standard_Microsoft' 23 | 24 | resource profile 'Microsoft.Cdn/profiles@2022-05-01-preview' = { 25 | name: name 26 | location: location 27 | tags: tags 28 | sku: { 29 | name: sku 30 | } 31 | } 32 | 33 | output id string = profile.id 34 | output name string = profile.name 35 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/security/configstore-access.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of Azure App Configuration store') 2 | param configStoreName string 3 | 4 | @description('The principal ID of the service principal to assign the role to') 5 | param principalId string 6 | 7 | resource configStore 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = { 8 | name: configStoreName 9 | } 10 | 11 | var configStoreDataReaderRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071') 12 | 13 | resource configStoreDataReaderRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 14 | name: guid(subscription().id, resourceGroup().id, principalId, configStoreDataReaderRole) 15 | scope: configStore 16 | properties: { 17 | roleDefinitionId: configStoreDataReaderRole 18 | principalId: principalId 19 | principalType: 'ServicePrincipal' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns an Azure Key Vault access policy.' 2 | param name string = 'add' 3 | 4 | param keyVaultName string 5 | param permissions object = { secrets: [ 'get', 'list' ] } 6 | param principalId string 7 | 8 | resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { 9 | parent: keyVault 10 | name: name 11 | properties: { 12 | accessPolicies: [ { 13 | objectId: principalId 14 | tenantId: subscription().tenantId 15 | permissions: permissions 16 | } ] 17 | } 18 | } 19 | 20 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 21 | name: keyVaultName 22 | } 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates or updates a secret in an Azure Key Vault.' 2 | param name string 3 | param tags object = {} 4 | param keyVaultName string 5 | param contentType string = 'string' 6 | @description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') 7 | @secure() 8 | param secretValue string 9 | 10 | param enabled bool = true 11 | param exp int = 0 12 | param nbf int = 0 13 | 14 | resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 15 | name: name 16 | tags: tags 17 | parent: keyVault 18 | properties: { 19 | attributes: { 20 | enabled: enabled 21 | exp: exp 22 | nbf: nbf 23 | } 24 | contentType: contentType 25 | value: secretValue 26 | } 27 | } 28 | 29 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 30 | name: keyVaultName 31 | } 32 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.' 2 | param containerRegistryName string 3 | param principalId string 4 | 5 | var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') 6 | 7 | resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 8 | scope: containerRegistry // Use when specifying a scope that is different than the deployment scope 9 | name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) 10 | properties: { 11 | roleDefinitionId: acrPullRole 12 | principalType: 'ServicePrincipal' 13 | principalId: principalId 14 | } 15 | } 16 | 17 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { 18 | name: containerRegistryName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/core/testing/loadtesting.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param managedIdentity bool = false 4 | param tags object = {} 5 | 6 | resource loadTest 'Microsoft.LoadTestService/loadTests@2022-12-01' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } 11 | properties: { 12 | } 13 | } 14 | 15 | output loadTestingName string = loadTest.name 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/infra/main.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "environmentName": { 6 | "value": "${AZURE_ENV_NAME}" 7 | }, 8 | "location": { 9 | "value": "${AZURE_LOCATION}" 10 | }, 11 | "principalId": { 12 | "value": "${AZURE_PRINCIPAL_ID}" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/function-chaining/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/human-interaction/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/human-interaction/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/human-interaction/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/human-interaction/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/monitoring/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | } 5 | 6 | group 'io.durabletask' 7 | version = '0.1.0' 8 | def grpcVersion = '1.59.0' 9 | archivesBaseName = 'durabletask-samples' 10 | 11 | repositories { 12 | mavenLocal() 13 | mavenCentral() 14 | } 15 | 16 | task runMonitoringPattern(type: JavaExec) { 17 | classpath = sourceSets.main.runtimeClasspath 18 | mainClass = 'io.durabletask.samples.MonitoringPattern' 19 | systemProperty 'logback.configurationFile', 'src/main/resources/logback-spring.xml' 20 | } 21 | 22 | dependencies { 23 | implementation("com.microsoft:durabletask-client:1.5.1") 24 | implementation("com.microsoft:durabletask-azuremanaged:1.5.1-preview.1") 25 | 26 | // Logging dependencies 27 | implementation 'ch.qos.logback:logback-classic:1.2.6' 28 | implementation 'org.slf4j:slf4j-api:1.7.32' 29 | 30 | // https://github.com/grpc/grpc-java#download 31 | implementation "io.grpc:grpc-protobuf:${grpcVersion}" 32 | implementation "io.grpc:grpc-stub:${grpcVersion}" 33 | runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" 34 | implementation 'com.azure:azure-identity:1.15.0' 35 | } -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/monitoring/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/monitoring/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/monitoring/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/monitoring/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/sub-orchestrations/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | } 5 | 6 | group 'io.durabletask' 7 | version = '0.1.0' 8 | def grpcVersion = '1.59.0' 9 | archivesBaseName = 'durabletask-samples' 10 | 11 | repositories { 12 | mavenLocal() 13 | mavenCentral() 14 | } 15 | 16 | task runSubOrchestrationPattern(type: JavaExec) { 17 | classpath = sourceSets.main.runtimeClasspath 18 | mainClass = 'io.durabletask.samples.SubOrchestrationPattern' 19 | systemProperty 'logback.configurationFile', 'src/main/resources/logback-spring.xml' 20 | } 21 | 22 | dependencies { 23 | implementation("com.microsoft:durabletask-client:1.5.1") 24 | implementation("com.microsoft:durabletask-azuremanaged:1.5.1-preview.1") 25 | 26 | // Logging dependencies 27 | implementation 'ch.qos.logback:logback-classic:1.2.6' 28 | implementation 'org.slf4j:slf4j-api:1.7.32' 29 | 30 | // https://github.com/grpc/grpc-java#download 31 | implementation "io.grpc:grpc-protobuf:${grpcVersion}" 32 | implementation "io.grpc:grpc-stub:${grpcVersion}" 33 | runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" 34 | implementation 'com.azure:azure-identity:1.15.0' 35 | } -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/sub-orchestrations/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/Durable-Task-Scheduler/6c912382500cdebecc07f17f94804d543b59cffe/samples/durable-task-sdks/java/sub-orchestrations/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/sub-orchestrations/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/java/sub-orchestrations/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/async-http-api/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity 3 | fastapi 4 | uvicorn 5 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/eternal-orchestrations/client.py: -------------------------------------------------------------------------------- 1 | import os 2 | from azure.identity import DefaultAzureCredential 3 | from durabletask.azuremanaged.client import DurableTaskSchedulerClient 4 | 5 | # Get environment variables for taskhub and endpoint with defaults 6 | taskhub_name = os.getenv("TASKHUB", "default") 7 | endpoint = os.getenv("ENDPOINT", "http://localhost:8080") 8 | 9 | print(f"Using taskhub: {taskhub_name}") 10 | print(f"Using endpoint: {endpoint}") 11 | 12 | # Set credential to None for emulator, or DefaultAzureCredential for Azure 13 | credential = None if endpoint == "http://localhost:8080" else DefaultAzureCredential() 14 | 15 | # Create a client, start an orchestration, and wait for it to finish 16 | c = DurableTaskSchedulerClient(host_address=endpoint, secure_channel=True, 17 | taskhub=taskhub_name, token_credential=credential) 18 | 19 | counter = 1 20 | instance_id = c.schedule_new_orchestration("periodic_cleanup", input=counter) 21 | 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/eternal-orchestrations/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/fan-out-fan-in/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity 3 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/Dockerfile.client: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | WORKDIR /app 4 | 5 | # Copy requirements first to leverage Docker cache 6 | COPY requirements.txt . 7 | RUN pip install --no-cache-dir -r requirements.txt 8 | 9 | # Copy client application code 10 | COPY client.py . 11 | 12 | # Run the client application 13 | CMD ["python", "client.py"] 14 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/Dockerfile.worker: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | WORKDIR /app 4 | 5 | # Copy requirements first to leverage Docker cache 6 | COPY requirements.txt . 7 | RUN pip install --no-cache-dir -r requirements.txt 8 | 9 | # Copy worker application code 10 | COPY worker.py . 11 | 12 | # Run the worker application 13 | CMD ["python", "worker.py"] 14 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | # This is an example starter azure.yaml file containing several example services in comments below. 4 | # Make changes as needed to describe your application setup. 5 | # To learn more about the azure.yaml file, visit https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema 6 | 7 | # Name of the application. 8 | metadata: 9 | template: hello-azd-python 10 | name: dts-quickstart 11 | services: 12 | client: 13 | project: . 14 | language: python 15 | host: containerapp 16 | apiVersion: 2025-01-01 17 | docker: 18 | path: ./Dockerfile.client 19 | worker: 20 | project: . 21 | language: python 22 | host: containerapp 23 | apiVersion: 2025-01-01 24 | docker: 25 | path: ./Dockerfile.worker 26 | 27 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/app/user-assigned-identity.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Microsoft Entra user-assigned identity.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | } 12 | 13 | output name string = identity.name 14 | output resourceId string = identity.id 15 | output principalId string = identity.properties.principalId 16 | output clientId string = identity.properties.clientId 17 | output tenantId string = identity.properties.tenantId 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for MongoDB account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 8 | 9 | module cosmos '../../cosmos/cosmos-account.bicep' = { 10 | name: 'cosmos-account' 11 | params: { 12 | name: name 13 | location: location 14 | connectionStringKey: connectionStringKey 15 | keyVaultName: keyVaultName 16 | kind: 'MongoDB' 17 | tags: tags 18 | } 19 | } 20 | 21 | output connectionStringKey string = cosmos.outputs.connectionStringKey 22 | output endpoint string = cosmos.outputs.endpoint 23 | output id string = cosmos.outputs.id 24 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for NoSQL account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | 8 | module cosmos '../../cosmos/cosmos-account.bicep' = { 9 | name: 'cosmos-account' 10 | params: { 11 | name: name 12 | location: location 13 | tags: tags 14 | keyVaultName: keyVaultName 15 | kind: 'GlobalDocumentDB' 16 | } 17 | } 18 | 19 | output connectionStringKey string = cosmos.outputs.connectionStringKey 20 | output endpoint string = cosmos.outputs.endpoint 21 | output id string = cosmos.outputs.id 22 | output name string = cosmos.outputs.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | param roleDefinitionId string 5 | param principalId string = '' 6 | 7 | resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 8 | parent: cosmos 9 | name: guid(roleDefinitionId, principalId, cosmos.id) 10 | properties: { 11 | principalId: principalId 12 | roleDefinitionId: roleDefinitionId 13 | scope: cosmos.id 14 | } 15 | } 16 | 17 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 18 | name: accountName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { 5 | parent: cosmos 6 | name: guid(cosmos.id, accountName, 'sql-role') 7 | properties: { 8 | assignableScopes: [ 9 | cosmos.id 10 | ] 11 | permissions: [ 12 | { 13 | dataActions: [ 14 | 'Microsoft.DocumentDB/databaseAccounts/readMetadata' 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' 16 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' 17 | ] 18 | notDataActions: [] 19 | } 20 | ] 21 | roleName: 'Reader Writer' 22 | type: 'CustomRole' 23 | } 24 | } 25 | 26 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 27 | name: accountName 28 | } 29 | 30 | output id string = roleDefinition.id 31 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Adds an agent pool to an Azure Kubernetes Service (AKS) cluster.' 2 | param clusterName string 3 | 4 | @description('The agent pool name') 5 | param name string 6 | 7 | @description('The agent pool configuration') 8 | param config object 9 | 10 | resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-10-02-preview' existing = { 11 | name: clusterName 12 | } 13 | 14 | resource nodePool 'Microsoft.ContainerService/managedClusters/agentPools@2023-10-02-preview' = { 15 | parent: aksCluster 16 | name: name 17 | properties: config 18 | } 19 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | } 17 | 18 | output id string = appServicePlan.id 19 | output name string = appServicePlan.name 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/host/container-apps/managed.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Container Apps managed environment.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource environment 'Microsoft.App/managedEnvironments@2023-05-01' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: {} 12 | } 13 | 14 | output name string = environment.name 15 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Static Web Apps instance.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param sku object = { 7 | name: 'Free' 8 | tier: 'Free' 9 | } 10 | 11 | resource web 'Microsoft.Web/staticSites@2022-03-01' = { 12 | name: name 13 | location: location 14 | tags: tags 15 | sku: sku 16 | properties: { 17 | provider: 'Custom' 18 | } 19 | } 20 | 21 | output name string = web.name 22 | output uri string = 'https://${web.properties.defaultHostname}' 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Log Analytics workspace.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | output id string = logAnalytics.id 22 | output name string = logAnalytics.name 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure CDN profile.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | @description('The pricing tier of this CDN profile') 7 | @allowed([ 8 | 'Custom_Verizon' 9 | 'Premium_AzureFrontDoor' 10 | 'Premium_Verizon' 11 | 'StandardPlus_955BandWidth_ChinaCdn' 12 | 'StandardPlus_AvgBandWidth_ChinaCdn' 13 | 'StandardPlus_ChinaCdn' 14 | 'Standard_955BandWidth_ChinaCdn' 15 | 'Standard_Akamai' 16 | 'Standard_AvgBandWidth_ChinaCdn' 17 | 'Standard_AzureFrontDoor' 18 | 'Standard_ChinaCdn' 19 | 'Standard_Microsoft' 20 | 'Standard_Verizon' 21 | ]) 22 | param sku string = 'Standard_Microsoft' 23 | 24 | resource profile 'Microsoft.Cdn/profiles@2022-05-01-preview' = { 25 | name: name 26 | location: location 27 | tags: tags 28 | sku: { 29 | name: sku 30 | } 31 | } 32 | 33 | output id string = profile.id 34 | output name string = profile.name 35 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/security/configstore-access.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of Azure App Configuration store') 2 | param configStoreName string 3 | 4 | @description('The principal ID of the service principal to assign the role to') 5 | param principalId string 6 | 7 | resource configStore 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = { 8 | name: configStoreName 9 | } 10 | 11 | var configStoreDataReaderRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071') 12 | 13 | resource configStoreDataReaderRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 14 | name: guid(subscription().id, resourceGroup().id, principalId, configStoreDataReaderRole) 15 | scope: configStore 16 | properties: { 17 | roleDefinitionId: configStoreDataReaderRole 18 | principalId: principalId 19 | principalType: 'ServicePrincipal' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns an Azure Key Vault access policy.' 2 | param name string = 'add' 3 | 4 | param keyVaultName string 5 | param permissions object = { secrets: [ 'get', 'list' ] } 6 | param principalId string 7 | 8 | resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { 9 | parent: keyVault 10 | name: name 11 | properties: { 12 | accessPolicies: [ { 13 | objectId: principalId 14 | tenantId: subscription().tenantId 15 | permissions: permissions 16 | } ] 17 | } 18 | } 19 | 20 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 21 | name: keyVaultName 22 | } 23 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates or updates a secret in an Azure Key Vault.' 2 | param name string 3 | param tags object = {} 4 | param keyVaultName string 5 | param contentType string = 'string' 6 | @description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') 7 | @secure() 8 | param secretValue string 9 | 10 | param enabled bool = true 11 | param exp int = 0 12 | param nbf int = 0 13 | 14 | resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 15 | name: name 16 | tags: tags 17 | parent: keyVault 18 | properties: { 19 | attributes: { 20 | enabled: enabled 21 | exp: exp 22 | nbf: nbf 23 | } 24 | contentType: contentType 25 | value: secretValue 26 | } 27 | } 28 | 29 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 30 | name: keyVaultName 31 | } 32 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.' 2 | param containerRegistryName string 3 | param principalId string 4 | 5 | var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') 6 | 7 | resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 8 | scope: containerRegistry // Use when specifying a scope that is different than the deployment scope 9 | name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) 10 | properties: { 11 | roleDefinitionId: acrPullRole 12 | principalType: 'ServicePrincipal' 13 | principalId: principalId 14 | } 15 | } 16 | 17 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { 18 | name: containerRegistryName 19 | } 20 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/core/testing/loadtesting.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param managedIdentity bool = false 4 | param tags object = {} 5 | 6 | resource loadTest 'Microsoft.LoadTestService/loadTests@2022-12-01' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } 11 | properties: { 12 | } 13 | } 14 | 15 | output loadTestingName string = loadTest.name 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/infra/main.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "environmentName": { 6 | "value": "${AZURE_ENV_NAME}" 7 | }, 8 | "location": { 9 | "value": "${AZURE_LOCATION}" 10 | }, 11 | "principalId": { 12 | "value": "${AZURE_PRINCIPAL_ID}" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/function-chaining/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity 3 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/human-interaction/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity 3 | fastapi 4 | uvicorn 5 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/monitoring/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity 3 | -------------------------------------------------------------------------------- /samples/durable-task-sdks/python/sub-orchestrations/requirements.txt: -------------------------------------------------------------------------------- 1 | durabletask-azuremanaged 2 | azure-identity -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | b2f26a38-2066-4051-916a-b21af6b0f10e 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/Client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 2 | WORKDIR /src 3 | 4 | # Copy csproj and restore dependencies 5 | COPY ["Client.csproj", "./"] 6 | RUN dotnet restore 7 | 8 | # Copy all files and build 9 | COPY . . 10 | RUN dotnet publish -c Release -o /app/publish 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS final 14 | WORKDIR /app 15 | COPY --from=build /app/publish . 16 | 17 | # Expose port 80 explicitly 18 | EXPOSE 8080 19 | 20 | # Set the entrypoint 21 | ENTRYPOINT ["dotnet", "Client.dll"] 22 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/Worker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 2 | WORKDIR /src 3 | 4 | # Copy csproj and restore dependencies 5 | COPY ["Worker.csproj", "./"] 6 | RUN dotnet restore 7 | 8 | # Copy all files and build 9 | COPY . . 10 | RUN dotnet publish -c Release -o /app/publish 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/runtime:8.0 AS final 14 | WORKDIR /app 15 | COPY --from=build /app/publish . 16 | 17 | EXPOSE 8080 18 | # Set the entrypoint 19 | ENTRYPOINT ["dotnet", "Worker.dll"] 20 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/Worker/Worker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 15db87b3-cffd-47da-a40c-a8a1f09ab2b7 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/azure.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json 2 | 3 | # This is an example starter azure.yaml file containing several example services in comments below. 4 | # Make changes as needed to describe your application setup. 5 | # To learn more about the azure.yaml file, visit https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema 6 | 7 | # Name of the application. 8 | metadata: 9 | template: autoscaling-in-aca-dotnet 10 | name: autoscaling-in-aca 11 | services: 12 | client: 13 | project: ./Client 14 | language: csharp 15 | host: containerapp 16 | apiVersion: 2025-01-01 17 | docker: 18 | path: ./Dockerfile 19 | worker: 20 | project: ./Worker 21 | language: csharp 22 | host: containerapp 23 | apiVersion: 2025-01-01 24 | docker: 25 | path: ./Dockerfile 26 | 27 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/app/dts.bicep: -------------------------------------------------------------------------------- 1 | param ipAllowlist array 2 | param location string 3 | param tags object = {} 4 | param name string 5 | param taskhubname string 6 | param skuName string 7 | param skuCapacity int 8 | 9 | resource dts 'Microsoft.DurableTask/schedulers@2024-10-01-preview' = { 10 | location: location 11 | tags: tags 12 | name: name 13 | properties: { 14 | ipAllowlist: ipAllowlist 15 | sku: { 16 | name: skuName 17 | capacity: skuCapacity 18 | } 19 | } 20 | } 21 | 22 | resource taskhub 'Microsoft.DurableTask/schedulers/taskhubs@2024-10-01-preview' = { 23 | parent: dts 24 | name: taskhubname 25 | } 26 | 27 | output dts_NAME string = dts.name 28 | output dts_URL string = dts.properties.endpoint 29 | output TASKHUB_NAME string = taskhub.name 30 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/app/user-assigned-identity.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Microsoft Entra user-assigned identity.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | } 12 | 13 | output name string = identity.name 14 | output resourceId string = identity.id 15 | output principalId string = identity.properties.principalId 16 | output clientId string = identity.properties.clientId 17 | output tenantId string = identity.properties.tenantId 18 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for MongoDB account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING' 8 | 9 | module cosmos '../../cosmos/cosmos-account.bicep' = { 10 | name: 'cosmos-account' 11 | params: { 12 | name: name 13 | location: location 14 | connectionStringKey: connectionStringKey 15 | keyVaultName: keyVaultName 16 | kind: 'MongoDB' 17 | tags: tags 18 | } 19 | } 20 | 21 | output connectionStringKey string = cosmos.outputs.connectionStringKey 22 | output endpoint string = cosmos.outputs.endpoint 23 | output id string = cosmos.outputs.id 24 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Cosmos DB for NoSQL account.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param keyVaultName string 7 | 8 | module cosmos '../../cosmos/cosmos-account.bicep' = { 9 | name: 'cosmos-account' 10 | params: { 11 | name: name 12 | location: location 13 | tags: tags 14 | keyVaultName: keyVaultName 15 | kind: 'GlobalDocumentDB' 16 | } 17 | } 18 | 19 | output connectionStringKey string = cosmos.outputs.connectionStringKey 20 | output endpoint string = cosmos.outputs.endpoint 21 | output id string = cosmos.outputs.id 22 | output name string = cosmos.outputs.name 23 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | param roleDefinitionId string 5 | param principalId string = '' 6 | 7 | resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { 8 | parent: cosmos 9 | name: guid(roleDefinitionId, principalId, cosmos.id) 10 | properties: { 11 | principalId: principalId 12 | roleDefinitionId: roleDefinitionId 13 | scope: cosmos.id 14 | } 15 | } 16 | 17 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 18 | name: accountName 19 | } 20 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.' 2 | param accountName string 3 | 4 | resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = { 5 | parent: cosmos 6 | name: guid(cosmos.id, accountName, 'sql-role') 7 | properties: { 8 | assignableScopes: [ 9 | cosmos.id 10 | ] 11 | permissions: [ 12 | { 13 | dataActions: [ 14 | 'Microsoft.DocumentDB/databaseAccounts/readMetadata' 15 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*' 16 | 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*' 17 | ] 18 | notDataActions: [] 19 | } 20 | ] 21 | roleName: 'Reader Writer' 22 | type: 'CustomRole' 23 | } 24 | } 25 | 26 | resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { 27 | name: accountName 28 | } 29 | 30 | output id string = roleDefinition.id 31 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Adds an agent pool to an Azure Kubernetes Service (AKS) cluster.' 2 | param clusterName string 3 | 4 | @description('The agent pool name') 5 | param name string 6 | 7 | @description('The agent pool configuration') 8 | param config object 9 | 10 | resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-10-02-preview' existing = { 11 | name: clusterName 12 | } 13 | 14 | resource nodePool 'Microsoft.ContainerService/managedClusters/agentPools@2023-10-02-preview' = { 15 | parent: aksCluster 16 | name: name 17 | properties: config 18 | } 19 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Updates app settings for an Azure App Service.' 2 | @description('The name of the app service resource within the current resource group scope') 3 | param name string 4 | 5 | @description('The app settings to be applied to the app service') 6 | @secure() 7 | param appSettings object 8 | 9 | resource appService 'Microsoft.Web/sites@2022-03-01' existing = { 10 | name: name 11 | } 12 | 13 | resource settings 'Microsoft.Web/sites/config@2022-03-01' = { 14 | name: 'appsettings' 15 | parent: appService 16 | properties: appSettings 17 | } 18 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure App Service plan.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param kind string = '' 7 | param reserved bool = true 8 | param sku object 9 | 10 | resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { 11 | name: name 12 | location: location 13 | tags: tags 14 | sku: sku 15 | kind: kind 16 | } 17 | 18 | output id string = appServicePlan.id 19 | output name string = appServicePlan.name 20 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/host/container-apps/managed.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Container Apps managed environment.' 2 | 3 | param name string 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | 7 | resource environment 'Microsoft.App/managedEnvironments@2023-05-01' = { 8 | name: name 9 | location: location 10 | tags: tags 11 | properties: {} 12 | } 13 | 14 | output name string = environment.name 15 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure Static Web Apps instance.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | param sku object = { 7 | name: 'Free' 8 | tier: 'Free' 9 | } 10 | 11 | resource web 'Microsoft.Web/staticSites@2022-03-01' = { 12 | name: name 13 | location: location 14 | tags: tags 15 | sku: sku 16 | properties: { 17 | provider: 'Custom' 18 | } 19 | } 20 | 21 | output name string = web.name 22 | output uri string = 'https://${web.properties.defaultHostname}' 23 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Application Insights instance based on an existing Log Analytics workspace.' 2 | param name string 3 | param dashboardName string = '' 4 | param location string = resourceGroup().location 5 | param tags object = {} 6 | param logAnalyticsWorkspaceId string 7 | 8 | resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = { 9 | name: name 10 | location: location 11 | tags: tags 12 | kind: 'web' 13 | properties: { 14 | Application_Type: 'web' 15 | WorkspaceResourceId: logAnalyticsWorkspaceId 16 | } 17 | } 18 | 19 | module applicationInsightsDashboard 'applicationinsights-dashboard.bicep' = if (!empty(dashboardName)) { 20 | name: 'application-insights-dashboard' 21 | params: { 22 | name: dashboardName 23 | location: location 24 | applicationInsightsName: applicationInsights.name 25 | } 26 | } 27 | 28 | output connectionString string = applicationInsights.properties.ConnectionString 29 | output id string = applicationInsights.id 30 | output instrumentationKey string = applicationInsights.properties.InstrumentationKey 31 | output name string = applicationInsights.name 32 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a Log Analytics workspace.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | properties: any({ 11 | retentionInDays: 30 12 | features: { 13 | searchVersion: 1 14 | } 15 | sku: { 16 | name: 'PerGB2018' 17 | } 18 | }) 19 | } 20 | 21 | output id string = logAnalytics.id 22 | output name string = logAnalytics.name 23 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates an Azure CDN profile.' 2 | param name string 3 | param location string = resourceGroup().location 4 | param tags object = {} 5 | 6 | @description('The pricing tier of this CDN profile') 7 | @allowed([ 8 | 'Custom_Verizon' 9 | 'Premium_AzureFrontDoor' 10 | 'Premium_Verizon' 11 | 'StandardPlus_955BandWidth_ChinaCdn' 12 | 'StandardPlus_AvgBandWidth_ChinaCdn' 13 | 'StandardPlus_ChinaCdn' 14 | 'Standard_955BandWidth_ChinaCdn' 15 | 'Standard_Akamai' 16 | 'Standard_AvgBandWidth_ChinaCdn' 17 | 'Standard_AzureFrontDoor' 18 | 'Standard_ChinaCdn' 19 | 'Standard_Microsoft' 20 | 'Standard_Verizon' 21 | ]) 22 | param sku string = 'Standard_Microsoft' 23 | 24 | resource profile 'Microsoft.Cdn/profiles@2022-05-01-preview' = { 25 | name: name 26 | location: location 27 | tags: tags 28 | sku: { 29 | name: sku 30 | } 31 | } 32 | 33 | output id string = profile.id 34 | output name string = profile.name 35 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/security/configstore-access.bicep: -------------------------------------------------------------------------------- 1 | @description('Name of Azure App Configuration store') 2 | param configStoreName string 3 | 4 | @description('The principal ID of the service principal to assign the role to') 5 | param principalId string 6 | 7 | resource configStore 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = { 8 | name: configStoreName 9 | } 10 | 11 | var configStoreDataReaderRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071') 12 | 13 | resource configStoreDataReaderRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 14 | name: guid(subscription().id, resourceGroup().id, principalId, configStoreDataReaderRole) 15 | scope: configStore 16 | properties: { 17 | roleDefinitionId: configStoreDataReaderRole 18 | principalId: principalId 19 | principalType: 'ServicePrincipal' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns an Azure Key Vault access policy.' 2 | param name string = 'add' 3 | 4 | param keyVaultName string 5 | param permissions object = { secrets: [ 'get', 'list' ] } 6 | param principalId string 7 | 8 | resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = { 9 | parent: keyVault 10 | name: name 11 | properties: { 12 | accessPolicies: [ { 13 | objectId: principalId 14 | tenantId: subscription().tenantId 15 | permissions: permissions 16 | } ] 17 | } 18 | } 19 | 20 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 21 | name: keyVaultName 22 | } 23 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates or updates a secret in an Azure Key Vault.' 2 | param name string 3 | param tags object = {} 4 | param keyVaultName string 5 | param contentType string = 'string' 6 | @description('The value of the secret. Provide only derived values like blob storage access, but do not hard code any secrets in your templates') 7 | @secure() 8 | param secretValue string 9 | 10 | param enabled bool = true 11 | param exp int = 0 12 | param nbf int = 0 13 | 14 | resource keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = { 15 | name: name 16 | tags: tags 17 | parent: keyVault 18 | properties: { 19 | attributes: { 20 | enabled: enabled 21 | exp: exp 22 | nbf: nbf 23 | } 24 | contentType: contentType 25 | value: secretValue 26 | } 27 | } 28 | 29 | resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = { 30 | name: keyVaultName 31 | } 32 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.' 2 | param containerRegistryName string 3 | param principalId string 4 | 5 | var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') 6 | 7 | resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 8 | scope: containerRegistry // Use when specifying a scope that is different than the deployment scope 9 | name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole) 10 | properties: { 11 | roleDefinitionId: acrPullRole 12 | principalType: 'ServicePrincipal' 13 | principalId: principalId 14 | } 15 | } 16 | 17 | resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = { 18 | name: containerRegistryName 19 | } 20 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/security/role.bicep: -------------------------------------------------------------------------------- 1 | metadata description = 'Creates a role assignment for a service principal.' 2 | param principalId string 3 | 4 | @allowed([ 5 | 'Device' 6 | 'ForeignGroup' 7 | 'Group' 8 | 'ServicePrincipal' 9 | 'User' 10 | ]) 11 | param principalType string = 'ServicePrincipal' 12 | param roleDefinitionId string 13 | 14 | resource role 'Microsoft.Authorization/roleAssignments@2022-04-01' = { 15 | name: guid(subscription().id, resourceGroup().id, principalId, roleDefinitionId) 16 | properties: { 17 | principalId: principalId 18 | principalType: principalType 19 | roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/core/testing/loadtesting.bicep: -------------------------------------------------------------------------------- 1 | param name string 2 | param location string = resourceGroup().location 3 | param managedIdentity bool = false 4 | param tags object = {} 5 | 6 | resource loadTest 'Microsoft.LoadTestService/loadTests@2022-12-01' = { 7 | name: name 8 | location: location 9 | tags: tags 10 | identity: { type: managedIdentity ? 'SystemAssigned' : 'None' } 11 | properties: { 12 | } 13 | } 14 | 15 | output loadTestingName string = loadTest.name 16 | -------------------------------------------------------------------------------- /samples/scenarios/AutoscalingInACA/infra/main.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "environmentName": { 6 | "value": "${AZURE_ENV_NAME}" 7 | }, 8 | "location": { 9 | "value": "${AZURE_LOCATION}" 10 | }, 11 | "principalId": { 12 | "value": "${AZURE_PRINCIPAL_ID}" 13 | } 14 | } 15 | } 16 | --------------------------------------------------------------------------------