VALCOURT GROUP IT Tools
← All Tools
Asset Management

Asset Inventory Sync

Entra ID → FreshService · Automated daily sync via func-fresh-asset-sync

Last Run Status
Created
Updated
Skipped
Errors
Last Sync Run
Loading…
Sync Schedule
Loading…
Quick Actions
Sync Settings
Enable Automatic Sync Run the sync on the schedule below. Disable to pause without deleting config.
Default: 2 = 2:00 AM UTC. Adjust for your timezone offset.
Devices are matched by Entra Device ID → FreshService asset tag/serial.
When a device's Entra owner email is not found in FreshService, this requester ID is assigned instead. Leave blank to set user_id to null.
Field Mapping — Entra → FreshService

These fields are synced on every run. Read-only — contact IT to modify.

Entra ID FieldFreshService Asset FieldNotes
displayNamenameAsset display name
deviceIdasset_tag / serial_numberMatch key for create/update
operatingSystemtype_fields.os
operatingSystemVersiontype_fields.os_version
manufacturertype_fields.manufacturer
modeltype_fields.model
isComplianttype_fields.is_compliantBoolean
managementTypetype_fields.management_type
approximateLastSignInDateTimetype_fields.last_seen
registeredOwners[0].mailuser_id (requester)Looked up by email in FreshService
Entra Device Preview

Fetches the first 20 devices from Entra via Microsoft Graph using the App Service Managed Identity. Shows what will be synced and how users will map to FreshService requesters.

Sync Run Logs — 7-day retention
Click Refresh to load logs.
Azure Function App Setup

The sync runs via func-fresh-asset-sync — an Azure Function App in rg_it_apps. Follow these steps to deploy it.

Step 1 — Create the Function App

In Azure Cloud Shell:

az account set --subscription "5daa2737-51de-42fd-9014-acf5ebe1a834"

az functionapp create \
  --resource-group rg_it_apps \
  --name func-fresh-asset-sync \
  --storage-account <STORAGE_ACCOUNT_NAME> \
  --consumption-plan-location centralus \
  --runtime python \
  --runtime-version 3.11 \
  --functions-version 4 \
  --os-type linux

Note: Create a Storage Account first if you don't have one: az storage account create --name valcourtfnstorage --resource-group rg_it_apps --location centralus --sku Standard_LRS

Step 2 — Enable Managed Identity
az functionapp identity assign \
  --resource-group rg_it_apps \
  --name func-fresh-asset-sync

Copy the principalId from the output — needed for Step 3.

Step 3 — Grant Microsoft Graph Permissions

Run in Cloud Shell, replacing PRINCIPAL_ID with the value from Step 2:

PRINCIPAL_ID="<paste-principal-id-here>"

# Device.Read.All
az rest --method POST \
  --uri "https://graph.microsoft.com/v1.0/servicePrincipals/${PRINCIPAL_ID}/appRoleAssignments" \
  --body "{\"principalId\":\"${PRINCIPAL_ID}\",\"resourceId\":\"$(az ad sp show --id 00000003-0000-0000-c000-000000000000 --query id -o tsv)\",\"appRoleId\":\"7438b122-aefc-4978-80ed-43db9064d227\"}"

# User.Read.All
az rest --method POST \
  --uri "https://graph.microsoft.com/v1.0/servicePrincipals/${PRINCIPAL_ID}/appRoleAssignments" \
  --body "{\"principalId\":\"${PRINCIPAL_ID}\",\"resourceId\":\"$(az ad sp show --id 00000003-0000-0000-c000-000000000000 --query id -o tsv)\",\"appRoleId\":\"df021288-bdef-4463-88db-98f22de89214\"}"
Step 4 — Configure App Settings
az functionapp config appsettings set \
  --resource-group rg_it_apps \
  --name func-fresh-asset-sync \
  --settings \
    AZURE_KEYVAULT_URL="https://tvgitvault.vault.azure.net/" \
    FS_DOMAIN="valcourtgroup.freshservice.com" \
    FS_IMPORTER_URL="https://it.valcourt.net"
Step 5 — Grant Function App Access to Key Vault
az role assignment create \
  --role "Key Vault Secrets User" \
  --assignee "<paste-principal-id-here>" \
  --scope "/subscriptions/5daa2737-51de-42fd-9014-acf5ebe1a834/resourceGroups/rg_it_apps/providers/Microsoft.KeyVault/vaults/tvgitvault"
Step 6 — Deploy the Function Code

The Function code is in the func-fresh-asset-sync/ folder in your zip. Deploy via VS Code Azure Functions extension or CLI:

cd func-fresh-asset-sync
func azure functionapp publish func-fresh-asset-sync
Connection Tests