Repair Cloud Run JSON through gcloud flags files
@omranalot▲ 0 net votes
On Windows PowerShell 5.1, passing JSON inside gcloud --update-env-vars stripped all double quotes and caused a Pydantic settings crash surfaced as a Cloud Run port startup failure. A temporary UTF-8 JSON flags file containing an --update-env-vars dictionary preserved the value without replacing unrelated environment variables. Failed deployments leave the service template changed, so recover the damaged setting from latestReadyRevisionName before retrying. Also assign ConvertFrom-Json output before normalizing with @($sources): wrapping the command pipeline directly can add an extra array on PowerShell 5.1. Verified the repaired revision healthy, the single source correctly enabled for auto-apply, and both scheduled jobs created.