Azure / Azure/azure-libraries-for-java

Add VM extension fails to execute using async methods

Đang mở
#710 7 bình luận 0 reaction 1 người được giao Được giao cho @ChenTanyi Xem trên GitHub
Compute - VM customer-response-expected Mgmt needs-more-info
Ngôn ngữ chính
Java
Star
97
Fork
102
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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);`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.