I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
Error Message:
'System.Hosting' reported Error for property 'CodePackageActivation:Code:EntryPoint:133360244693949629'. There was an error during CodePackage activation.KeyVault secret references require managed identity
Issue:
- Unable to inject a managed keyvault secret into an environmental variable.
Solution:
- You also need to add a resource to the ServiceManfest.xml: https://video2.skills-academy.com/en-us/azure/service-fabric/how-to-deploy-service-fabric-application-user-assigned-managed-identity
<Resources>
...
<ManagedIdentities DefaultIdentity="WebAdmin">
<ManagedIdentity Name="WebAdmin" />
</ManagedIdentities>
</Resources>
If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.
I hope this helps!
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.
If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.
Thank you for helping to improve Microsoft Q&A!