{"record":{"id":"5c87e37f4add3ee4","repo":"cube-js/cube","slug":"unsupported-exportbucket-configuration-some-keys","errorCode":null,"errorMessage":"Unsupported exportBucket configuration, some keys are empty: integrationName|sasToken","messagePattern":"Unsupported exportBucket configuration, some keys are empty: integrationName\\|sasToken","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts","lineNumber":312,"sourceCode":"\n    if (bucketType === 'gcs') {\n      // integrationName is required for gcs as the only possible way in snowflake\n      return {\n        bucketType,\n        bucketName: getEnv('dbExportBucket', { dataSource, preAggregations }),\n        integrationName: getEnv('dbExportIntegration', { dataSource, preAggregations }),\n        credentials: getEnv('dbExportGCSCredentials', { dataSource, preAggregations }),\n      };\n    }\n\n    if (bucketType === 'azure') {\n      // integrationName is optional for azure\n      const integrationName = getEnv('dbExportIntegration', { dataSource, preAggregations });\n      // sasToken is optional for azure if storage integration is used\n      const sasToken = getEnv('dbExportAzureSasToken', { dataSource, preAggregations });\n\n      if (!integrationName && !sasToken) {\n        throw new Error(\n          'Unsupported exportBucket configuration, some keys are empty: integrationName|sasToken'\n        );\n      }\n\n      // azureKey is optional if DefaultAzureCredential() is used\n      const azureKey = getEnv('dbExportBucketAzureKey', { dataSource, preAggregations });\n\n      // These 3 options make sense in case you want to authorize to Azure from\n      // application running in the k8s environment.\n      const clientId = getEnv('dbExportBucketAzureClientId', { dataSource, preAggregations });\n      const tenantId = getEnv('dbExportBucketAzureTenantId', { dataSource, preAggregations });\n      const tokenFilePath = getEnv('dbExportBucketAzureTokenFilePAth', { dataSource, preAggregations });\n\n      return {\n        bucketType,\n        bucketName: getEnv('dbExportBucket', { dataSource, preAggregations }),\n        ...(integrationName !== undefined && { integrationName }),\n        ...(sasToken !== undefined && { sasToken }),","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts#L294-L330","documentation":"When configuring a Snowflake export bucket for Azure storage, the driver requires either a storage integration name (dbExportIntegration) or a SAS token (dbExportAzureSasToken); both were empty, so the bucket config is unsupported. For Azure, integrationName and sasToken are each optional, but at least one must be present.","triggerScenarios":"Setting EXPORT_BUCKET_TYPE=azure (CUBEJS_DB_EXPORT_BUCKET_TYPE) for Snowflake pre-aggregation exports without setting CUBEJS_DB_EXPORT_INTEGRATION or CUBEJS_DB_EXPORT_AZURE_SAS_TOKEN.","commonSituations":"Copying an S3/GCS export-bucket env template to Azure and only setting bucket/container names; forgetting the storage integration created in Snowflake; SAS token expired/removed from env leaving both keys empty.","solutions":["Set CUBEJS_DB_EXPORT_INTEGRATION to your Snowflake Azure storage integration name, or","Set CUBEJS_DB_EXPORT_AZURE_SAS_TOKEN with a valid SAS token","Create the storage integration in Snowflake (CREATE STORAGE INTEGRATION) and grant the container access if you don't have one","Double-check the exact env var names and that they're loaded into the server process"],"exampleFix":"# before\nCUBEJS_DB_EXPORT_BUCKET_TYPE=azure\nCUBEJS_DB_EXPORT_BUCKET=mycontainer\n\n# after\nCUBEJS_DB_EXPORT_BUCKET_TYPE=azure\nCUBEJS_DB_EXPORT_BUCKET=mycontainer\nCUBEJS_DB_EXPORT_INTEGRATION=AZURE_STORAGE_INTEGRATION","handlingStrategy":"validation","validationCode":"const bucketType = process.env.CUBEJS_DB_EXPORT_BUCKET_TYPE;\nif (bucketType === 'azure') {\n  const integration = process.env.CUBEJS_DB_EXPORT_INTEGRATION;\n  const sasToken = process.env.CUBEJS_DB_EXPORT_AZURE_SAS_TOKEN;\n  if (!integration && !sasToken) {\n    throw new Error('Azure export bucket requires CUBEJS_DB_EXPORT_INTEGRATION or CUBEJS_DB_EXPORT_AZURE_SAS_TOKEN');\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  driver.exportBucket({ /* ... */ });\n} catch (e) {\n  if (e.message.includes('integrationName|sasToken')) {\n    console.error('Set dbExportIntegration or dbExportAzureSasToken for Azure export buckets');\n  }\n  throw e;\n}","preventionTips":["Maintain an env-var checklist per cloud (S3/GCS/Azure) for export buckets","Create and reference a Snowflake storage integration for Azure rather than SAS tokens (which expire)","Validate all CUBEJS_DB_EXPORT_* vars in a startup script","Keep templates per cloud provider instead of a shared generic one"],"tags":["snowflake","export-bucket","azure","missing-env-var"],"backgroundTag":"missing-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}