Support both password and passwordless auth type for PostgreSQL and MySQL#6
Conversation
| } | ||
|
|
||
| authType := scaffold.AuthType(0) | ||
| selection, err := i.console.Select(ctx, input.ConsoleOptions{ |
There was a problem hiding this comment.
@saragluna, With this method, customer can choose with ⬆️ and ⬇️ in keyboard. This method is copied from here:
If you agree, I'm willing to convert Service Bus to this method. Here is current method in Service Bus:
| } | ||
| {{- end}} | ||
| {{- if .DbMySql}} | ||
| {{- if (and .DbPostgres .DbPostgres.AuthUsingManagedIdentity)}} |
There was a problem hiding this comment.
FYI: I changed the order of MySQL and PostgreSQL here: Always keep PostgreSQL on top of MySQL in all related fragments.
| azCliVersion: '2.63.0' | ||
| timeout: 'PT10M' | ||
| scriptContent: 'apk update; apk add g++; apk add unixodbc-dev; az extension add --name containerapp; az extension add --name serviceconnector-passwordless --upgrade; az containerapp connection create postgres-flexible --connection appLinkToPostgres --source-id ${app.id} --target-id ${postgresDatabaseId} --client-type springBoot --user-identity client-id=${identity.properties.clientId} subs-id=${subscription().subscriptionId} user-object-id=${linkerCreatorIdentity.properties.principalId} -c main --yes; az tag create --resource-id ${app.id} --tags azd-service-name={{.Name}} ' | ||
| scriptContent: 'apk update; apk add g++; apk add unixodbc-dev; az extension add --name containerapp; az extension add --name serviceconnector-passwordless --upgrade; az containerapp connection create mysql-flexible --connection appLinkToMySql --source-id ${app.id} --target-id ${mysqlDatabaseId} --client-type springBoot --user-identity client-id=${identity.properties.clientId} subs-id=${subscription().subscriptionId} user-object-id=${linkerCreatorIdentity.properties.principalId} mysql-identity-id=${mysqlIdentityName} -c main --yes;' |
There was a problem hiding this comment.
Align PostgreSQL and MySQL, I deleted az tag create here. I tested, there is no problem. If tag problem happens again, we add it in both PostgreSQL and MySQL.
| {{- end}} | ||
|
|
||
| {{- if (and .AzureServiceBus .AzureServiceBus.AuthUsingManagedIdentity) }} | ||
|
|
There was a problem hiding this comment.
FYI: The empty line will be kept in the generated bicep file only when the empty line put after fragment like {{-if.
| } | ||
| } | ||
| {{- end}} | ||
|
|
There was a problem hiding this comment.
The empty line will be deleted in the generated bicep file.
| scope: rg | ||
| } | ||
| {{- if (or (or (or .DbCosmosMongo .DbPostgres) .DbMySql) (and .AzureServiceBus .AzureServiceBus.AuthUsingConnectionString))}})))}} | ||
| {{- if (or (or (or .DbCosmosMongo .DbPostgres) .DbMySql) (and .AzureServiceBus .AzureServiceBus.AuthUsingConnectionString))}} |
There was a problem hiding this comment.
@saragluna . FYI: This is a bug. I fixed it in here.
| selection, err := i.console.Select(ctx, input.ConsoleOptions{ | ||
| Message: "Input the authentication type you want for database:", | ||
| Options: []string{ | ||
| "Use user assigned managed identity", |
There was a problem hiding this comment.
FYI: Set Use user assigned managed identity as the first option.



Support both password and passwordless auth type for PostgreSQL and MySQL
Project used to verify this PR: