Since your Durable Function is running in an Azure Container App inside a VNet, the 401 error might be due to authentication or network restrictions.
Authentication – Managed Identity: Make sure your Managed Identity (msi-salil-test) has the right permissions, like "Azure Container Apps Service Contributor" and "Storage Queue Data Contributor". You can check its permissions with this command:
az role assignment list --assignee <MANAGED_IDENTITY_CLIENT_ID>
If you're using MSI, try getting an access token and passing it in your request:
ACCESS_TOKEN=$(az account get-access-token --resource https://management.azure.com --query accessToken --output tsv)
curl -i -X POST "<terminatePostUri>" -H "Authorization: Bearer $ACCESS_TOKEN"
Network Access: Since your function is inside a VNet, make sure your jumphost can reach the Container App. Run nslookup from the jumphost to check DNS resolution. Also, ensure that Private Endpoints and Firewall Rules allow traffic from the jumphost to the Container App.
Last option -Set to Anonymous: If you're still getting a 401 error, you can temporarily set authentication to Anonymous in the Azure Portal. Go to Container Apps → Authentication → Change to Anonymous. If this works, then it's definitely an authentication issue.