-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spike]: API for role assignments #6636
base: main
Are you sure you want to change the base?
Changes from 6 commits
0ccfd21
b81fe65
3649a93
48d3cb0
88005a0
39df7aa
27a3d6f
6d5109a
c005f6e
6d734e2
43a2b78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
| ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureContainerApps.AppHost", "AzureContainerApps.AppHost.csproj", "{55003C7C-F6C0-469F-BA6A-C5EC13AB0763}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{55003C7C-F6C0-469F-BA6A-C5EC13AB0763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{55003C7C-F6C0-469F-BA6A-C5EC13AB0763}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{55003C7C-F6C0-469F-BA6A-C5EC13AB0763}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{55003C7C-F6C0-469F-BA6A-C5EC13AB0763}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {CE4F7DF9-62F5-454C-AE1B-D442D49897CA} | ||
EndGlobalSection | ||
EndGlobal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@description('The location for the resource(s) to be deployed.') | ||
param location string = resourceGroup().location | ||
|
||
param storage_outputs_name string | ||
|
||
resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: take('identity-${uniqueString(resourceGroup().id)}', 128) | ||
location: location | ||
} | ||
|
||
resource storage 'Microsoft.Storage/storageAccounts@2024-01-01' existing = { | ||
name: storage_outputs_name | ||
} | ||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to reference the set of resources we are creating role assignments for. |
||
|
||
resource storage_ba92f5b4_2d11_453d_a403_e96b0029c9fe 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
name: guid(storage.id, identity.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) | ||
properties: { | ||
principalId: identity.properties.principalId | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') | ||
principalType: 'ServicePrincipal' | ||
} | ||
scope: storage | ||
} | ||
|
||
output id string = identity.id | ||
|
||
output clientId string = identity.properties.clientId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These end up as outputs for the container app to use for both runtime and to associate this user assigned identity with the container app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generate a module per container/project and that module has both the user assigned identity and role assignments for that compute resource.