-
Notifications
You must be signed in to change notification settings - Fork 480
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
Draft
davidfowl
wants to merge
11
commits into
main
Choose a base branch
from
davidfowl/role-assignments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0ccfd21
Spike of API
davidfowl b81fe65
Next step
davidfowl 3649a93
Next phase
davidfowl 48d3cb0
Least privilege
davidfowl 88005a0
More tweaks
davidfowl 39df7aa
Cleaned up some APIs
davidfowl 27a3d6f
Fixed tests and clean up processing
davidfowl 6d5109a
Name the identity after the compute resource to avoid conflicts
davidfowl c005f6e
Added RoleDefinition
davidfowl 6d734e2
Fix tests
davidfowl 43a2b78
Changed the order
davidfowl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
playground/AzureContainerApps/AzureContainerApps.AppHost/AzureContainerApps.AppHost.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
playground/AzureContainerApps/AzureContainerApps.AppHost/api-roles.module.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 api_identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: take('api_identity-${uniqueString(resourceGroup().id)}', 128) | ||
location: location | ||
} | ||
|
||
resource storage 'Microsoft.Storage/storageAccounts@2024-01-01' existing = { | ||
name: storage_outputs_name | ||
} | ||
|
||
resource storage_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
name: guid(storage.id, api_identity.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) | ||
properties: { | ||
principalId: api_identity.properties.principalId | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') | ||
principalType: 'ServicePrincipal' | ||
} | ||
scope: storage | ||
} | ||
|
||
output id string = api_identity.id | ||
|
||
output clientId string = api_identity.properties.clientId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 need to reference the set of resources we are creating role assignments for.