-
Couldn't load subscription status.
- Fork 38
How to generate and use Function Graphs
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.
- 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 justdfm-func-map.json(will be applied to all Task Hubs) as the output name. - Upload this generated JSON file to
function-mapsvirtual folder insidedurable-functions-monitorBLOB 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. - Restart DfMon instance.
- 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).
- Add a
my-dfm-templatesfolder to your Functions project, adjacent to yourhost.jsonfile. The folder's name could be anything. - Make sure this folder and its subfolders are copied to publishing output. This is typically done by adding the following to your
.CSPROJfile:
<ItemGroup>
<Content Include="my-dfm-templates\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
- Place your
dfm-func-map.jsonfile(s) intomy-dfm-templates/function-mapsfolder. - Set the
DfmSettings.CustomTemplatesFolderNameproperty tomy-dfm-templatesduring DfMon's endpoint initialization:
DfmEndpoint.Setup(new DfmSettings {CustomTemplatesFolderName = "my-dfm-templates"});