-
Notifications
You must be signed in to change notification settings - Fork 303
4. Deploy to a Docker container
- Build your project by running this command:
dotnet build -c release
- Publish your build by running this command:
dotnet publish
- Build a Docker container by using a workflow. For example, here's a sample Docker file for a .NET workflow:
FROM mcr.microsoft.com/azure-functions/dotnet:3.0.13614-appservice
ENV AzureWebJobsStorage <STORAGE_CONNECTION_STRING>
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY ./bin/Release/netcoreapp3.1/publish/ /home/site/wwwroot
Note: Replace the <STORAGE_CONNECTION_STRING> value with the connection string to Azure Storage.
docker build --tag local/workflowcontainer .
- Run the container locally:
docker run -p 8080:80 local/workflowcontainer
- The callback url for request triggers can be obtained by making the following request
POST /runtime/webhooks/flow/api/management/workflows/{workflowName}/triggers/{triggerName}/ listCallbackUrl?api-version=2019-10-01-edge-preview&code=<MASTER_KEY>
To obtain the Master_Key value, see details at https://github.com/Azure/azure-functions-docker/issues/84, but to summarize:
The master-key is defined in the storage account you have set for AzureWebJobsStroage in azure-webjobs-secrets/{deployment-name}/host.json It should look something like this:
{ ... "masterKey": { "name": "master", "value": "{value in here}", "encrypted": false } ... }