Skip to content
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

Fix azd-pipeline-config for terraform forced client secret) #4295

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/azd/pkg/pipeline/azdo_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,10 @@ func (p *AzdoCiProvider) configureConnection(
repoDetails *gitRepositoryDetails,
provisioningProvider provisioning.Options,
servicePrincipal *graphsdk.ServicePrincipal,
authType PipelineAuthType,
credentialOptions *CredentialOptions,
credentials *entraid.AzureCredentials,
) error {
if authType == "" || authType == AuthTypeFederated {
if credentialOptions.EnableFederatedCredentials {
// default and federated credentials are set up in credentialOptions
return nil
}
Expand Down
9 changes: 2 additions & 7 deletions cli/azd/pkg/pipeline/github_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,11 @@ func (p *GitHubCiProvider) configureConnection(
repoDetails *gitRepositoryDetails,
infraOptions provisioning.Options,
servicePrincipal *graphsdk.ServicePrincipal,
authType PipelineAuthType,
credentialOptions *CredentialOptions,
credentials *entraid.AzureCredentials,
) error {
// Default auth type to client-credentials for terraform
if infraOptions.Provider == provisioning.Terraform && authType == "" {
authType = AuthTypeClientCredentials
}

repoSlug := repoDetails.owner + "/" + repoDetails.repoName
if authType == AuthTypeClientCredentials {
if credentialOptions.EnableClientCredentials {
err := p.configureClientCredentialsAuth(ctx, infraOptions, repoSlug, credentials)
if err != nil {
return fmt.Errorf("configuring client credentials auth: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion cli/azd/pkg/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type CiProvider interface {
gitRepo *gitRepositoryDetails,
provisioningProvider provisioning.Options,
servicePrincipal *graphsdk.ServicePrincipal,
authType PipelineAuthType,
credentialOptions *CredentialOptions,
credentials *entraid.AzureCredentials,
) error
// Gets the credential options that should be configured for the provider
Expand Down
2 changes: 1 addition & 1 deletion cli/azd/pkg/pipeline/pipeline_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (pm *PipelineManager) Configure(ctx context.Context, projectName string) (r
gitRepoInfo,
infra.Options,
servicePrincipal,
PipelineAuthType(pm.args.PipelineAuthTypeName),
credentialOptions,
credentials,
)

Expand Down
Loading