How to debug 403 Forbidden using SignTool w/ Trusted Signing?

Matt Haggard 40 Reputation points
2025-08-04T17:53:09.73+00:00

I'm trying to sign an executable with Trusted Signing. I've got a verified certificate, but am getting a 403 forbidden error when trying to run it. Here's the full command (from bash):

/c/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/10.0.22621.0/x64/signtool.exe sign -v -debug -fd SHA256 -tr http://timestamp.acs.microsof
t.com -td SHA256 -dlib /c/Users/matt/.nuget/packages/microsoft.trusted.signing.client/1.0.95/bin/x64/Azure.CodeSigning.Dlib.dll -dmdf azure
.signing.metadata.json dist/win-unpacked/my.exe

I've based authentication on https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet

I have also set the following environment variables with values from Azure portal:

export AZURE_CLIENT_ID='...'
export AZURE_TENANT_ID='...'
export AZURE_CLIENT_SECRET='...'

Here's the full output:

$ /c/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/10.0.22621.0/x64/signtool.exe sign -v -debug -fd SHA256 -tr http://timestamp.acs.microsof
t.com -td SHA256 -dlib /c/Users/matt/.nuget/packages/microsoft.trusted.signing.client/1.0.95/bin/x64/Azure.CodeSigning.Dlib.dll -dmdf azure
.signing.metadata.json dist/win-unpacked/my.exe

Trusted Signing

Version: 1.0.95

"Metadata": {
  "Endpoint": "https://eus.codesigning.azure.net",
  "CodeSigningAccountName": "MYACCOUTNAME",
  "CertificateProfileName": "MYCERTPROFILENAME",
  "ExcludeCredentials": [
    "ManagedIdentityCredential",
    "WorkloadIdentityCredential",
    "SharedTokenCacheCredential",
    "VisualStudioCredential",
    "VisualStudioCodeCredential",
    "AzureCliCredential",
    "AzurePowerShellCredential",
    "AzureDeveloperCliCredential",
    "InteractiveBrowserCredential"
  ]
}

Submitting digest for signing...
Unhandled managed exception
Azure.RequestFailedException: Service request failed.
Status: 403 (Forbidden)

Headers:
Date: Mon, 04 Aug 2025 16:36:14 GMT
Connection: keep-alive
Strict-Transport-Security: REDACTED
x-azure-ref: REDACTED
X-Cache: REDACTED
Content-Length: 0

   at Azure.CodeSigning.CertificateProfileRestClient.SignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest bo
dy, String xCorrelationId, String clientVersion, CancellationToken cancellationToken)
   at Azure.CodeSigning.CertificateProfileClient.StartSignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest b
ody, String xCorrelationId, String clientVersion, CancellationToken cancellationToken)
   at Azure.CodeSigning.Dlib.Core.DigestSigner.SignAsync(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle, CancellationToken 
cancellationToken)
   at Azure.CodeSigning.Dlib.Core.DigestSigner.Sign(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle)
   at AuthenticodeDigestSignExWithFileHandleManaged(_CRYPTOAPI_BLOB* pMetadataBlob, UInt32 digestAlgId, Byte* pbToBeSignedDigest, UInt32 cb
ToBeSignedDigest, Void* hFile, _CRYPTOAPI_BLOB* pSignedDigest, _CERT_CONTEXT** ppSignerCert, Void* hCertChainStore)

SignTool Error: An unexpected internal error has occurred.
Error information: "Error: SignerSign() failed." (-2147467259/0x80004005)

How do I debug why I'm getting a 403 Forbidden error?

Artifact Signing
Artifact Signing

A fully managed end-to-end service for digitally signing code, documents, and applications. (formerly Trusted Signing)


Answer accepted by question author
Swaroop Kolli 5,285 Reputation points Microsoft External Staff Moderator
2025-08-05T05:14:37.0233333+00:00

Hello @Matt Haggard,

Please add the roles Trusted Signing Certificate Profile Signer and Trusted Signing Identity Verifier to the App Registration Object and let us know the behavior.

You can do this by navigating to the Trusted Signing account > add role assignment and add the two roles to the service principal by searching with the app registration name. I do not have enough privilege to change the UI but will definitely pass this information to the concerned team.

We’re always looking to improve and would love to hear your thoughts. If you have any ideas or feedback on the feature in the question, please let us know your idea in the below given portal and our development team would be constantly monitoring them. https://feedbackportal.microsoft.com/feedback


If this answered your queries, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Meha-MSFT 2,460 Reputation points Microsoft Employee Moderator
    2025-08-04T20:11:44.9033333+00:00

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.