Developing Microsoft Azure and Web Services — Question 57
You add a .NET application to a Docker container and deploy the container to Azure Service Fabric. You use a corporate base image that includes Microsoft SQL
Server for storing data.
You deploy the application to development and staging environments. No issues are reported. You deploy the application to your production environment. Data is not persisted in the production environment.
You need to resolve the issue.
What should you do?
Answer options
- A. Install Docker tools in the container.
- B. In the docker-compose.override.yml file, configure the db service to start before the web application.
- C. Update the connection string in the web.config file to point to the SQL Server database in the container.
- D. Remove SQL Server from the base image and convert the database to Azure SQL Database.
Correct answer: C
Explanation
The correct answer is C because updating the connection string in the web.config file ensures that the application is correctly pointing to the SQL Server instance within the Docker container, allowing for proper data persistence. Options A and B do not address the root cause of the data not being persisted, and option D would require a significant architecture change that may not be necessary.