abundant-knife-92318
09/20/2023, 11:42 AMworried-knife-31967
09/20/2023, 4:33 PMabundant-knife-92318
09/21/2023, 2:00 PMvar identity = new UserAssignedIdentity(NameGenerator.ManagedIdentity("marketplace"), new UserAssignedIdentityArgs
{
ResourceGroupName = resourceGroup.Name
});
Then assigning it to my Azure Web App via the Identity property, and then assigining it to each service where access is required. For example, here is a Storage Account...
var roleAssignment = new RoleAssignment("storageAccountRoleAssignment", new RoleAssignmentArgs
{
PrincipalId = identity.PrincipalId.Apply(x => x),
RoleDefinitionId = RoleDefinitions.StorageAccountContributor,
Scope = Resource.Id,
PrincipalType = PrincipalType.ServicePrincipal
});
Though now I am wondering if using System Assigned may be better than User Assigned 😄worried-knife-31967
09/21/2023, 2:08 PM