Hello Tim-1841,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
For consistent and version-controlled configurations, editing Kubernetes deployments directly using kubectl edit is a quick way to make changes, but it’s not always the best practice for long-term management. To properly edit existing Kubernetes deployments, it’s recommended to use declarative configuration with YAML files and apply changes using kubectl apply -f <file.yaml>, or use commands like kubectl set and kubectl patch for specific updates - for more details - https://www.baeldung.com/ops/kubernetes-edit-deployment-no-manual-change and https://linuxhandbook.com/edit-kubernetes-deployment/
For modifying environment variables in Azure IoT Operations, you can update the deployment manifest file and apply it, or use the Azure portal to set environment variables for Edge modules using kubectl apply -f <file.yaml> - for more details - https://github.com/Azure/iotedge/blob/main/doc/EnvironmentVariables.md
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.