diff --git a/.github/workflows/gencheck.yaml b/.github/workflows/gencheck.yaml deleted file mode 100644 index f591c5400e88..000000000000 --- a/.github/workflows/gencheck.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Generation Check - -permissions: - contents: read - -on: - pull_request: - types: ['opened', 'synchronize'] - paths: - - '.github/workflows/gencheck.yaml' - - '**.go' - -concurrency: - group: 'gencheck-${{ github.head_ref }}' - cancel-in-progress: true - -jobs: - gencheck: - runs-on: [custom, linux, large] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: ./.go-version - - run: bash scripts/gogetcookie.sh - - run: make gencheck diff --git a/.github/workflows/golint.yaml b/.github/workflows/golint.yaml deleted file mode 100644 index c1d3db31308a..000000000000 --- a/.github/workflows/golint.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: GoLang Linting - -permissions: - contents: read - -on: - pull_request: - types: ['opened', 'synchronize'] - paths: - - '.github/workflows/golint.yaml' - - 'vendor/**' - - '**.go' - -concurrency: - group: 'golint-${{ github.head_ref }}' - cancel-in-progress: true - -jobs: - golint: - runs-on: [custom, linux, large] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: ./.go-version - - uses: golangci/golangci-lint-action@v3 - with: - version: 'v1.50.1' - args: -v diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml deleted file mode 100644 index a1a46503acdb..000000000000 --- a/.github/workflows/unit-test.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Unit Tests - -permissions: - contents: read - pull-requests: read - -on: - pull_request: - types: ['opened', 'synchronize'] - paths: - - '.github/workflows/unit-test.yaml' - - 'vendor/**' - - '**.go' - -concurrency: - group: 'unit-${{ github.head_ref }}' - cancel-in-progress: true - -jobs: - test: - runs-on: [custom, linux, large] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: ./.go-version - - run: bash scripts/gogetcookie.sh - - run: make test - env: - GITHUB_ACTIONS_STAGE: "UNIT_TESTS" diff --git a/.github/workflows/validate-examples.yaml b/.github/workflows/validate-examples.yaml deleted file mode 100644 index 30d1a2b8f836..000000000000 --- a/.github/workflows/validate-examples.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Validate Examples - -permissions: - contents: read - pull-requests: read - -on: - pull_request: - types: ['opened', 'synchronize'] - paths: - - '.github/workflows/validate-examples.yaml' - - 'examples/**' - -concurrency: - group: 'examples-${{ github.head_ref }}' - cancel-in-progress: true - -jobs: - website-lint: - runs-on: [custom, linux, large] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version-file: ./.go-version - - run: bash scripts/gogetcookie.sh - - run: make tools - - run: make validate-examples diff --git a/internal/services/authorization/parse/role_assignment.go b/internal/services/authorization/parse/role_assignment.go index 5a0c67139d05..ade2c8460a01 100644 --- a/internal/services/authorization/parse/role_assignment.go +++ b/internal/services/authorization/parse/role_assignment.go @@ -146,6 +146,15 @@ func RoleAssignmentID(input string) (*RoleAssignmentId, error) { } roleAssignmentId.Name = idParts[1] roleAssignmentId.ManagementGroup = strings.TrimPrefix(idParts[0], "/providers/Microsoft.Management/managementGroups/") + case strings.HasPrefix(input, "/providers/Microsoft.Authorization/"): + idParts := strings.Split(input, "/providers/Microsoft.Authorization/roleAssignments/") + if len(idParts) != 2 { + return nil, fmt.Errorf("could not parse Role Assignment ID %q for Authorization", input) + } + if idParts[1] == "" { + return nil, fmt.Errorf("ID was missing a value for the roleAssignments element") + } + roleAssignmentId.Name = idParts[1] default: return nil, fmt.Errorf("could not parse Role Assignment ID %q", input) } diff --git a/internal/services/authorization/parse/role_assignment_test.go b/internal/services/authorization/parse/role_assignment_test.go index 01b2b8d03230..fc910aa3491f 100644 --- a/internal/services/authorization/parse/role_assignment_test.go +++ b/internal/services/authorization/parse/role_assignment_test.go @@ -233,6 +233,20 @@ func TestRoleAssignmentID(t *testing.T) { TenantId: "34567812-3456-7653-6742-345678901234", }, }, + { + // valid Role Assignment value at the Authorization scope + Input: "/providers/Microsoft.Authorization/roleAssignments/115ee65a-a72f-4ade-bc87-21fc046e54e6", + Expected: &RoleAssignmentId{ + SubscriptionID: "", + ResourceGroup: "", + ManagementGroup: "", + ResourceScope: "", + ResourceProvider: "", + Name: "115ee65a-a72f-4ade-bc87-21fc046e54e6", + TenantId: "", + IsSubscriptionLevel: false, + }, + }, } for _, v := range testData {