Skip to content

How to generate and use Function Graphs

Konstantin Lepeshenkov edited this page Dec 21, 2021 · 8 revisions

DfMon is equipped with az-func-as-a-graph tool, which visualizes your Durable Functions (or any Azure Functions) in form of an interactive (clickable) graph like this one:

Clicking on a node leads you to the source code line where that Function is implemented. You can also start new orchestration instances directly from that graph:


When running DfMon as VsCode Extension, the Functions Graph tab should appear automatically, once you have the relevant Functions project opened. Alternatively use the Visualize Functions as a Graph command:

When running in standalone/injected mode you'll need to generate and upload an intermediate Functions Map JSON file.

  1. Generate it with az-func-as-a-graph CLI. Specify dfm-func-map.<my-task-hub-name>.json (will be applied to that particular Task Hub only) or just dfm-func-map.json (will be applied to all Task Hubs) as the output name.
  2. Upload this generated JSON file to function-maps virtual folder inside durable-functions-monitor BLOB container in the underlying Storage Account (the one where your Task Hub resides). The full path should look like /durable-functions-monitor/function-maps/dfm-func-map.<my-task-hub-name>.json.
  3. Restart DfMon instance.
  4. Observe the newly appeared Functions Graph tab.

Alternatively you can generate this Functions Map JSON file with DfMon as VsCode Extension. Use the Visualize Functions as a Graph command and press 'SAVE AS JSON' button:

Then upload the resulting file to function-maps Storage folder, as described above.


When running DfMon in Injected mode you can also deploy dfm-func-map.json file(s) along with your Function App (instead of putting them into Storage).

  1. Add a my-dfm-templates folder to your Functions project, adjacent to your host.json file. The folder's name could be anything.
  2. Make sure this folder and its subfolders are copied to publishing output. This is typically done by adding the following to your .CSPROJ file:
  <ItemGroup>
    <Content Include="my-dfm-templates\**">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  1. Place your dfm-func-map.json file(s) into my-dfm-templates/function-maps folder.
  2. Set the DfmSettings.CustomTemplatesFolderName property to my-dfm-templates during DfMon's endpoint initialization:
DfmEndpoint.Setup(new DfmSettings {CustomTemplatesFolderName = "my-dfm-templates"});