Skip to content

Get-AzWebApp fails to deserialize Azure Storage mount type "FileShare"Β #29979

Open

Description

@artoxian

Description

Description
Get-AzWebApp throws:

Microsoft.Rest.SerializationException:
Unable to deserialize the response.

Inner Exception:

Error converting value "FileShare" to type
Microsoft.Azure.Management.WebSites.Models.AzureStorageType

Requested value 'FileShare' was not found.

This happens if you have a file share (e.g. a SMB on-premises share) configured for your logic app standard

Reproduction
Get-AzWebApp -ResourceGroupName "my-rg"
-Name "my-logicapp"

Relevant JSON

"azureStorageAccounts": {
"FileSystem": {
"type": "FileShare"
}
}

Issue script & Debug output

$DebugPreference='Continue'
Get-AzWebApp -ResourceGroupName "<REDACTED>" -Name "<REDACTED>" -ErrorAction Stop

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.14393
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     5.5.2                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     10.1.0                Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     4.0.0                 Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfiguration, Get-AzAppServiceEnvironment…}

Error output

DEBUG: 3:24:38 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
Message        : Error converting value "FileShare" to type 'System.Nullable`1[Microsoft.Azure.Management.WebSites.Models.AzureStorageType]'. Path 'properties.azureStorageAccounts.FileSystem.type', line 1,
                 position 4306.
StackTrace     :    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty
                 containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty,
                 String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
                    at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.WebSites.WebAppsOperations.GetConfigurationWithHttpMessagesAsync(String resourceGroupName, String name, Dictionary`2 customHeaders, CancellationToken
                 cancellationToken)
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzWebApp}
Line           : Get-AzWebApp `

Position       : At line:1 char:1
                 + Get-AzWebApp `
                 + ~~~~~~~~~~~~~~
HistoryId      : 4

DEBUG: 3:24:38 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
Message        : Requested value 'FileShare' was not found.
StackTrace     :    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Get-AzWebApp}
Line           : Get-AzWebApp `

Position       : At line:1 char:1
                 + Get-AzWebApp `
                 + ~~~~~~~~~~~~~~
HistoryId      : 4

Activity

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    needs-triageThis is a new issue that needs to be triaged to the appropriate team.
    on Aug 10, 2026
  2. microsoft-github-policy-service commented on Aug 10, 2026

    @microsoft-github-policy-service
    Contributor

    πŸ”” Routing this issue to @Azure/act-observability-squad.

  3. x-engineering-agent commented on Aug 10, 2026

    @x-engineering-agent

    X Engineering Agent Bug analysis: Root cause analysis

    Get-AzWebApp throws Microsoft.Rest.SerializationException when the web app's
    azureStorageAccounts config includes a storage account of type "FileShare"
    (e.g. an SMB on-premises share mounted on a Logic App Standard / App Service).

    Root cause: The client-side model
    Microsoft.Azure.Management.WebSites.Models.AzureStorageType (used by
    Az.Websites) does not define a FileShare enum member, so Newtonsoft.Json's
    StringEnumConverter fails with Requested value 'FileShare' was not found
    while deserializing the GetConfiguration response.

    Fix guidance: Locate the AzureStorageType enum/model definition under the
    Websites module (likely in the generated SDK models or a corresponding
    partial/extension type) and add the missing FileShare value so the
    deserializer can map it correctly. Add/update a Websites.Test recording or
    unit test that deserializes a config payload containing
    "azureStorageAccounts": {"FileSystem": {"type": "FileShare"}} to confirm no
    exception is thrown and the value round-trips correctly.

    Use this EXACT PR title: [Websites] Add FileShare to AzureStorageType enum to fix deserialization error

    PR title & description (azure-powershell)

    Follow CONTRIBUTING.md. azure-powershell does not enforce a strict title gate β€” it requires a clear, informative title and a fully filled-out PR template.

    Suggested PR title (clear & informative; [Module] prefix is the common convention):

    [Websites] Add FileShare to AzureStorageType enum to fix deserialization error
    

    Required (per CONTRIBUTING.md):

    • Fill out the PR template completely β€” PRs are not reviewed without the completed checklist; do not delete it.
    • Link the issue β€” include Fixes #29979 in the description so the PR auto-closes it.
    • ChangeLog β€” add a bullet describing the fix under the ## Upcoming Release header of src/Websites/Websites/ChangeLog.md. Do not add a new version header.
    • Target branch β€” main.
    • Tests β€” add/adjust test coverage for the change. Tests must not contain hardcoded values (location, resource id, etc.) and must be re-recordable; do not skip existing tests.
    • Scope β€” keep the change limited to the affected module (src/Websites/).

    X Engineering Agent Β· Fixer Β· react πŸ‘ / πŸ‘Ž to train the agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions