Skip to content

Commit fb50ec5

Browse files
authored
Update batch-docker-container-workloads.md
removing username/password examples
1 parent a86aac9 commit fb50ec5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/batch/batch-docker-container-workloads.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ ImageReference imageReference = new ImageReference(
245245

246246
ContainerRegistry containerRegistry = new ContainerRegistry(
247247
registryServer: "https://hub.docker.com",
248-
userName: "UserName",
249-
password: "YourPassword"
248+
identityReference: new ComputeNodeIdentityReference() { ResourceId = "/subscriptions/SUB/resourceGroups/RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name" }
250249
);
251250

252251
// Specify container configuration, prefetching Docker images
@@ -286,10 +285,14 @@ image_ref_to_use = batch.models.ImageReference(
286285
version='latest')
287286

288287
# Specify a container registry
288+
subscription_id = "yyyy-yyy-yyy-yyy-yyy"
289+
resource_group_name = "TestRG"
290+
user_assigned_identity_name = "testUMI"
291+
resource_id = f"/subscriptions/{subscription_id}/resourceGroups/{resource_group_name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{user_assigned_identity_name}"
292+
289293
container_registry = batch.models.ContainerRegistry(
290294
registry_server="myRegistry.azurecr.io",
291-
user_name="myUsername",
292-
password="myPassword")
295+
identity_reference = ComputeNodeIdentityReference(resource_id = resource_id))
293296

294297
# Create container configuration, prefetching Docker images from the container registry
295298
container_conf = batch.models.ContainerConfiguration(
@@ -310,8 +313,8 @@ new_pool = batch.models.PoolAddParameter(
310313
// Specify a container registry
311314
ContainerRegistry containerRegistry = new ContainerRegistry(
312315
registryServer: "myContainerRegistry.azurecr.io",
313-
userName: "myUserName",
314-
password: "myPassword");
316+
identityReference: new ComputeNodeIdentityReference() { ResourceId = "/subscriptions/SUB/resourceGroups/RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name" }
317+
);
315318

316319
// Create container configuration, prefetching Docker images from the container registry
317320
ContainerConfiguration containerConfig = new ContainerConfiguration();

0 commit comments

Comments
 (0)