azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] AppServicePlanData.IsZoneRedundant returns null values when zone redundancy is enabled
Library name and version
Azure.ResourceManager.AppService v1.0.2
Describe the bug
AppServicePlan.IsZoneRedundant returns null despite resource in Azure being defined with zone redundancy.
My organization has a utility for aggregating various information about our subscriptions, among other being zone redundancy.
The code I've written is getting all AppServicePlans from a subscription, and checking the IsZoneRedundant values. However, those values are always null regardless of the value in the Azure Portal. Example of an App Service Plan which is zone redundant:
Expected behavior
If the Azure Portal reports that the AppServicePlan resource has Zone Redundant enabled, then AppServicePlanData.IsZoneRedundant should return true.
Actual behavior
AppServicePlanData.IsZoneRedundant returns a null value regardless of what Azure Portal reports.
Reproduction Steps
- In Azure Portal, create a new Linux app service plan in the Azure portal with a premium SKU and zone redundancy enabled - Deploy it without attaching any apps
- Write a small utility to get the data of your Azure subscription, for example like this:
ArmClient armClient = [in my case gotten by managed identity];
var subscription = (await armClient.GetSubscriptions().GetAsync("[subscription id]")).Value;
IEnumerable<AppServicePlanData> plans = subscription.GetAppServicePlans();
foreach (var plan in plans)
{
// every single plan.Data has IsZoneRedundant == null
}
- Set a breakpoint somewhere in the loop and inspect the plans. Here's the entry corresponding to my other screenshot:
Environment
Test app being run locally as C# .NET 6 in-process Azure Function ( built and run via VS2022 17.8.3 64-bit) Linux-based App Service Plan in Azure Portal.
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Just to add some more info: I cloned the SDK repo and added a reference to the AppService project instead of the NuGet, so I could debug what was really going on.
I stepped into the deserialization logic of the app service plan data and there the JSON entries also just had "zoneRedundant": null.
The callstack contains a "Mocking" namespace too, not sure if that is intentional:
Wondering if this is an issue on the Azure API itself? If so, can you log an internal bug or tell me a support area path I can go to?
Another thing I just thought to try was checking results from an AZ CLI instance using az appservice plan list on my subscription, which does return the correct ZoneRedundant value for my app service plan. Is this merely a question of the managed identity running my function app lacking sufficient privileges in my subscription?
Hi @EmilDamsbo , Thank you for using Azure SDK for .NET.
We can't repro this issue on our side, the IsZoneRedundant returns true as we expected.
Both approaches seem working good on out side, code attached
var plan = (await resourceGroup.GetAppServicePlans().GetAsync("name")).Value;
Console.WriteLine(plan.Data.IsZoneRedundant);
var list = resourceGroup.GetAppServicePlans().GetAllAsync();
await foreach (var item in list)
{
Console.WriteLine(item.Data.IsZoneRedundant);
}
You could use any capture tools to check your actual payload, see if the response value is correct.
Hi @EmilDamsbo. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @EmilDamsbo, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
@HarveyLink The value is not present in the payload. Could you comment on my previous assertion:
Is this merely a question of the managed identity running my function app lacking sufficient privileges in my subscription?
If that could be the case, could you guide me towards which access my MI is lacking?
@HarveyLink The value is not present in the payload. Could you comment on my previous assertion:
Is this merely a question of the managed identity running my function app lacking sufficient privileges in my subscription?
If that could be the case, could you guide me towards which access my MI is lacking?
Hi, We don't have much domain knowledge on a single service. If there is a sufficient privileges lacking here, you may need to open an Azure support request
Hi @EmilDamsbo. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @EmilDamsbo, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
If anyone runs into this in the future: Use GetAppServicePlans(detailed: true), Zone redundancy property is apparently not returned by default.