Skip to content

Commit 38fdb5b

Browse files
authored
Update create-key-vault-for-code-signing.md
1 parent 2c5af87 commit 38fdb5b

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

powerapps-docs/maker/common/wrap/create-key-vault-for-code-signing.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,69 @@ contributors:
1414
- mkaur-msft
1515
---
1616
# Create Azure key valut to automically sign your mobile app in wrap for Power Apps
17+
You need to have [Azure Key Vault](/azure/key-vault/general/basic-concepts) set up to automatically sign your Android or iOS mobile app package in **Step 2** of wrap wizard.
18+
19+
**Prerequisites**
20+
21+
- You need to have a [Apple account](https://developer.apple.com) enrolled in Apple developer Program or Apple enterprise developer program.
22+
- Create a [distribution certificate](code-sign-ios.md#create-the-distribution-certificate) or [ad-hoc Provisioning Profile](code-sign-ios.md#create-an-ios-provisioning-profile) or enterprise provisioning profile.
23+
- Azure Active Directory subscription to [create Key Vault](/azure/key-vault/general/quick-create-portal).
24+
- Admin access for your tenant.
25+
26+
Follow these steps to create Azure Key Vault and configure KeyVault URI:
27+
28+
1. Sign in to your tenent as an admin and create a new Azure service principal for 1P AAD application: 4e1f8dc5-5a42-45ce-a096-700fa485ba20 (WrapKeyVaultAccessApp) by running the following script: <br>
29+
`Connect-AzureAD -TenantId <your tenant ID>` <br>
30+
`New-AzureADServicePrincipal -AppId 4e1f8dc5-5a42-45ce-a096-700fa485ba20 -DisplayName "Wrap KeyVault Access App"`
31+
32+
2. In your default subscription's **Access Control (IAM)**, add a **Reader** role assignment to the **Service Principal** representing your app, e.g. **Wrap KeyVault Access App**. Make sure it is present in the **Subscription's IAM**, and the **Keyvault's IAM**.
33+
34+
Go to **Access control (IAM)** tab and select **Add role assignment** option under **Add** menu button.
35+
36+
> [!div class="mx-imgBorder"]
37+
> ![Add role assignment on Access control tab.](media/how-to-v2/Access_control_tab.png "Add role assignment on Access control tab.")
38+
39+
Select **Job fucntion roles** tab and make sure **Reader** role is selcetdd. Then click on **Members** tab in the top menu.
40+
41+
> [!div class="mx-imgBorder"]
42+
> ![Click on Members tab.](media/how-to-v2/Add_members.png "Click on Members tab.")
43+
44+
Search for **Wrap KeyVault Access App** on **Members** tab.
45+
46+
> [!div class="mx-imgBorder"]
47+
> ![Search for Wrap KeyVault Access App.](media/how-to-v2/Add_role_assignment.png "Search for Wrap KeyVault Access App.")
48+
49+
Select **Wrap KeyVault Access App** and click on **Review + assign** button on the bottom of the tab to assign **Reader** role to it.
50+
51+
> [!div class="mx-imgBorder"]
52+
> ![Assign Reader role to Wrap KeyVault Access App.](media/how-to-v2/Add_role_for_wrap_signing.png "Assign Reader role to Wrap KeyVault Access App.")
53+
54+
4. Create or access existing key vault. Please ensure this key vault is located in the default subscription for your tenant. More information: [Create a key vault using the Azure portal](/azure/key-vault/general/quick-create-portal).
55+
56+
5. Add access policies for the key vault.
57+
58+
:::image type="content" source="media/wrap-canvas-app/wrap-keyvault.gif" alt-text="Add access policies for the key vault.":::
59+
60+
6. Follow one of the these options, depending on your device:
61+
- For Android, create the .pfx file upload it to the keyvault certificate section. More information: [Generate keys](code-sign-android.md#generate-keys)
62+
63+
:::image type="content" source="media/wrap-canvas-app/wrap-1.png" alt-text="Create a cert for Android.":::
64+
> [!NOTE]
65+
> The name of the certificate must be present in the tag step. The password also needs match the password you entered during the store pass parameter used to create the .pfx file in step 2.
66+
67+
- For iOS:
68+
1. Install the .cer into Keychain Access app by double clicking it. More information: [Create the distribution certificate](code-sign-ios.md#create-the-distribution-certificate) </br> Then export the file as a .p12 file by right clicking your certificate file and the select **Export** and select the file format .p12.
69+
> [!NOTE]
70+
> The .p12 password that you set in step 4 is required when uploading it to the keyvault in the next step.
71+
2. [Create the provisioning profile](code-sign-ios.md#create-an-ios-provisioning-profile) and run the following command to encode it to base64:
72+
- Mac: base64 `-i example.mobileprovision`
73+
- Windows: `certutil -encode data.txt tmp.b64`
74+
75+
3. Get the outputted `base64` string from previous step and upload to Keyvault secret. Then, get the .p12 file and upload it to Keyvault Certificate.
76+
77+
:::image type="content" source="media/wrap-canvas-app/wrap-2.png" alt-text="Create a cert for iOS.":::
78+
79+
7. Once iOS or Android certificates are created and uploaded, add three tags with the name as the bundle id, and the value corresponding to the name of the uploaded certificate(s).
80+
81+
:::image type="content" source="media/wrap-canvas-app/wrap-3.png" alt-text="Add tags.":::
82+

0 commit comments

Comments
 (0)