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

Delete password check when using managed identity as auth type #65

Merged
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
1 change: 0 additions & 1 deletion cli/azd/internal/appdetect/appdetect.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ type Metadata struct {
ContainsDependencySpringCloudAzureStarter bool
ContainsDependencySpringCloudAzureStarterJdbcPostgresql bool
ContainsDependencySpringCloudAzureStarterJdbcMysql bool
ContainsPropertySpringDatasourcePassword bool
ContainsDependencySpringCloudEurekaServer bool
ContainsDependencySpringCloudEurekaClient bool
ContainsDependencySpringCloudConfigServer bool
Expand Down
9 changes: 0 additions & 9 deletions cli/azd/internal/appdetect/spring_boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func detectMetadata(azdProject *Project, springBootProject *SpringBootProject) {
detectDependencySpringCloudAzureStarterJdbcMysql(azdProject, springBootProject)
detectDependencySpringCloudEureka(azdProject, springBootProject)
detectDependencySpringCloudConfig(azdProject, springBootProject)
detectPropertySpringDatasourcePassword(azdProject, springBootProject)
detectPropertySpringApplicationName(azdProject, springBootProject)
}

Expand Down Expand Up @@ -286,14 +285,6 @@ func detectDependencySpringCloudAzureStarterJdbcMysql(azdProject *Project, sprin
}
}

func detectPropertySpringDatasourcePassword(azdProject *Project, springBootProject *SpringBootProject) {
var targetProperty = "spring.datasource.password"
if _, ok := springBootProject.applicationProperties[targetProperty]; ok {
azdProject.Metadata.ContainsPropertySpringDatasourcePassword = true
logMetadataUpdated("ContainsPropertySpringDatasourcePassword = true")
}
}

func detectPropertySpringApplicationName(azdProject *Project, springBootProject *SpringBootProject) {
var targetSpringAppName = "spring.application.name"
if appName, ok := springBootProject.applicationProperties[targetSpringAppName]; ok {
Expand Down
9 changes: 1 addition & 8 deletions cli/azd/internal/repository/app_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,7 @@ func checkPasswordlessConfigurationAndContinueProvision(database appdetect.Datab
return true, nil
}
for i, prj := range detect.Services {
if prj.Language == appdetect.Java &&
(!prj.Metadata.ContainsDependencySpringCloudAzureStarter ||
prj.Metadata.ContainsPropertySpringDatasourcePassword) {
if prj.Language == appdetect.Java && !prj.Metadata.ContainsDependencySpringCloudAzureStarter {
message := fmt.Sprintf("You selected %s as auth type for %s.",
internal.AuthTypeUserAssignedManagedIdentity, database)
if database == appdetect.DbPostgres && !prj.Metadata.ContainsDependencySpringCloudAzureStarterJdbcPostgresql {
Expand All @@ -822,11 +820,6 @@ func checkPasswordlessConfigurationAndContinueProvision(database appdetect.Datab
"'com.azure.spring:spring-cloud-azure-starter-jdbc-mysql'. "+
"But this dependency is not found in your project: %s.", message, prj.Path)
}
if prj.Metadata.ContainsPropertySpringDatasourcePassword {
message = fmt.Sprintf("%s This property should be deleted: "+
"'spring.datasource.password'. "+
"But this property is found in your project: %s.", message, prj.Path)
}
continueOption, err := console.Select(ctx, input.ConsoleOptions{
Message: fmt.Sprintf("%s Select an option:", message),
Options: []string{
Expand Down
Loading