# Automated deployment and replacement of Scoring Code in Snowflake
URL: https://docs.datarobot.com/en/docs/workbench/nxt-console/nxt-prediction-environments/nxt-prediction-environment-integrations/nxt-snowflake-pred-env-integration.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] Availability information
> 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

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/workbench/nxt-console/nxt-monitoring/nxt-monitoring-jobs.html).

## Create a Snowflake prediction environment

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

1. Open theConsole > Prediction environmentspage and click+ Add prediction environment.
2. In theAdd prediction environmentdialog box, configure the prediction environment settings: TheSupported Model Formatssettings are automatically set toDataRobot Scoring Codeand can't be changed, as this is the only model format supported by Snowflake.
3. In theManagement settingssection, select aData Connectionand the relatedCredentials, and then select the SnowflakeSchemas. Snowflake schemas are collections of Snowflake tables. Snowflake credentials requiredDataRobot management of Scoring Code in Snowflake requires an existingData Connectionto Snowflake with storedCredentials. If you don't have an existing Snowflake data connection, theNo Data Connections foundalert appears, directing you toGo to Data Connectionstocreate a Snowflake connection.
4. After you configure the environment settings, clickAdd environment.

## Deploy a model to the Snowflake prediction environment

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

1. On theRegistry > Modelstab, in the table of registered models, click the registered model containing the version you want to deploy, opening the list of versions. Model supportSnowflake prediction environmentsdo notsupport models without Scoring Code support.
2. From the list of versions, click the Scoring Code enabled version you want to deploy, opening the registered model version panel.
3. In the upper-right corner of any tab in the registered model version panel, clickDeploy.
4. In thePrediction history and service healthsettings, underChoose prediction environment, clickChange.
5. In theSelect prediction environmentpanel, clickSnowflake, and then click the prediction environment you want to deploy to.
6. (Optional) Open theAdvanced environment settingsand define additionalEnvironment key-value pairsto provide extra parameters to the Snowflake deployment interface.
7. Configure the remaining deployment settings, and then clickDeploy model.

Once the model is deployed to Snowflake, you can use the code snippet from the Predictions > Portable predictions tab 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, 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.

---
