-
Notifications
You must be signed in to change notification settings - Fork 1
Knowledge Sharing
According to this page: Migrate an application to use passwordless connections with Azure Database for MySQL, after service connector created, it is still necessary to create a Microsoft Entra user for the managed identity and grant all permissions for the database. But the Microsoft.ServiceLinker/linkers can only be used to create service-connector, it can not create user in the DB.
When use Azure CLI command to create service-connector, it will create the required Microsoft Entra user in DB at the same time. And the bicep can use Microsoft.Resources/deploymentScripts to run the Azure CLI command. Here is an example PR.
Microsoft.Resources/deploymentScripts
will only take effect for the first time. If
run azd up
for the second time, it will not run again because there is no change comparing to exist resources.
- Add
forceUpdateTag
inMicrosoft.Resources/deploymentScripts
. Here is an example commit. - Use
runOnce
in avm/res/resources/deployment-script
For example: For property spring.cloud.azure.eventhubs.connection-string
, SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING
will take effect. But for property spring.cloud.azure.eventhubs.processor.checkpoint-store.connection-string
,
SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTION_STRING
will not take effect.
Change environment variable to one of the following options:
- Option 1:
SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIONSTRING
. This option removed all-
in original property. - Option 2:
SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINT_STORE_CONNECTION_STRING
. This option changed all-
in original property to_
. - Option 3: Use
spring.cloud.azure.eventhubs.connection-string
as environment variable name. It's suggested to use UPPER_CASE_WITH_UNDER_SCORE as environment name, but lower-case-with-dash is also supported. Service connector is using lower-case-with-dash now. In SJAD, we adopt this option.
Option 1 is suggested according to Spring Boot's doc. And option 2 is legacy option which is supported now (In spring-boot:3.3), not sure if it will support forever.