diff --git a/sdk/storage/storage-blob/samples/javascript/advanced.js b/sdk/storage/storage-blob/samples/javascript/advanced.js index b7d8ef450330..b1128a4090ee 100644 --- a/sdk/storage/storage-blob/samples/javascript/advanced.js +++ b/sdk/storage/storage-blob/samples/javascript/advanced.js @@ -36,9 +36,9 @@ class ConsoleHttpPipelineLogger { async function main() { // Fill in following settings before running this sample - const account = ""; - const accountSas = ""; - const localFilePath = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; + const localFilePath = "../README.md"; const pipeline = newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface diff --git a/sdk/storage/storage-blob/samples/javascript/anonymousCred.js b/sdk/storage/storage-blob/samples/javascript/anonymousCred.js index 58c9fc5794ca..841487358300 100644 --- a/sdk/storage/storage-blob/samples/javascript/anonymousCred.js +++ b/sdk/storage/storage-blob/samples/javascript/anonymousCred.js @@ -6,8 +6,8 @@ const { BlobServiceClient, AnonymousCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-blob/samples/javascript/azureAdAuth.js b/sdk/storage/storage-blob/samples/javascript/azureAdAuth.js index 667a11431ad2..2f2d81db6808 100644 --- a/sdk/storage/storage-blob/samples/javascript/azureAdAuth.js +++ b/sdk/storage/storage-blob/samples/javascript/azureAdAuth.js @@ -23,7 +23,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function main() { // Enter your storage account name - const account = ""; + const account = process.env.ACCOUNT_NAME || ""; // ONLY AVAILABLE IN NODE.JS RUNTIME // DefaultAzureCredential will first look for Azure Active Directory (AAD) diff --git a/sdk/storage/storage-blob/samples/javascript/basic.js b/sdk/storage/storage-blob/samples/javascript/basic.js index 872697e62866..1af7f736c0f7 100644 --- a/sdk/storage/storage-blob/samples/javascript/basic.js +++ b/sdk/storage/storage-blob/samples/javascript/basic.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/customPipeline.js b/sdk/storage/storage-blob/samples/javascript/customPipeline.js index 3b83cd836974..84e29f94b315 100644 --- a/sdk/storage/storage-blob/samples/javascript/customPipeline.js +++ b/sdk/storage/storage-blob/samples/javascript/customPipeline.js @@ -34,8 +34,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/customizedClientHeaders.js b/sdk/storage/storage-blob/samples/javascript/customizedClientHeaders.js index 5ad2342874d7..fac8327993b9 100644 --- a/sdk/storage/storage-blob/samples/javascript/customizedClientHeaders.js +++ b/sdk/storage/storage-blob/samples/javascript/customizedClientHeaders.js @@ -51,8 +51,8 @@ class RequestIDPolicy extends BaseRequestPolicy { // Main function async function main() { - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Create a default pipeline with newPipeline const pipeline = newPipeline(new AnonymousCredential()); diff --git a/sdk/storage/storage-blob/samples/javascript/iterators-blobs-hierarchy.js b/sdk/storage/storage-blob/samples/javascript/iterators-blobs-hierarchy.js index fff1648958cc..074aed2d747d 100644 --- a/sdk/storage/storage-blob/samples/javascript/iterators-blobs-hierarchy.js +++ b/sdk/storage/storage-blob/samples/javascript/iterators-blobs-hierarchy.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/iterators-blobs.js b/sdk/storage/storage-blob/samples/javascript/iterators-blobs.js index 95ee31eb5363..f3d9d121ec11 100644 --- a/sdk/storage/storage-blob/samples/javascript/iterators-blobs.js +++ b/sdk/storage/storage-blob/samples/javascript/iterators-blobs.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers @@ -106,7 +106,7 @@ async function main() { console.log(`Blob ${i++}: ${blob.name}`); } // Gets next marker - console.log("\tContinuation") + console.log("\tContinuation"); let marker = response.value.nextMarker; // Passing next marker as continuationToken iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); diff --git a/sdk/storage/storage-blob/samples/javascript/iterators-containers.js b/sdk/storage/storage-blob/samples/javascript/iterators-containers.js index aaae7873a2b3..2db8f62c1e72 100644 --- a/sdk/storage/storage-blob/samples/javascript/iterators-containers.js +++ b/sdk/storage/storage-blob/samples/javascript/iterators-containers.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/proxyAuth.js b/sdk/storage/storage-blob/samples/javascript/proxyAuth.js index 6b2003915718..20f13bca37d0 100644 --- a/sdk/storage/storage-blob/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-blob/samples/javascript/proxyAuth.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/readingSnapshot.js b/sdk/storage/storage-blob/samples/javascript/readingSnapshot.js index 3a5ebf0fba49..76075ff9cc3a 100644 --- a/sdk/storage/storage-blob/samples/javascript/readingSnapshot.js +++ b/sdk/storage/storage-blob/samples/javascript/readingSnapshot.js @@ -22,8 +22,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/sharedKeyCred.js b/sdk/storage/storage-blob/samples/javascript/sharedKeyCred.js index 3e7fe5c51d6f..a5e38295a9e7 100644 --- a/sdk/storage/storage-blob/samples/javascript/sharedKeyCred.js +++ b/sdk/storage/storage-blob/samples/javascript/sharedKeyCred.js @@ -6,8 +6,8 @@ const { BlobServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/javascript/withConnString.js b/sdk/storage/storage-blob/samples/javascript/withConnString.js index 076f7c3dbd3e..08ebb18c5fa2 100644 --- a/sdk/storage/storage-blob/samples/javascript/withConnString.js +++ b/sdk/storage/storage-blob/samples/javascript/withConnString.js @@ -8,7 +8,7 @@ async function main() { // Create Blob Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const blobServiceClient = BlobServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING); diff --git a/sdk/storage/storage-blob/samples/typescript/advanced.ts b/sdk/storage/storage-blob/samples/typescript/advanced.ts index ff252f3f5fa8..daa6c9b7014f 100644 --- a/sdk/storage/storage-blob/samples/typescript/advanced.ts +++ b/sdk/storage/storage-blob/samples/typescript/advanced.ts @@ -37,9 +37,9 @@ class ConsoleHttpPipelineLogger { async function main() { // Fill in following settings before running this sample - const account = ""; - const accountSas = ""; - const localFilePath = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; + const localFilePath = "../README.md"; const pipeline = newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface diff --git a/sdk/storage/storage-blob/samples/typescript/anonymousCred.ts b/sdk/storage/storage-blob/samples/typescript/anonymousCred.ts index f82353233057..8ebebe23b097 100644 --- a/sdk/storage/storage-blob/samples/typescript/anonymousCred.ts +++ b/sdk/storage/storage-blob/samples/typescript/anonymousCred.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, AnonymousCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-blob/samples/typescript/azureAdAuth.ts b/sdk/storage/storage-blob/samples/typescript/azureAdAuth.ts index 0482b995a87a..e159ae373d70 100644 --- a/sdk/storage/storage-blob/samples/typescript/azureAdAuth.ts +++ b/sdk/storage/storage-blob/samples/typescript/azureAdAuth.ts @@ -23,7 +23,7 @@ import { DefaultAzureCredential } from "@azure/identity"; async function main() { // Enter your storage account name - const account = ""; + const account = process.env.ACCOUNT_NAME || ""; // ONLY AVAILABLE IN NODE.JS RUNTIME // DefaultAzureCredential will first look for Azure Active Directory (AAD) diff --git a/sdk/storage/storage-blob/samples/typescript/basic.ts b/sdk/storage/storage-blob/samples/typescript/basic.ts index 3a54567037c9..c33279cac756 100644 --- a/sdk/storage/storage-blob/samples/typescript/basic.ts +++ b/sdk/storage/storage-blob/samples/typescript/basic.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential, Models } from "../../src"; // C async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/customPipeline.ts b/sdk/storage/storage-blob/samples/typescript/customPipeline.ts index 5e8393ff9bf4..4d546fd5e4fa 100644 --- a/sdk/storage/storage-blob/samples/typescript/customPipeline.ts +++ b/sdk/storage/storage-blob/samples/typescript/customPipeline.ts @@ -2,7 +2,12 @@ Setup: Enter your storage account name and shared key in main() */ -import { BlobServiceClient, SharedKeyCredential, newPipeline, HttpPipelineLogLevel } from "../../src"; // Change to "@azure/storage-blob" in your package +import { + BlobServiceClient, + SharedKeyCredential, + newPipeline, + HttpPipelineLogLevel +} from "../../src"; // Change to "@azure/storage-blob" in your package class ConsoleHttpPipelineLogger { minimumLogLevel: any; @@ -30,8 +35,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/customizedClientHeaders.ts b/sdk/storage/storage-blob/samples/typescript/customizedClientHeaders.ts index 110b57bb61d9..4a6f47fb659a 100644 --- a/sdk/storage/storage-blob/samples/typescript/customizedClientHeaders.ts +++ b/sdk/storage/storage-blob/samples/typescript/customizedClientHeaders.ts @@ -61,8 +61,8 @@ class RequestIDPolicy extends BaseRequestPolicy { // Main function async function main() { - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Create a default pipeline with newPipeline const pipeline = newPipeline(new AnonymousCredential()); diff --git a/sdk/storage/storage-blob/samples/typescript/iterators-blobs-hierarchy.ts b/sdk/storage/storage-blob/samples/typescript/iterators-blobs-hierarchy.ts index 1564e0eb1639..59e6e5e6f33e 100644 --- a/sdk/storage/storage-blob/samples/typescript/iterators-blobs-hierarchy.ts +++ b/sdk/storage/storage-blob/samples/typescript/iterators-blobs-hierarchy.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/iterators-blobs.ts b/sdk/storage/storage-blob/samples/typescript/iterators-blobs.ts index fbbaeb985a98..0359c7c88acf 100644 --- a/sdk/storage/storage-blob/samples/typescript/iterators-blobs.ts +++ b/sdk/storage/storage-blob/samples/typescript/iterators-blobs.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/iterators-containers.ts b/sdk/storage/storage-blob/samples/typescript/iterators-containers.ts index de705ba89600..d825c2abeb8e 100644 --- a/sdk/storage/storage-blob/samples/typescript/iterators-containers.ts +++ b/sdk/storage/storage-blob/samples/typescript/iterators-containers.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts b/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts index e5449c1ac83b..ce1d7ce126d7 100644 --- a/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-blob/samples/typescript/proxyAuth.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/readingSnapshot.ts b/sdk/storage/storage-blob/samples/typescript/readingSnapshot.ts index 69727d7e32af..e701f5eea63e 100644 --- a/sdk/storage/storage-blob/samples/typescript/readingSnapshot.ts +++ b/sdk/storage/storage-blob/samples/typescript/readingSnapshot.ts @@ -22,8 +22,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/sharedKeyCred.ts b/sdk/storage/storage-blob/samples/typescript/sharedKeyCred.ts index fd0bfefd071a..b8a7470eb362 100644 --- a/sdk/storage/storage-blob/samples/typescript/sharedKeyCred.ts +++ b/sdk/storage/storage-blob/samples/typescript/sharedKeyCred.ts @@ -6,8 +6,8 @@ import { BlobServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-blob/samples/typescript/withConnString.ts b/sdk/storage/storage-blob/samples/typescript/withConnString.ts index 968023bf71a3..72f49ce0175f 100644 --- a/sdk/storage/storage-blob/samples/typescript/withConnString.ts +++ b/sdk/storage/storage-blob/samples/typescript/withConnString.ts @@ -8,7 +8,7 @@ async function main() { // Create Blob Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const blobServiceClient = BlobServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING); diff --git a/sdk/storage/storage-file/samples/javascript/advanced.js b/sdk/storage/storage-file/samples/javascript/advanced.js index 99df94cfb758..aba6282f9aa4 100644 --- a/sdk/storage/storage-file/samples/javascript/advanced.js +++ b/sdk/storage/storage-file/samples/javascript/advanced.js @@ -36,9 +36,9 @@ class ConsoleHttpPipelineLogger { async function main() { // Fill in following settings before running this sample - const account = ""; - const accountSas = ""; - const localFilePath = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; + const localFilePath = "../README.md"; const pipeline = newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface diff --git a/sdk/storage/storage-file/samples/javascript/anonymousCred.js b/sdk/storage/storage-file/samples/javascript/anonymousCred.js index 1edda01f856f..74c5458d5a93 100644 --- a/sdk/storage/storage-file/samples/javascript/anonymousCred.js +++ b/sdk/storage/storage-file/samples/javascript/anonymousCred.js @@ -6,8 +6,8 @@ const { FileServiceClient, AnonymousCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-file/samples/javascript/basic.js b/sdk/storage/storage-file/samples/javascript/basic.js index a42ba992fb70..036dcc075799 100644 --- a/sdk/storage/storage-file/samples/javascript/basic.js +++ b/sdk/storage/storage-file/samples/javascript/basic.js @@ -6,8 +6,8 @@ const { FileServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/customPipeline.js b/sdk/storage/storage-file/samples/javascript/customPipeline.js index 2fd67ffef414..46a4cab569c7 100644 --- a/sdk/storage/storage-file/samples/javascript/customPipeline.js +++ b/sdk/storage/storage-file/samples/javascript/customPipeline.js @@ -34,8 +34,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/iterators-files-and-directories.js b/sdk/storage/storage-file/samples/javascript/iterators-files-and-directories.js index b438879d819f..4a93413339a4 100644 --- a/sdk/storage/storage-file/samples/javascript/iterators-files-and-directories.js +++ b/sdk/storage/storage-file/samples/javascript/iterators-files-and-directories.js @@ -6,8 +6,8 @@ const { FileServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/iterators-handles.js b/sdk/storage/storage-file/samples/javascript/iterators-handles.js index d92e430306d5..b2bfb89212b3 100644 --- a/sdk/storage/storage-file/samples/javascript/iterators-handles.js +++ b/sdk/storage/storage-file/samples/javascript/iterators-handles.js @@ -10,8 +10,8 @@ async function main() { // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-mac - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; const shareName = ""; const dirName = ""; @@ -33,7 +33,9 @@ async function main() { let i = 1; let iter = dirClient.listHandles(); for await (const handle of iter) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}` + ); } console.log(`List handles directly without using iter`); @@ -41,7 +43,9 @@ async function main() { // 2. Same as the previous example i = 1; for await (const handle of dirClient.listHandles()) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}` + ); } console.log(`List handles using iter.next()`); @@ -51,7 +55,11 @@ async function main() { iter = await dirClient.listHandles(); let handleItem = await iter.next(); while (!handleItem.done) { - console.log(`Handle ${i++}: ${handleItem.value.path}, opened time ${handleItem.value.openTime}, clientIp ${handleItem.value.clientIp}`); + console.log( + `Handle ${i++}: ${handleItem.value.path}, opened time ${ + handleItem.value.openTime + }, clientIp ${handleItem.value.clientIp}` + ); handleItem = await iter.next(); } @@ -66,7 +74,11 @@ async function main() { for await (const response of dirClient.listHandles().byPage()) { if (response.handleList) { for (const handle of response.handleList) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${ + handle.clientIp + }` + ); } } } @@ -75,10 +87,16 @@ async function main() { // 5. Same as the previous example - passing maxPageSize in the page settings i = 1; - for await (const response of dirClient.listHandles({ recursive: true }).byPage({ maxPageSize: 20 })) { + for await (const response of dirClient + .listHandles({ recursive: true }) + .byPage({ maxPageSize: 20 })) { if (response.handleList) { for (const handle of response.handleList) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${ + handle.clientIp + }` + ); } } } @@ -92,7 +110,11 @@ async function main() { while (!response.done) { if (response.value.handleList) { for (const handle of response.value.handleList) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${ + handle.clientIp + }` + ); } } response = await iterator.next(); @@ -107,7 +129,9 @@ async function main() { // Prints 2 handles if (response.value.handleList) { for (const handle of response.value.handleList) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}` + ); } } // Gets next marker @@ -119,7 +143,9 @@ async function main() { // Prints 2 more handles assuming you have more than four handles if (!response.done && response.value.handleList) { for (const handle of response.value.handleList) { - console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`); + console.log( + `Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}` + ); } } } diff --git a/sdk/storage/storage-file/samples/javascript/iterators-shares.js b/sdk/storage/storage-file/samples/javascript/iterators-shares.js index 32d896aa978f..accfeeb6e4d5 100644 --- a/sdk/storage/storage-file/samples/javascript/iterators-shares.js +++ b/sdk/storage/storage-file/samples/javascript/iterators-shares.js @@ -6,8 +6,8 @@ const { FileServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/proxyAuth.js b/sdk/storage/storage-file/samples/javascript/proxyAuth.js index 520869123d3d..e4e70fb48657 100644 --- a/sdk/storage/storage-file/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-file/samples/javascript/proxyAuth.js @@ -6,8 +6,8 @@ const { FileServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/sharedKeyCred.js b/sdk/storage/storage-file/samples/javascript/sharedKeyCred.js index 1cab49587d00..671ffb221aa8 100644 --- a/sdk/storage/storage-file/samples/javascript/sharedKeyCred.js +++ b/sdk/storage/storage-file/samples/javascript/sharedKeyCred.js @@ -6,8 +6,8 @@ const { FileServiceClient, SharedKeyCredential } = require("../.."); // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/javascript/withConnString.js b/sdk/storage/storage-file/samples/javascript/withConnString.js index 2bff88634f07..781420369d24 100644 --- a/sdk/storage/storage-file/samples/javascript/withConnString.js +++ b/sdk/storage/storage-file/samples/javascript/withConnString.js @@ -8,7 +8,7 @@ async function main() { // Create File Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const serviceClient = FileServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING); diff --git a/sdk/storage/storage-file/samples/typescript/advanced.ts b/sdk/storage/storage-file/samples/typescript/advanced.ts index 4b6679c12e3f..bf90e483a979 100644 --- a/sdk/storage/storage-file/samples/typescript/advanced.ts +++ b/sdk/storage/storage-file/samples/typescript/advanced.ts @@ -37,9 +37,9 @@ class ConsoleHttpPipelineLogger { async function main() { // Fill in following settings before running this sample - const account = ""; - const accountSas = ""; - const localFilePath = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; + const localFilePath = "../README.md"; const pipeline = newPipeline(new AnonymousCredential(), { // httpClient: MyHTTPClient, // A customized HTTP client implementing IHttpClient interface diff --git a/sdk/storage/storage-file/samples/typescript/anonymousCred.ts b/sdk/storage/storage-file/samples/typescript/anonymousCred.ts index 693e6c8cab52..4cbf0d25759c 100644 --- a/sdk/storage/storage-file/samples/typescript/anonymousCred.ts +++ b/sdk/storage/storage-file/samples/typescript/anonymousCred.ts @@ -6,8 +6,8 @@ import { FileServiceClient, AnonymousCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-file/samples/typescript/basic.ts b/sdk/storage/storage-file/samples/typescript/basic.ts index c521f32b7926..34e4274c0ff6 100644 --- a/sdk/storage/storage-file/samples/typescript/basic.ts +++ b/sdk/storage/storage-file/samples/typescript/basic.ts @@ -6,8 +6,8 @@ import { FileServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/customPipeline.ts b/sdk/storage/storage-file/samples/typescript/customPipeline.ts index 7782cfebb4ac..bffe7d512280 100644 --- a/sdk/storage/storage-file/samples/typescript/customPipeline.ts +++ b/sdk/storage/storage-file/samples/typescript/customPipeline.ts @@ -2,7 +2,12 @@ Setup: Enter your storage account name and shared key in main() */ -import { newPipeline, FileServiceClient, SharedKeyCredential, HttpPipelineLogLevel } from "../../src"; // Change to "@azure/storage-file" in your package +import { + newPipeline, + FileServiceClient, + SharedKeyCredential, + HttpPipelineLogLevel +} from "../../src"; // Change to "@azure/storage-file" in your package class ConsoleHttpPipelineLogger { minimumLogLevel: any; @@ -30,8 +35,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/iterators-files-and-directories.ts b/sdk/storage/storage-file/samples/typescript/iterators-files-and-directories.ts index b52c9b7ca142..7b9f05bf218b 100644 --- a/sdk/storage/storage-file/samples/typescript/iterators-files-and-directories.ts +++ b/sdk/storage/storage-file/samples/typescript/iterators-files-and-directories.ts @@ -6,8 +6,8 @@ import { FileServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/iterators-handles.ts b/sdk/storage/storage-file/samples/typescript/iterators-handles.ts index 12dad486d0a1..0077971fc905 100644 --- a/sdk/storage/storage-file/samples/typescript/iterators-handles.ts +++ b/sdk/storage/storage-file/samples/typescript/iterators-handles.ts @@ -10,8 +10,8 @@ async function main() { // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux // https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-mac - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; const shareName = ""; const dirName = ""; diff --git a/sdk/storage/storage-file/samples/typescript/iterators-shares.ts b/sdk/storage/storage-file/samples/typescript/iterators-shares.ts index bdca70330802..d14d351a3b6b 100644 --- a/sdk/storage/storage-file/samples/typescript/iterators-shares.ts +++ b/sdk/storage/storage-file/samples/typescript/iterators-shares.ts @@ -6,8 +6,8 @@ import { FileServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/proxyAuth.ts b/sdk/storage/storage-file/samples/typescript/proxyAuth.ts index 961a7bcc7733..be1c0b44f71a 100644 --- a/sdk/storage/storage-file/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-file/samples/typescript/proxyAuth.ts @@ -6,8 +6,8 @@ import { SharedKeyCredential, FileServiceClient } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/sharedKeyCred.ts b/sdk/storage/storage-file/samples/typescript/sharedKeyCred.ts index bc094f123a41..f8e0c277f0db 100644 --- a/sdk/storage/storage-file/samples/typescript/sharedKeyCred.ts +++ b/sdk/storage/storage-file/samples/typescript/sharedKeyCred.ts @@ -6,8 +6,8 @@ import { FileServiceClient, SharedKeyCredential } from "../../src"; // Change to async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-file/samples/typescript/withConnString.ts b/sdk/storage/storage-file/samples/typescript/withConnString.ts index ba4cda720a99..283d0d38f699 100644 --- a/sdk/storage/storage-file/samples/typescript/withConnString.ts +++ b/sdk/storage/storage-file/samples/typescript/withConnString.ts @@ -8,7 +8,7 @@ async function main() { // Create File Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const serviceClient = FileServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING); diff --git a/sdk/storage/storage-queue/samples/javascript/anonymousCred.js b/sdk/storage/storage-queue/samples/javascript/anonymousCred.js index 43072b5696f6..e8a72e10ca51 100644 --- a/sdk/storage/storage-queue/samples/javascript/anonymousCred.js +++ b/sdk/storage/storage-queue/samples/javascript/anonymousCred.js @@ -6,8 +6,8 @@ const { QueueServiceClient, AnonymousCredential } = require("../.."); // Change async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-queue/samples/javascript/azureAdAuth.js b/sdk/storage/storage-queue/samples/javascript/azureAdAuth.js index 846eec3d402c..05979df93de3 100644 --- a/sdk/storage/storage-queue/samples/javascript/azureAdAuth.js +++ b/sdk/storage/storage-queue/samples/javascript/azureAdAuth.js @@ -24,7 +24,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); async function main() { // Enter your storage account name and shared key - const account = ""; + const account = process.env.ACCOUNT_NAME || ""; // ONLY AVAILABLE IN NODE.JS RUNTIME // DefaultAzureCredential will first look for Azure Active Directory (AAD) diff --git a/sdk/storage/storage-queue/samples/javascript/basic.js b/sdk/storage/storage-queue/samples/javascript/basic.js index 280d788ac854..079caefe49db 100644 --- a/sdk/storage/storage-queue/samples/javascript/basic.js +++ b/sdk/storage/storage-queue/samples/javascript/basic.js @@ -6,8 +6,8 @@ const { QueueServiceClient, SharedKeyCredential } = require("../.."); // Change async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/javascript/customPipeline.js b/sdk/storage/storage-queue/samples/javascript/customPipeline.js index 5a966dc4dc5b..dc6abce5de85 100644 --- a/sdk/storage/storage-queue/samples/javascript/customPipeline.js +++ b/sdk/storage/storage-queue/samples/javascript/customPipeline.js @@ -34,8 +34,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/javascript/iterators.js b/sdk/storage/storage-queue/samples/javascript/iterators.js index 29e19827aab2..db3ef34fb85c 100644 --- a/sdk/storage/storage-queue/samples/javascript/iterators.js +++ b/sdk/storage/storage-queue/samples/javascript/iterators.js @@ -6,8 +6,8 @@ const { QueueServiceClient, SharedKeyCredential } = require("../.."); // Change async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/javascript/proxyAuth.js b/sdk/storage/storage-queue/samples/javascript/proxyAuth.js index eca72ca78229..cbb6fa9d23c6 100644 --- a/sdk/storage/storage-queue/samples/javascript/proxyAuth.js +++ b/sdk/storage/storage-queue/samples/javascript/proxyAuth.js @@ -6,8 +6,8 @@ const { QueueServiceClient, SharedKeyCredential } = require("../.."); // Change async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/javascript/sharedKeyCred.js b/sdk/storage/storage-queue/samples/javascript/sharedKeyCred.js index 6804e9e92206..d5d9ac21fd3c 100644 --- a/sdk/storage/storage-queue/samples/javascript/sharedKeyCred.js +++ b/sdk/storage/storage-queue/samples/javascript/sharedKeyCred.js @@ -6,8 +6,8 @@ const { QueueServiceClient, SharedKeyCredential } = require("../.."); // Change async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/javascript/withConnString.js b/sdk/storage/storage-queue/samples/javascript/withConnString.js index 49be76173fa1..55d138da18ab 100644 --- a/sdk/storage/storage-queue/samples/javascript/withConnString.js +++ b/sdk/storage/storage-queue/samples/javascript/withConnString.js @@ -8,7 +8,7 @@ async function main() { // Create Queue Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const queueServiceClient = QueueServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING); diff --git a/sdk/storage/storage-queue/samples/typescript/anonymousCred.ts b/sdk/storage/storage-queue/samples/typescript/anonymousCred.ts index 4217e5d88f55..c65cb65d2f11 100644 --- a/sdk/storage/storage-queue/samples/typescript/anonymousCred.ts +++ b/sdk/storage/storage-queue/samples/typescript/anonymousCred.ts @@ -6,8 +6,8 @@ import { QueueServiceClient, AnonymousCredential } from "../../src"; // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountSas = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountSas = process.env.ACCOUNT_SAS || ""; // Use AnonymousCredential when url already includes a SAS signature const anonymousCredential = new AnonymousCredential(); diff --git a/sdk/storage/storage-queue/samples/typescript/azureAdAuth.ts b/sdk/storage/storage-queue/samples/typescript/azureAdAuth.ts index c567e1ec135b..fdebc142fd2d 100644 --- a/sdk/storage/storage-queue/samples/typescript/azureAdAuth.ts +++ b/sdk/storage/storage-queue/samples/typescript/azureAdAuth.ts @@ -24,7 +24,7 @@ import { DefaultAzureCredential } from "@azure/identity"; async function main() { // Enter your storage account name and shared key - const account = ""; + const account = process.env.ACCOUNT_NAME || ""; // ONLY AVAILABLE IN NODE.JS RUNTIME // DefaultAzureCredential will first look for Azure Active Directory (AAD) diff --git a/sdk/storage/storage-queue/samples/typescript/basic.ts b/sdk/storage/storage-queue/samples/typescript/basic.ts index 8533cc9b876d..fe0079f37b11 100644 --- a/sdk/storage/storage-queue/samples/typescript/basic.ts +++ b/sdk/storage/storage-queue/samples/typescript/basic.ts @@ -6,8 +6,8 @@ import { QueueServiceClient, SharedKeyCredential } from "../../src"; // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/typescript/customPipeline.ts b/sdk/storage/storage-queue/samples/typescript/customPipeline.ts index c52a1b349683..c745b273e511 100644 --- a/sdk/storage/storage-queue/samples/typescript/customPipeline.ts +++ b/sdk/storage/storage-queue/samples/typescript/customPipeline.ts @@ -35,8 +35,8 @@ class ConsoleHttpPipelineLogger { async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/typescript/iterators.ts b/sdk/storage/storage-queue/samples/typescript/iterators.ts index c0efcea5d15f..8991e6c2692b 100644 --- a/sdk/storage/storage-queue/samples/typescript/iterators.ts +++ b/sdk/storage/storage-queue/samples/typescript/iterators.ts @@ -6,8 +6,8 @@ import { QueueServiceClient, SharedKeyCredential } from "../../src"; // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts b/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts index cc4d9d6e41dd..1c7f16f86446 100644 --- a/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts +++ b/sdk/storage/storage-queue/samples/typescript/proxyAuth.ts @@ -6,8 +6,8 @@ import { SharedKeyCredential, QueueServiceClient } from "../../src"; // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/typescript/sharedKeyCred.ts b/sdk/storage/storage-queue/samples/typescript/sharedKeyCred.ts index c3659ede58e2..a055282194f9 100644 --- a/sdk/storage/storage-queue/samples/typescript/sharedKeyCred.ts +++ b/sdk/storage/storage-queue/samples/typescript/sharedKeyCred.ts @@ -6,8 +6,8 @@ import { QueueServiceClient, SharedKeyCredential } from "../../src"; // Change t async function main() { // Enter your storage account name and shared key - const account = ""; - const accountKey = ""; + const account = process.env.ACCOUNT_NAME || ""; + const accountKey = process.env.ACCOUNT_KEY || ""; // Use SharedKeyCredential with storage account and account key // SharedKeyCredential is only avaiable in Node.js runtime, not in browsers diff --git a/sdk/storage/storage-queue/samples/typescript/withConnString.ts b/sdk/storage/storage-queue/samples/typescript/withConnString.ts index 4864cac29b43..329acd5c00f4 100644 --- a/sdk/storage/storage-queue/samples/typescript/withConnString.ts +++ b/sdk/storage/storage-queue/samples/typescript/withConnString.ts @@ -8,7 +8,7 @@ async function main() { // Create Queue Service Client from Account connection string or SAS connection string // Account connection string example - `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` // SAS connection string example - `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - const STORAGE_CONNECTION_STRING = ""; + const STORAGE_CONNECTION_STRING = process.env.STORAGE_CONNECTION_STRING || ""; // Note - Account connection string can only be used in node. const queueServiceClient = QueueServiceClient.fromConnectionString(STORAGE_CONNECTION_STRING);