Skip to content

Commit

Permalink
Throw error if both principal-id and principal-name are used
Browse files Browse the repository at this point in the history
  • Loading branch information
wbreza committed Jul 13, 2023
1 parent 787a284 commit 6fcb301
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/azd/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## 1.1.1 (Unreleased)

### Features Added

- [[2521]](https://github.com/Azure/azure-dev/pull/2521) Support `--principal-id` param for azd pipeline config to reuse existing service principal

## 1.1.0 (2023-07-12)

### Features Added
Expand Down
5 changes: 5 additions & 0 deletions cli/azd/pkg/pipeline/pipeline_manager.go
Expand Up @@ -147,6 +147,11 @@ func (pm *PipelineManager) Configure(ctx context.Context) (result *PipelineConfi
return result, fmt.Errorf("ensuring git remote: %w", err)
}

if pm.args.PipelineServicePrincipalName != "" && pm.args.PipelineServicePrincipalId != "" {
//nolint:lll
return result, fmt.Errorf("you have specified both --principal-id and --principal-name, but only one of these parameters should be used at a time.")
}

// Existing Service Principal Lookup strategy
// 1. --principal-id
// 2. --principal-name
Expand Down

0 comments on commit 6fcb301

Please sign in to comment.