Skip to content

Commit

Permalink
Storage kind fix roleassignment namespacefix (#42320)
Browse files Browse the repository at this point in the history
* Fixes bug with StorageAccount not using kind argument.
Fixes bug where role assignments where using the wrong ARM namespace.

* regen bicep

---------

Co-authored-by: jolov <[email protected]>
  • Loading branch information
mitchdenny and JoshLove-msft authored Mar 1, 2024
1 parent 3a83b56 commit 344ae86
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Azure.Provisioning.Authorization
/// </summary>
public class RoleAssignment : Resource<RoleAssignmentData>
{
private static readonly ResourceType ResourceType = "Microsoft.Resources/roleAssignments";
private static readonly ResourceType ResourceType = "Microsoft.Authorization/roleAssignments";
private static readonly ResourceType RoleDefinitionResourceType = "Microsoft.Authorization/roleDefinitions";

private const string SubscriptionResourceIdFunction = "subscriptionResourceId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public StorageAccount(IConstruct scope, StorageKind kind, StorageSkuName sku, Re
resourceType: ResourceTypeName,
location: Environment.GetEnvironmentVariable("AZURE_LOCATION") ?? AzureLocation.WestUS,
sku: new StorageSku(sku),
kind: StorageKind.StorageV2))
kind: kind))
{
AssignProperty(data => data.Name, GetAzureName(scope, name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource storageAccount_YRiDhR43q 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand All @@ -25,7 +25,7 @@ resource blobService_lnEDXlX5c 'Microsoft.Storage/storageAccounts/blobServices@2
}
}

resource roleAssignment_ZBWGKDk4O 'Microsoft.Resources/roleAssignments@2022-04-01' = {
resource roleAssignment_ZBWGKDk4O 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: storageAccount_YRiDhR43q
name: guid('storageAccount_YRiDhR43q', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'))
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource storageAccount_melvnlpF2 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand All @@ -17,7 +17,7 @@ resource blobService_NVMDcYVF9 'Microsoft.Storage/storageAccounts/blobServices@2
}
}

resource roleAssignment_lDOSGTMrV 'Microsoft.Resources/roleAssignments@2022-04-01' = {
resource roleAssignment_lDOSGTMrV 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: storageAccount_melvnlpF2
name: guid('storageAccount_melvnlpF2', '00000000-0000-0000-0000-000000000000', subscriptionResourceId('00000000-0000-0000-0000-000000000000', 'Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'))
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource storageAccount_YRiDhR43q 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand All @@ -22,7 +22,7 @@ resource blobService_lnEDXlX5c 'Microsoft.Storage/storageAccounts/blobServices@2
}
}

resource roleAssignment_ZBWGKDk4O 'Microsoft.Resources/roleAssignments@2022-04-01' = {
resource roleAssignment_ZBWGKDk4O 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: storageAccount_YRiDhR43q
name: guid('storageAccount_YRiDhR43q', '00000000-0000-0000-0000-000000000000', subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'))
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource storageAccount_melvnlpF2 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource storageAccount_YRiDhR43q 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource storageAccount_melvnlpF2 'Microsoft.Storage/storageAccounts@2022-09-01'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
kind: 'BlockBlobStorage'
properties: {
}
}
Expand Down

0 comments on commit 344ae86

Please sign in to comment.