CloudBlobContainer.GetBlockBlobReference Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetBlockBlobReference(String) |
Gets a reference to a block blob in this container. |
GetBlockBlobReference(String, Nullable<DateTimeOffset>) |
Gets a reference to a block blob in this container. |
GetBlockBlobReference(String)
Gets a reference to a block blob in this container.
public virtual Microsoft.Azure.Storage.Blob.CloudBlockBlob GetBlockBlobReference (string blobName);
abstract member GetBlockBlobReference : string -> Microsoft.Azure.Storage.Blob.CloudBlockBlob
override this.GetBlockBlobReference : string -> Microsoft.Azure.Storage.Blob.CloudBlockBlob
Public Overridable Function GetBlockBlobReference (blobName As String) As CloudBlockBlob
Parameters
- blobName
- String
A string containing the name of the block blob.
Returns
A CloudBlockBlob object.
Examples
// This is one common way of creating a CloudStorageAccount object. You can get
// your Storage Account Name and Key from the Azure Portal.
StorageCredentials credentials = new StorageCredentials(accountName, accountKey);
CloudStorageAccount storageAccount = new CloudStorageAccount(credentials, useHttps: true);
// Another common way to create a CloudStorageAccount object is to use a connection string:
// CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// This call creates a local CloudBlobContainer object, but does not make a network call
// to the Azure Storage Service. The container on the service that this object represents may
// or may not exist at this point. If it does exist, the properties will not yet have been
// popluated on this object.
CloudBlobContainer blobContainer = blobClient.GetContainerReference(containerName);
// This makes an actual service call to the Azure Storage service. Unless this call fails,
// the container will have been created.
blobContainer.Create();
// This also does not make a service call, it only creates a local object.
CloudBlockBlob blob = blobContainer.GetBlockBlobReference(blobName);
// This transfers data in the file to the blob on the service.
blob.UploadFromFile(inputFileName);
Applies to
GetBlockBlobReference(String, Nullable<DateTimeOffset>)
Gets a reference to a block blob in this container.
public virtual Microsoft.Azure.Storage.Blob.CloudBlockBlob GetBlockBlobReference (string blobName, DateTimeOffset? snapshotTime);
abstract member GetBlockBlobReference : string * Nullable<DateTimeOffset> -> Microsoft.Azure.Storage.Blob.CloudBlockBlob
override this.GetBlockBlobReference : string * Nullable<DateTimeOffset> -> Microsoft.Azure.Storage.Blob.CloudBlockBlob
Public Overridable Function GetBlockBlobReference (blobName As String, snapshotTime As Nullable(Of DateTimeOffset)) As CloudBlockBlob
Parameters
- blobName
- String
A string containing the name of the block blob.
- snapshotTime
- Nullable<DateTimeOffset>
A DateTimeOffset specifying the snapshot timestamp, if the blob is a snapshot.
Returns
A CloudBlockBlob object.
Applies to
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기