function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alexander VallatAlexander Vallat 

How do I include a Profile in a 2GP managed package?

I have checked the Metadata Coverage (https://developer.salesforce.com/docs/metadata-coverage/46) page, and it confirms that Profile (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profile.htm) can be included in a 2GP (sfdx) managed package.

I have successfully created the new named profile in a scratch org, and used source:pull to retrieve it into the force-app\main\default\profiles\myprofilename.profile-meta.xml

However, when I create a managed package from it, and install it into an org, I do not see the Profile listed anywhere in the list of package components, nor do I see the profile available in the profiles list after installation.

Is there something I'm missing here? The other components (Apex classes, VisualForce pages, Custom Object types) are all included correctly in the package.
Todd Halfpenny MCTodd Halfpenny MC

I haven't been able to work this out either.

Did you work this out @Alexander?

Alexander VallatAlexander Vallat
Sorry, I never did. I guess the documentation is just wrong.
Todd Halfpenny MCTodd Halfpenny MC
No worries. I have posted into the partner chatter to hopefully get some feedback - https://partners.salesforce.com/0D53A00004v1cyI
Hithesh SaicharanHithesh Saicharan
@Todd Halfpenny MC, @Alexander Vallat
I am also getting the same issue. Have you got the things working?