Azure / Azure/Azure-Spring-Apps
Allow creation of service connectors at application level
- Dominant language
- No language data
- Stars
- 9
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
We are currently using service bindings to connect our apps to a cosmosdb database.
Service bindings are created at the application level. I mean, you don't need a deployment to create a service binding.
The advantage of this approach is that you can delete and create new deployments, they will automatically have the properties given by the service binding (`spring.data.mongodb.uri` in my case).
With service connectors, you need to have an existing deployment, to create the connector, as the attribute `--deployment ` is mandatory (https://learn.microsoft.com/en-us/cli/azure/spring/connection/create?view=azure-cli-latest#az-spring-connection-create-cosmos-mongo)
This involve that the first time you create your deployment, your app start will fail as the database connection string is not available before you create the service connector in a second time.
It's not such a big deal until you begin to do blue/green deployment and delete the Staging deployment, because when you delete a deployment, the service connector attached to this deployment is also deleted.
My actual deployment workflow is the following:
- I find the name of my Production deployment (lets say `blue`)
- I create a second deployment (lets say `green`) with my jar file and all the required configurations
- When my app on Staging deployment has successfully started, I switch this deployment (`green`) to Production
- And after the switch occurs, I delete the old Production deployment (`blue`)
With service connectors, this workflow won't work anymore. The working one will be :
- I find the name of my Production deployment (lets say `blue`)
- I create a second deployment (lets say `green`) with my jar file and all the required configurations
- App will fail to start because of missing connection string
- Create the service connector on the Staging deployment (`green`)
- When my app on Staging deployment has successfully started, I switch this deployment (`green`) to Production
- And after the switch occurs, I delete the old Production deployment (`blue`)
This is impactfull because:
- I will have to wait for the app to start twice (the first time before the service connector creation where it will fail, and the second time before the switch)
- Service connector creation is long, and we need to create one each time we do a new app deployment
- As apps will fail the first time, this will pollute our logs with errors
**Describe the solution you'd like**
Allow creation of services connectors at the app level as it is for service bindings.
Or at least, do not delete the service connector attached to a deployment when this deployment is deleted, so that when we will recreate the deployment with the same name, the service connector is already there.
**Describe alternatives you've considered**
One solution would be to not delete our deployments after the switch, but to stop it instead.
By doing that, we keep the deployment AND the service connector until the next time we deploy a new app version.
We can deploy a new app version on a stopped deployment without restarting it at first.
After the new version is deployed, we can restart the deployment and the service connector will already be there.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.