Skip to content

Commit b478202

Browse files
authored
chore(docs): improve Azure Trusted Signing Docs (electron-userland#8853)
1 parent 0f2c963 commit b478202

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

pages/code-signing-win.md

+30-15
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,36 @@ If you use Windows 7, please ensure that [PowerShell](https://blogs.technet.micr
1616

1717
If you are on Linux or Mac and you want sign a Windows app using EV Code Signing Certificate, please use [the guide for Unix systems](tutorials/code-signing-windows-apps-on-unix.md).
1818

19-
## Using with Azure Trusted Signing (beta)
19+
## Using Azure Trusted Signing (beta)
2020

21-
To sign using Azure Tenant account, you'll need the following env variables set that are read directly by `Invoke-TrustedSigning` module; they are not parsed or resolved by electron-builder.
21+
Microsoft itself offers a code signing service called Azure Trusted Signing which you can use to code-sign your applications.
22+
23+
If you do not already have an Azure setup and only want to use their code signing service, set up an Azure "Trusted Signing Account" using [this quickstart guide](https://learn.microsoft.com/en-us/azure/trusted-signing/quickstart). Then, [set up an "App registration"](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) in Azure, follow the steps to create a "Secret" for it, and [assign the role "Trusted Signing Certificate Profile Signer" to the App registration](https://learn.microsoft.com/en-us/azure/trusted-signing/tutorial-assign-roles).
24+
25+
To sign using your certificate, you'll need to adapt electron-builder's configuration and set the environment variables used for authentication. The environment variables are read directly by the `Invoke-TrustedSigning` module; they are not parsed or resolved by electron-builder.
26+
27+
First, to direct electron-builder to utilize Azure Trusted Signing, you'll need to set the property `win.azureSignOptions` in your electron-builder configuration. Configure it per [Microsoft's instructions](https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations#create-a-json-file).
28+
29+
| Property | Description |
30+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
31+
| `publisherName` | This must match exactly the CommonName (CN) property of the certificate you wish to use. |
32+
| `endpoint` | This corresponds to the endpoint you selected when creating your certificate. |
33+
| `certificateProfileName` | The name of the certificate profile within your Trusted Signing Account. |
34+
| `codeSigningAccountName` | This is the name of the Trusted Signing Account (note that it is **not** the account name for the app registration. |
35+
36+
Additional fields can be provided under `win.azureSignOptions` that are passed directly to the `Invoke-TrustedSigning` powershell module.
37+
38+
Second, provide the appropriate environment variables to the build action. Descriptions of each variable can be found in [Azure.Identity class - EnvironmentCredential Class](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition). You only need to provide the environment variables that are listed in the table corresponding to which authentication method you choose to use.
2239

2340
!!! tip
24-
Descriptions of each field can be found here: [Azure.Identity class - EnvironmentCredential Class](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)
25-
26-
| Env Name | Description
27-
| -------------- | -----------
28-
| `AZURE_TENANT_ID` | See the Tip mentioned above.
29-
| `AZURE_CLIENT_ID` |
30-
| `AZURE_CLIENT_SECRET` |
31-
| `AZURE_CLIENT_CERTIFICATE_PATH` |
32-
| `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` |
33-
| `AZURE_USERNAME` |
34-
| `AZURE_PASSWORD` |
35-
36-
`win.azureSignOptions` needs to be configured per [Microsoft's instructions](https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations#create-a-json-file) directly in electron-builder's configuration. Additional fields can be provided that are passed directly to `Invoke-TrustedSigning` powershell command.
41+
If you use the minimal setup using an "App registration" that is described above, the section "Service principal with secret" applies to you. In this case, you only need the Tenant ID, Client ID, and Client Secret.
42+
43+
| Env Name | Description |
44+
| ------------------------------------- | ------------------------------------------------------------------------------------------------------- |
45+
| `AZURE_TENANT_ID` | Your Azure AD Tenant ID; can be found in the Entra ID portal. |
46+
| `AZURE_CLIENT_ID` | The Application (Client) ID of your "App registration." Note that this is not the "object" ID. |
47+
| `AZURE_CLIENT_SECRET` | The value of the "Secret" you created for your App registration. Note that this is not the secret's ID. |
48+
| `AZURE_CLIENT_CERTIFICATE_PATH` | Required if you bring your own certificate. |
49+
| `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` | Required if you bring your own certificate. |
50+
| `AZURE_USERNAME` | The username for your Microsoft Entra account. |
51+
| `AZURE_PASSWORD` | The password for your Microsoft Entra account. |

0 commit comments

Comments
 (0)