# Automated deployment and replacement of Scoring Code in Snowflake
URL: https://docs.datarobot.com/en/docs/classic-ui/mlops/mlops-preview/pp-snowflake-sc-deploy-replace.html

> Create a DataRobot-managed Snowflake prediction environment to deploy and replace DataRobot Scoring Code in Snowflake.

# Automated deployment and replacement of Scoring Code in Snowflake

> [!NOTE] Preview
> Automated deployment and replacement of Scoring Code in Snowflake is off by default. Contact your DataRobot representative or administrator for information on enabling this feature.
> 
> Feature flag: Enable the Automated Deployment and Replacement of Scoring Code in Snowflake

Now available for preview, you can create a DataRobot-managed Snowflake prediction environment to deploy DataRobot Scoring Code in Snowflake. With DataRobot management enabled, the external Snowflake deployment has access to MLOps management, including automatic Scoring Code replacement.

> [!NOTE] Service health information for external models and monitoring jobs
> Service health information is unavailable for external [agent-monitored deployments](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/mlops-agent/monitoring-agent/index.html) and deployments with predictions uploaded through a [prediction monitoring job](https://docs.datarobot.com/en/docs/classic-ui/predictions/batch/pred-monitoring-jobs/index.html).

## Create a Snowflake prediction environment

To deploy a model in Snowflake, you first create a custom Snowflake prediction environment:

1. ClickDeployments>Prediction Environmentsand then clickAdd prediction environment.
2. In theAdd prediction environmentdialog box, configure the prediction environment settings:
3. After you configure the environment settings, clickAdd environment. The Snowflake environment is now available from thePrediction Environmentspage.

## Deploy a model to the Snowflake prediction environment

Once you've created a Snowflake prediction environment, you can deploy a model to it:

1. ClickModel Registry > Registered Modelsand select the Scoring Code enabled model you want to deploy to the Snowflake prediction environment. TipYou can also deploy a model to your Snowflake prediction environment from theDeployments>Prediction Environmentstab by clicking+ Add new deploymentin the prediction environment.
2. On any tab in the registered model version, clickDeploy.
3. In theSelect Deployment Targetdialog box, underSelect deploy target, clickSnowflake. NoteIf you can't click the Snowflake deployment target, the selected model doesn't have Scoring Code available.
4. UnderSelect prediction environment, select the Snowflake prediction environment you added, and then clickConfirm.
5. Configure the deployment, and then clickDeploy model.
6. Once the model is deployed to Snowflake, you can use theScore your datacode snippet from thePredictions > Portable Predictionstab to score data in Snowflake.

## Restart a Snowflake prediction environment

When you update database settings or credentials for the Snowflake data connection used by the prediction environment, you can restart the environment to apply those changes to the environment:

1. ClickDeployments > Prediction Environmentspage, and then select the Snowflake prediction environment from the list.
2. Below the prediction environment settings, underService Account, clickRestart Environment.

---
