azure-sdk-for-java
azure-sdk-for-java copied to clipboard
[BUG] AppServicePlan numberOfWebApps and operatingSystem() returns wrong values
Describe the bug
For an AppServicePlan, calling numberOfWebApps()
always returns 0.
Also, calling operatingSystem()
always returns WINDOWS
even if the OS is Linux.
To Reproduce Steps to reproduce the behavior: call the aforementioned methods and check the values
Code Snippet
protected Map<String, String> getAttributes(AppServicePlan resource) {
...
attributes.put("number_of_web_apps", String.valueOf(resource.numberOfWebApps())); -> Always 0
attributes.put("operating_system", resource.operatingSystem().name()); -> Always WINDOWS
return attributes;
}
Expected behavior
The above methods should return the correct values (actual number of sites for numberOfWebApps
, and Linux
for apps using Linux as their OS)
Setup (please complete the following information):
- OS: macOS 12 Monterey
- IDE: IntelliJ
- Library/Libraries: com.microsoft.azure:azure-mgmt-appservice:1.41.4
- Java version: 11
Additional context Did a bit of tracing, and it seems that this was fixed before in this issue https://github.com/Azure/azure-sdk-for-java/issues/1861
Specifically, by this PR (at least for the operatingSystem issue): https://github.com/Azure/azure-sdk-for-java/pull/1873/files#diff-e852fd3b4bbf68e3ae66dfbc2ecbced2b2c45f493af8c6bacb902db2e18abfeaL75
Current code level does not have this fix - any idea why?
Thanks for reporting this issue, @rnaval. @weidongxu-microsoft could you please follow up?
Deploy Preview for privacyguides ready!
Name | Link |
---|---|
Latest commit | ac8c5a30d16ecd03c5d8e87943178e82cfcefcb3 |
Latest deploy log | https://app.netlify.com/sites/privacyguides/deploys/640963edd21e2b0008051d0b |
Deploy Preview | https://deploy-preview-1068--privacyguides.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
@weidongxu-microsoft I haven't checked yet - migration to the new SDK is still ongoing.
As an aside, I thought that the old libraries would be deprecated by March 2023: https://azure.github.io/azure-sdk/releases/deprecated/index.html - as such, will it still receive support until then?
@rnaval
Old lib was deprecated on March 2022.
Support will continue to 2023, however bug fix could be slow. And there is no regular releases.
@weidongxu-microsoft Thanks for the info. We are currently in the process of upgrading to the new library, but we are still supporting applications that rely on the old library until 2023.
I'll let you know if we get the new lib test results.
2.17.0 works fine.
var appObj = azure.appServicePlans().getByResourceGroup("rg-weidxu", "ASP-rgweidxu-bf61");
System.out.println("os: " + appObj.operatingSystem());
System.out.println("no. of webapps: " + appObj.numberOfWebApps());
output
os: linux
no. of webapps: 1
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!