AZURE_STORAGE_ACCOUNT="YOUR AZURE STORAGE ACCOUNT NAME"AZURE_STORAGE_ACCESS_KEY="AZURE STORAGE ACCOUNT ACCESS KEY"DR_CREDENTIAL_NAME=f"Azure_{AZURE_STORAGE_ACCOUNT}"# Create an Azure-specific Credential# The connection string is also found below the access key in Azure if you want to copy that directly.credential=dr.Credential.create_azure(name=DR_CREDENTIAL_NAME,azure_connection_string=f"DefaultEndpointsProtocol=https;AccountName={AZURE_STORAGE_ACCOUNT};AccountKey={AZURE_STORAGE_ACCESS_KEY};")# Use this code to look up the ID of the credential object created.credential_id=Noneforcredindr.Credential.list():ifcred.name==DR_CREDENTIAL_NAME:credential_id=cred.credential_idbreakprint(credential_id)
DEPLOYMENT_ID='YOUR DEPLOYMENT ID'AZURE_STORAGE_ACCOUNT="YOUR AZURE STORAGE ACCOUNT NAME"AZURE_STORAGE_CONTAINER="YOUR AZURE STORAGE ACCOUNT CONTAINER"AZURE_INPUT_SCORING_FILE="YOUR INPUT SCORING FILE NAME"AZURE_OUTPUT_RESULTS_FILE="YOUR OUTPUT RESULTS FILE NAME"# Set up your batch prediction job# Input: Azure Blob Storage# Output: Azure Blob Storagejob=dr.BatchPredictionJob.score(deployment=DEPLOYMENT_ID,intake_settings={'type':'azure','url':f"https://{AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/{AZURE_STORAGE_CONTAINER}/{AZURE_INPUT_SCORING_FILE}","credential_id":credential_id},output_settings={'type':'azure','url':"https://{AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/{AZURE_STORAGE_CONTAINER}/{AZURE_OUTPUT_RESULTS_FILE}","credential_id":credential_id},# If explanations are required, uncomment the line belowmax_explanations=5,# If passthrough columns are required, use this linepassthrough_columns=['column1','column2'])job.wait_for_completion()job.get_status()