Skip to content

Commit 9f3195f

Browse files
authored
Merge pull request #287822 from pauljewellmsft/js-ts-combine
[Dev guide] Combine JS/TS articles
2 parents a56eb98 + 8a24eb5 commit 9f3195f

File tree

60 files changed

+901
-2892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+901
-2892
lines changed

articles/storage/.openpublishing.redirection.storage.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,106 @@
23852385
"redirect_url": "/azure/cosmos-db/table-storage-how-to-use-ruby",
23862386
"redirect_document_id": false
23872387
},
2388+
{
2389+
"source_path_from_root": "/articles/storage/blobs/storage-blob-container-create-typescript.md",
2390+
"redirect_url": "/azure/storage/blobs/storage-blob-container-create-javascript",
2391+
"redirect_document_id": false
2392+
},
2393+
{
2394+
"source_path_from_root": "/articles/storage/blobs/storage-blob-container-delete-typescript.md",
2395+
"redirect_url": "/azure/storage/blobs/storage-blob-container-delete-javascript",
2396+
"redirect_document_id": false
2397+
},
2398+
{
2399+
"source_path_from_root": "/articles/storage/blobs/storage-blob-container-lease-typescript.md",
2400+
"redirect_url": "/azure/storage/blobs/storage-blob-container-lease-javascript",
2401+
"redirect_document_id": false
2402+
},
2403+
{
2404+
"source_path_from_root": "/articles/storage/blobs/storage-blob-container-properties-metadata-typescript.md",
2405+
"redirect_url": "/azure/storage/blobs/storage-blob-container-properties-metadata-javascript",
2406+
"redirect_document_id": false
2407+
},
2408+
{
2409+
"source_path_from_root": "/articles/storage/blobs/storage-blob-containers-list-typescript.md",
2410+
"redirect_url": "/azure/storage/blobs/storage-blob-containers-list-javascript",
2411+
"redirect_document_id": false
2412+
},
2413+
{
2414+
"source_path_from_root": "/articles/storage/blobs/storage-blob-copy-async-typescript.md",
2415+
"redirect_url": "/azure/storage/blobs/storage-blob-copy-async-javascript",
2416+
"redirect_document_id": false
2417+
},
2418+
{
2419+
"source_path_from_root": "/articles/storage/blobs/storage-blob-copy-typescript.md",
2420+
"redirect_url": "/azure/storage/blobs/storage-blob-copy-javascript",
2421+
"redirect_document_id": false
2422+
},
2423+
{
2424+
"source_path_from_root": "/articles/storage/blobs/storage-blob-copy-url-typescript.md",
2425+
"redirect_url": "/azure/storage/blobs/storage-blob-copy-url-javascript",
2426+
"redirect_document_id": false
2427+
},
2428+
{
2429+
"source_path_from_root": "/articles/storage/blobs/storage-blob-delete-typescript.md",
2430+
"redirect_url": "/azure/storage/blobs/storage-blob-delete-javascript",
2431+
"redirect_document_id": false
2432+
},
2433+
{
2434+
"source_path_from_root": "/articles/storage/blobs/storage-blob-download-typescript.md",
2435+
"redirect_url": "/azure/storage/blobs/storage-blob-download-javascript",
2436+
"redirect_document_id": false
2437+
},
2438+
{
2439+
"source_path_from_root": "/articles/storage/blobs/storage-blob-get-url-typescript.md",
2440+
"redirect_url": "/azure/storage/blobs/storage-blob-get-url-javascript",
2441+
"redirect_document_id": false
2442+
},
2443+
{
2444+
"source_path_from_root": "/articles/storage/blobs/storage-blob-typescript-get-started.md",
2445+
"redirect_url": "/azure/storage/blobs/storage-blob-javascript-get-started",
2446+
"redirect_document_id": false
2447+
},
2448+
{
2449+
"source_path_from_root": "/articles/storage/blobs/storage-blob-lease-typescript.md",
2450+
"redirect_url": "/azure/storage/blobs/storage-blob-lease-javascript",
2451+
"redirect_document_id": false
2452+
},
2453+
{
2454+
"source_path_from_root": "/articles/storage/blobs/storage-blob-properties-metadata-typescript.md",
2455+
"redirect_url": "/azure/storage/blobs/storage-blob-properties-metadata-javascript",
2456+
"redirect_document_id": false
2457+
},
2458+
{
2459+
"source_path_from_root": "/articles/storage/blobs/storage-blob-tags-typescript.md",
2460+
"redirect_url": "/azure/storage/blobs/storage-blob-tags-javascript",
2461+
"redirect_document_id": false
2462+
},
2463+
{
2464+
"source_path_from_root": "/articles/storage/blobs/storage-blob-upload-typescript.md",
2465+
"redirect_url": "/azure/storage/blobs/storage-blob-upload-javascript",
2466+
"redirect_document_id": false
2467+
},
2468+
{
2469+
"source_path_from_root": "/articles/storage/blobs/storage-blob-use-access-tier-typescript.md",
2470+
"redirect_url": "/azure/storage/blobs/storage-blob-use-access-tier-javascript",
2471+
"redirect_document_id": false
2472+
},
2473+
{
2474+
"source_path_from_root": "/articles/storage/blobs/storage-blobs-list-typescript.md",
2475+
"redirect_url": "/azure/storage/blobs/storage-blobs-list-javascript",
2476+
"redirect_document_id": false
2477+
},
2478+
{
2479+
"source_path_from_root": "/articles/storage/blobs/storage-blobs-tune-upload-download-typescript.md",
2480+
"redirect_url": "/azure/storage/blobs/storage-blobs-tune-upload-download-javascript",
2481+
"redirect_document_id": false
2482+
},
2483+
{
2484+
"source_path_from_root": "/articles/storage/blobs/storage-retry-policy-typescript.md",
2485+
"redirect_url": "/azure/storage/blobs/storage-blobs-tune-upload-download-javascript",
2486+
"redirect_document_id": false
2487+
},
23882488
{
23892489
"source_path_from_root": "/articles/storage/storage-about-disks-and-vhds-linux.md",
23902490
"redirect_url": "/azure/virtual-machines/linux/about-disks-and-vhds",

articles/storage/blobs/TOC.yml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -803,78 +803,6 @@ items:
803803
href: storage-retry-policy-javascript.md
804804
- name: 'Tutorial: Upload and process image files'
805805
href: blob-upload-function-trigger-javascript.md
806-
- name: TypeScript
807-
items:
808-
- name: Get started
809-
href: storage-blob-typescript-get-started.md
810-
- name: Authorize access from your application
811-
items:
812-
- name: Microsoft Entra ID
813-
items:
814-
- name: Overview
815-
href: /azure/developer/javascript/sdk/authentication/overview?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
816-
- name: Auth using developer service principals
817-
href: /azure/developer/javascript/sdk/authentication/local-development-environment-service-principal?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
818-
- name: Auth using developer accounts
819-
href: /azure/developer/javascript/sdk/authentication/local-development-environment-developer-account?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
820-
- name: Auth from Azure-hosted apps
821-
href: /azure/developer/javascript/sdk/authentication/azure-hosted-apps?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
822-
- name: Auth from on-premises apps
823-
href: /azure/developer/javascript/sdk/authentication/on-premises-apps?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
824-
- name: Work with SAS tokens
825-
items:
826-
- name: User delegation SAS
827-
href: storage-blob-create-user-delegation-sas-javascript.md
828-
- name: Service SAS
829-
href: sas-service-create-javascript.md
830-
- name: Account SAS
831-
href: storage-blob-account-delegation-sas-create-javascript.md
832-
- name: Container actions
833-
items:
834-
- name: Create a container
835-
href: storage-blob-container-create-typescript.md
836-
- name: Get container URL
837-
href: storage-blob-get-url-typescript.md
838-
- name: Delete and restore containers
839-
href: storage-blob-container-delete-typescript.md
840-
- name: List containers
841-
href: storage-blob-containers-list-typescript.md
842-
- name: Manage container leases
843-
href: storage-blob-container-lease-typescript.md
844-
- name: Manage properties and metadata
845-
href: storage-blob-container-properties-metadata-typescript.md
846-
- name: Blob actions
847-
items:
848-
- name: Upload blobs
849-
href: storage-blob-upload-typescript.md
850-
- name: Download blobs
851-
href: storage-blob-download-typescript.md
852-
- name: Copy blobs
853-
items:
854-
- name: Overview of copy operations
855-
href: storage-blob-copy-typescript.md
856-
- name: Copy from a source object URL
857-
href: storage-blob-copy-url-typescript.md
858-
- name: Copy with asynchronous scheduling
859-
href: storage-blob-copy-async-typescript.md
860-
- name: List blobs
861-
href: storage-blobs-list-typescript.md
862-
- name: Delete and restore blobs
863-
href: storage-blob-delete-typescript.md
864-
- name: Find blobs using tags
865-
href: storage-blob-tags-typescript.md
866-
- name: Manage blob leases
867-
href: storage-blob-lease-typescript.md
868-
- name: Manage blob properties and metadata
869-
href: storage-blob-properties-metadata-typescript.md
870-
- name: Get blob URL
871-
href: storage-blob-get-url-typescript.md
872-
- name: Set or change a blob's access tier
873-
href: storage-blob-use-access-tier-typescript.md
874-
- name: Client library configuration options
875-
items:
876-
- name: Implement a retry policy
877-
href: storage-retry-policy-javascript.md
878806
- name: Python
879807
items:
880808
- name: Get started
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Create a blob container with JavaScript
2+
title: Create a blob container with JavaScript or TypeScript
33
titleSuffix: Azure Storage
44
description: Learn how to create a blob container in your Azure Storage account using the JavaScript client library.
55
author: pauljewellmsft
66

77
ms.service: azure-blob-storage
88
ms.topic: how-to
9-
ms.date: 08/05/2024
9+
ms.date: 10/28/2024
1010
ms.author: pauljewell
1111
ms.devlang: javascript
12-
ms.custom: devx-track-js, devguide-js
12+
ms.custom: devx-track-js, devguide-js, devx-track-ts, devguide-ts
1313
---
1414

15-
# Create a blob container with JavaScript
15+
# Create a blob container with JavaScript or TypeScript
1616

1717
[!INCLUDE [storage-dev-guide-selector-create-container](../../../includes/storage-dev-guides/storage-dev-guide-selector-create-container.md)]
1818

@@ -28,57 +28,53 @@ Blobs in Azure Storage are organized into containers. Before you can upload a bl
2828

2929
## Create a container
3030

31-
32-
To create a container, create a [BlobServiceClient](storage-blob-javascript-get-started.md#create-a-blobserviceclient-object) object or [ContainerClient](storage-blob-javascript-get-started.md#create-a-containerclient-object) object, then use one of the following create methods:
31+
To create a container, call the following method from the [BlobServiceClient](/javascript/api/@azure/storage-blob/blobserviceclient) class:
3332

3433
- [BlobServiceClient.createContainer](/javascript/api/@azure/storage-blob/blobserviceclient#@azure-storage-blob-blobserviceclient-createcontainer)
34+
35+
You can also create a container using either of the following methods from the [ContainerClient](/javascript/api/@azure/storage-blob/containerclient) class:
36+
3537
- [ContainerClient.create](/javascript/api/@azure/storage-blob/containerclient?#@azure-storage-blob-containerclient-create)
3638
- [ContainerClient.createIfNotExists](/javascript/api/@azure/storage-blob/containerclient#@azure-storage-blob-containerclient-createifnotexists)
3739

38-
3940
Containers are created immediately beneath the storage account. It's not possible to nest one container beneath another. An exception is thrown if a container with the same name already exists.
4041

41-
The following example creates a container asynchronously from the BlobServiceClient:
42+
The following example creates a container asynchronously from a `BlobServiceClient` object:
4243

43-
```javascript
44-
async function createContainer(blobServiceClient, containerName){
44+
### [JavaScript](#tab/javascript)
4545

46-
// anonymous access at container level
47-
const options = {
48-
access: 'container'
49-
};
46+
:::code language="typescript" source="~/azure-storage-snippets/blobs/howto/JavaScript/NodeJS-v12/dev-guide/create-container.js" id="snippet_create_container" :::
5047

51-
// creating client also creates container
52-
const containerClient = await blobServiceClient.createContainer(containerName, options);
53-
console.log(`container ${containerName} created`);
48+
### [TypeScript](#tab/typescript)
5449

55-
// do something with container
56-
// ...
50+
:::code language="typescript" source="~/azure-storage-snippets/blobs/howto/TypeScript/NodeJS-v12/dev-guide/src/container-create.ts" id="snippet_create_container" :::
5751

58-
return containerClient;
59-
}
60-
```
52+
---
53+
54+
## Create the root container
6155

62-
## Understand the root container
56+
A root container serves as a default container for your storage account. Each storage account can have one root container, which must be named *$root*. The root container must be explicitly created or deleted.
6357

64-
A root container, with the specific name `$root`, enables you to reference a blob at the top level of the storage account hierarchy. For example, you can reference a blob _without using a container name in the URI_:
58+
You can reference a blob stored in the root container without including the root container name. The root container enables you to reference a blob at the top level of the storage account hierarchy. For example, you can reference a blob in the root container as follows:
6559

66-
`https://myaccount.blob.core.windows.net/default.html`
60+
`https://accountname.blob.core.windows.net/default.html`
6761

68-
The root container must be explicitly created or deleted. It isn't created by default as part of service creation. The same code displayed in the previous section can create the root. The container name is `$root`.
62+
To create the root container, call any create method and specify the container name as *$root*.
6963

7064
## Resources
7165

7266
To learn more about creating a container using the Azure Blob Storage client library for JavaScript, see the following resources.
7367

68+
### Code samples
69+
70+
- View [JavaScript](https://github.com/Azure-Samples/AzureStorageSnippets/blob/master/blobs/howto/JavaScript/NodeJS-v12/dev-guide/create-container.js) and [TypeScript](https://github.com/Azure-Samples/AzureStorageSnippets/blob/master/blobs/howto/TypeScript/NodeJS-v12/dev-guide/src/container-create.ts) code samples from this article (GitHub)
71+
7472
### REST API operations
7573

7674
The Azure SDK for JavaScript contains libraries that build on top of the Azure REST API, allowing you to interact with REST API operations through familiar JavaScript paradigms. The client library methods for creating a container use the following REST API operation:
7775

7876
- [Create Container](/rest/api/storageservices/create-container) (REST API)
7977

80-
### Code samples
81-
82-
- [View code samples from this article (GitHub)](https://github.com/Azure-Samples/AzureStorageSnippets/blob/master/blobs/howto/JavaScript/NodeJS-v12/dev-guide/create-container.js)
83-
8478
[!INCLUDE [storage-dev-guide-resources-javascript](../../../includes/storage-dev-guides/storage-dev-guide-resources-javascript.md)]
79+
80+
[!INCLUDE [storage-dev-guide-next-steps-javascript](../../../includes/storage-dev-guides/storage-dev-guide-next-steps-javascript.md)]

articles/storage/blobs/storage-blob-container-create-typescript.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)