You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: pages/code-signing-win.md
+30-15
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,36 @@ If you use Windows 7, please ensure that [PowerShell](https://blogs.technet.micr
16
16
17
17
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).
18
18
19
-
## Using with Azure Trusted Signing (beta)
19
+
## Using Azure Trusted Signing (beta)
20
20
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).
|`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.
22
39
23
40
!!! 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.
0 commit comments