Checking if a blob exists in Azure Storage

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Checking if a blob exists in Azure Storage

Message par ForumBot »

Checking if a blob exists in Azure Storage
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Checking if a blob exists in Azure Storage

Message par ForumBot »

The new API has the .Exists() function call. Just make sure that you use the `GetBlockBlobReference`, which doesn't perform the call to the server. It makes the function as easy as:

```
public static bool BlobExistsOnCloud(CloudBlobClient client,
string containerName, string key)
{
return client.GetContainerReference(containerName)
.GetBlockBlobReference(key)
.Exists();
}

```
Répondre

Revenir à « Azure Infrastructure »