@@ -132,7 +132,7 @@ You can also create a pool from a Shared Image using Python SDK.
132
132
``` python
133
133
# Import the required modules from the
134
134
# Azure Batch Client Library for Python
135
- import azure.batch._batch_service_client as batch
135
+ import azure.batch as batch
136
136
import azure.batch.models as batchmodels
137
137
from azure.common.credentials import ServicePrincipalCredentials
138
138
@@ -158,16 +158,19 @@ creds = ServicePrincipalCredentials(
158
158
config = batch.BatchServiceClientConfiguration(creds, batch_url)
159
159
client = batch.BatchServiceClient(creds, batch_url)
160
160
161
- # Create the unbound pool
162
- new_pool = batchmodels.PoolAddParameter(id = pool_id, vm_size = vm_size)
163
- new_pool.target_dedicated = node_count
164
-
165
161
# Configure the start task for the pool
166
162
start_task = batchmodels.StartTask(
167
163
command_line = " printenv AZ_BATCH_NODE_STARTUP_DIR"
168
164
)
169
165
start_task.run_elevated = True
170
- new_pool.start_task = start_task
166
+
167
+ # Create the unbound pool
168
+ new_pool = batchmodels.PoolAddParameter(
169
+ id = pool_id,
170
+ vm_size = vm_size,
171
+ target_dedicated_nodes = node_count,
172
+ start_task = start_task
173
+ )
171
174
172
175
# Create an ImageReference which specifies the image from
173
176
# Shared Image Gallery to install on the nodes.
0 commit comments