Skip to content

Commit 9cf557b

Browse files
authored
Update tutorial-parallel-dotnet.md
1 parent fb50ec5 commit 9cf557b

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

articles/batch/tutorial-parallel-dotnet.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,6 @@ git clone https://github.com/Azure-Samples/batch-dotnet-ffmpeg-tutorial.git
6464

6565
Navigate to the directory that contains the Visual Studio solution file *BatchDotNetFfmpegTutorial.sln*.
6666

67-
Open the solution file in Visual Studio, and update the credential strings in *Program.cs* with the values you obtained for your accounts. For example:
68-
69-
```csharp
70-
// Batch account credentials
71-
private const string BatchAccountName = "yourbatchaccount";
72-
private const string BatchAccountKey = "xxxxxxxxxxxxxxxxE+yXrRvJAqT9BlXwwo1CwF+SwAYOxxxxxxxxxxxxxxxx43pXi/gdiATkvbpLRl3x14pcEQ==";
73-
private const string BatchAccountUrl = "https://yourbatchaccount.yourbatchregion.batch.azure.com";
74-
75-
// Storage account credentials
76-
private const string StorageAccountName = "yourstorageaccount";
77-
private const string StorageAccountKey = "xxxxxxxxxxxxxxxxy4/xxxxxxxxxxxxxxxxfwpbIC5aAWA8wDu+AFXZB827Mt9lybZB1nUcQbQiUrkPtilK5BQ==";
78-
```
79-
80-
[!INCLUDE [batch-credentials-include](../../includes/batch-credentials-include.md)]
81-
8267
Also, make sure that the ffmpeg application package reference in the solution matches the identifier and version of the ffmpeg package that you uploaded to your Batch account. For example, `ffmpeg` and `4.3.1`.
8368

8469
```csharp
@@ -133,26 +118,20 @@ The following sections break down the sample application into the steps that it
133118

134119
### Authenticate Blob and Batch clients
135120

136-
To interact with the linked storage account, the app uses the Azure Storage Client Library for .NET. It creates a reference to the account with [CloudStorageAccount](/dotnet/api/microsoft.azure.cosmos.table.cloudstorageaccount), authenticating using shared key authentication. Then, it creates a [CloudBlobClient](/dotnet/api/microsoft.azure.storage.blob.cloudblobclient).
121+
To interact with the linked storage account, the app uses the Azure.Storage.Blobs Library for .NET. Using the [BlobServiceClient](/dotnet/api/azure.storage.blobs.blobserviceclient) class which takes a reference to the account Uri and authenticating [Token](dotnet/api/azure.core.tokencredentia) such as [DefaultAzureCredential](dotnet/api/azure.identity.defaultazurecredential).
137122

138123
```csharp
139-
// Construct the Storage account connection string
140-
string storageConnectionString = String.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}",
141-
StorageAccountName, StorageAccountKey);
142-
143-
// Retrieve the storage account
144-
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
145-
146-
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
124+
// TODO: Replace <storage-account-name> with your actual storage account name
125+
Uri accountUri = new Uri("https://<storage-account-name>.blob.core.windows.net/");
126+
BlobServiceClient blobClient = new BlobServiceClient(accountUri, new DefaultAzureCredential());
147127
```
148128

149129
The app creates a [BatchClient](/dotnet/api/microsoft.azure.batch.batchclient) object to create and manage pools, jobs, and tasks in the Batch service. The Batch client in the sample uses shared key authentication. Batch also supports authentication through [Microsoft Entra ID](batch-aad-auth.md) to authenticate individual users or an unattended application.
150130

151131
```csharp
152-
BatchSharedKeyCredentials sharedKeyCredentials = new BatchSharedKeyCredentials(BatchAccountUrl, BatchAccountName, BatchAccountKey);
153-
154-
using (BatchClient batchClient = BatchClient.Open(sharedKeyCredentials))
155-
...
132+
// TODO: Replace <batch-account-name> with your actual storage account name
133+
Uri batchUri = new Uri("https://<batch-account-name>t.eastus.batch.azure.com");
134+
BatchClient _batchClient = new BatchClient(batchUri, new DefaultAzureCredential());
156135
```
157136

158137
### Upload input files

0 commit comments

Comments
 (0)