Azure / Azure/azure-libraries-for-java

Add VM extension fails to execute using async methods

Abierto
#710 7 comentarios 0 reacciones 1 asignado Asignado a @ChenTanyi Ver en GitHub
Compute - VM customer-response-expected Mgmt needs-more-info
Lenguaje dominante
Java
Estrellas
97
Forks
102
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This is related to [ticket](https://github.com/Azure/azure-libraries-for-java/issues/632). I followed the guide to add a VM extension but instead of executing this synchronously I used the applyAsync methods instead.

This is the guide that I followed:
https://github.com/Azure-Samples/compute-java-manage-virtual-machine-using-vm-extensions/blob/master/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineExtension.java

As I don't care about the result and don't want to wait for a response, I pass in a null ServiceCallback. This is the same approach I've seen used elsewhere and is working for both VirtualMachine#startAsync and VirtualMachine#powerOffAsync. This fails to send any HTTP requests. If I execute this synchronously I see the HTTP requests going through as expected.

I could be doing something wrong, but the same approach does work for other methods.

Approach for applyAsync that doesn't work:

` virtualMachine.inner().withPlan(null);
virtualMachine.update().defineNewExtension("OMSExtension").withPublisher("Microsoft.EnterpriseCloud.Monitoring")
.withType("OmsAgentForLinux").withVersion(OMS_AGENT_VERSION).withMinorVersionAutoUpgrade()
.withPublicSetting("workspaceId", workspaceId).withProtectedSetting("workspaceKey", workspaceKey)
.attach().applyAsync(null);`

Approach for powerOffAsync that does work:
`virtualMachine.powerOffAsync(null);`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.