-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azure-mgmt-batch Pool create incorrect API version #19224
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @mksuni, @bgklein, @mscurrell, @cRui861, @paterasMSFT, @gingi, @dpwatrous. Issue Details
Describe the bug References 2021-01-01: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py#L192 Latest available is 2020-09-01.12.0 at the time of writing: https://docs.microsoft.com/en-us/rest/api/batchservice/batch-service-rest-api-versioning This causes the error:
(side note - HttpResponseError could be improved to include To Reproduce
credentials = azure.identity.DefaultAzureCredential()
cli = azure.mgmt.batch.BatchManagement(
credential=credentials,
subscription_id=subscription_id,
base_url=base_url,
)
cli.pool.create(
resource_group_name=resource_group_name,
account_name=batch_account_name,
pool_name=pool_id,
parameters=azure.mgmt.batch.models.Pool(...),
) Expected behavior
|
Thanks for the feedback, we’ll investigate asap. |
hi @michaelcredera I have used the 15.0.0 package to create a pool inside the batch account, it seems that everything is all right. Can you provide more detailed examples or try again?
|
Sure, here's the code I'm calling that leads to the above error. What's interesting to me is that the error I post above is coming directly from the HTTP API due to the API version, not from the code. I'll test again, maybe they just updated the HTTP API in the server lol! import azure.mgmt.batch as az_batch
import azure.mgmt.batch.operations as az_batch_ops
import azure.mgmt.batch.models as az_batch_models
vm_cfg = az_batch_models.VirtualMachineConfiguration(
image_reference=az_batch_models.ImageReference(
publisher="microsoft-azure-batch", offer="ubuntu-server-container", version="20-04-lts",
),
node_agent_sku_id="batch.node.ubuntu 20.04",
container_configuration=az_batch_models.ContainerConfiguration(
container_image_names=["container_name"],
container_registries=[
az_batch_models.ContainerRegistry(
user_name="user",
password="pass",
registry_server="host",
)
],
),
)
identity_arm = "user identity arm"
pool = az_batch_models.Pool(
identity=az_batch_models.BatchPoolIdentity(
type=az_batch_models.PoolIdentityType.USER_ASSIGNED,
user_assigned_identities={
identity_arm: az_batch_models.Components81XseeSchemasBatchpoolidentityPropertiesUserassignedidentitiesAdditionalproperties()
},
),
display_name="pool name",
vm_size=1,
deployment_configuration=az_batch_models.DeploymentConfiguration(
virtual_machine_configuration=vm_cfg,
),
scale_settings=az_batch_models.ScaleSettings(
fixed_scale=az_batch_models.FixedScaleSettings(
target_dedicated_nodes=0,
target_low_priority_nodes=1,
)
),
task_slots_per_node=8,
start_task=None,
)
credentials = azure.identity.DefaultAzureCredential()
pool_client = az_batch.BatchManagement(
credential=credentials,
subscription_id="subscription_id",
)
pool_client.pool.create(
resource_group_name="resource_group_name",
account_name="batch_account_name",
pool_name="pool name",
parameters=pool,
) |
No change in the documentation, still referencing different API versions: https://docs.microsoft.com/en-us/rest/api/batchservice/batch-service-rest-api-versioning I'll still retry, maybe docs are stale |
Improvement! Backend must've added the 2021 API version, but now I get a 500 error:
|
Confirmed that it's the identity that's causing the 500 error:
Removing this makes things work - anyone have any idea why using a user identity would cause 500 errors? |
And now it seems to work without 500 errors... Not sure what happened, but I think things are working now. I'll run some tests to confirm and close this ticket if all is well. |
Hi @michaelcredera. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Hi @michaelcredera, since you haven’t asked that we “ |
Add managedServerDnsAlias to readme file (Azure#19224) Co-authored-by: Stefan Krivokapic <[email protected]>
Revert "Add managedServerDnsAlias to readme file (Azure#19224)" (Azure#19333) This reverts commit fada264d1744483dff8242026ed0984ccaa4ae5b.
Describe the bug
azure-mgmt-batch PoolOperations.create references a Batch Management REST API version that does not exist yet:
References 2021-01-01: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py#L192
Latest available is 2020-09-01.12.0 at the time of writing: https://docs.microsoft.com/en-us/rest/api/batchservice/batch-service-rest-api-versioning
This causes the error:
(side note - HttpResponseError could be improved to include
response.body()
as the body is the only place where the actual invalid parameter is specified :)To Reproduce
Steps to reproduce the behavior:
Expected behavior
The pool is created without errors from the HTTP request being invalid.
The text was updated successfully, but these errors were encountered: