Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function main() {
// Enter your storage account name and SAS
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();
const queueServiceClient = new QueueServiceClient(
// When using AnonymousCredential, following url should include a valid SAS or support public access
`https://${account}.queue.core.windows.net${accountSas}`,
anonymousCredential
);
// Create a new queue
const queueName = `newqueue${new Date().getTime()}`;
const queueClient = queueServiceClient.getQueueClient(queueName);
const createQueueResponse = await queueClient.create();
console.log(
`Create queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`
);
// Delete the queue.
async function main() {
// Enter your storage account name and SAS
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();
const queueServiceClient = new QueueServiceClient(
// When using AnonymousCredential, following url should include a valid SAS or support public access
`https://${account}.queue.core.windows.net${accountSas}`,
anonymousCredential
);
// Create a new queue
const queueName = `newqueue${new Date().getTime()}`;
const queueClient = queueServiceClient.getQueueClient(queueName);
const createQueueResponse = await queueClient.create();
console.log(
`Create queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`
);
// Delete the queue.