Azure / Azure/azure-powershell
Get-AzWebApp fails on Logic App standard plan using File System connection
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
Get-AzWebApp fails on Logic App standard plan using "File System" connection
When using File System connection, a BYOS is configured using type "FileShare". This is not matching the expected value "AzureBlob" or "AzureFile" defined in Microsoft.Azure.Management.Websites.dll .
To reproduce:
1. Create a Logic App standard plan.
2. Create a workflow and a File System connector. Fill in any connection information.
3. Run Get-AzWebApp with the app.
Currently, I think there is no alternative PS cmdlet to get Logic App in standard plan.
### Issue script & Debug output
```PowerShell
PS> $DebugPreference='Continue'
PS> Get-AzWebApp -ResourceGroupName <****> -Name <****>
DEBUG: 2:47:55 PM - GetAzureWebAppCmdlet begin processing with ParameterSet 'S1'.
DEBUG: 2:47:55 PM - using account id '<****>'...
DEBUG: 2:47:55 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: '<****>', environment: 'AzureCloud', tenant: '<****>'
DEBUG: 2:47:55 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 2:47:55 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'<****>', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'<****>'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 4c3a285a-07c2-49fb-b415-00065a353291] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 4c3a285a-07c2-49fb-b415-00065a353291] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 4c3a285a-07c2-49fb-b415-00065a353291] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 4c3a285a-07c2-49fb-b415-00065a353291] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 4c3a285a-07c2-49fb-b415-00065a353291] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z] Returning 1 accounts
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] MSAL MSAL.NetCore with assembly version '4.49.1.0'. CorrelationId(2fe4c8fa-6253-48e4-acf9-393f8c15718f)
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] LoginHint provided: False
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] Account provided: True
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] ForceRefresh: False
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 2fe4c8fa-6253-48e4-acf9-393f8c15718f
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] === Token Acquisition (SilentRequest) started:
Scopes: https://management.core.windows.net//.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] Access token is not expired. Returning the found cache entry. [Current time (12/03/2024 06:47:55) - Expiration Time (12/03/2024 08:06:50 +00:00) - Extended Expiration Time (12/03/2024 08:06:50 +00:00)]
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f]
=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.49.1.0 MSAL.NetCore .NET 8.0.10 Microsoft Windows 10.0.22621 [2024-12-03 06:47:55Z - 2fe4c8fa-6253-48e4-acf9-393f8c15718f] AT expiration time: 12/3/2024 8:06:50 AM +00:00, scopes: https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default. source: Cache
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: ExpiresOn: 2024-12-03T08:06:50.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '<****>', UserId: '<****>'
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/<****>?api-version=2021-01-15
Headers:
Accept-Language : en-US
x-ms-client-request-id : 46102ab7-0d86-42de-a144-a69de801e85a
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Cache-Control : no-cache
Pragma : no-cache
ETag : "1DB454E56304050"
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-request-id : e8a207ec-2fba-4d99-aefa-cc1a18d8b586
X-AspNet-Version : 4.0.30319
X-Powered-By : ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-correlation-request-id : 160aa2b2-d71c-400d-85f1-452b3657deb1
x-ms-routing-request-id : JAPANEAST:20241203T064756Z:160aa2b2-d71c-400d-85f1-452b3657deb1
X-Content-Type-Options : nosniff
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: E9A066B3D10D4E31BDD72B2E75953382 Ref B: TYO201100117029 Ref C: 2024-12-03T06:47:56Z
Date : Tue, 03 Dec 2024 06:47:56 GMT
Body:
{
...
}
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/<****>/config/web?api-version=2021-01-15
Headers:
Accept-Language : en-US
x-ms-client-request-id : 46102ab7-0d86-42de-a144-a69de801e85a
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Cache-Control : no-cache
Pragma : no-cache
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-request-id : 04461c39-9256-4d8e-a2a2-2df8d72d2754
X-AspNet-Version : 4.0.30319
X-Powered-By : ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-correlation-request-id : 54a50033-9989-4cf0-b7cf-fe57a92e8907
x-ms-routing-request-id : JAPANWEST:20241203T064756Z:54a50033-9989-4cf0-b7cf-fe57a92e8907
X-Content-Type-Options : nosniff
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: 118EF36856EF4A07AC873501356B089D Ref B: TYO201100117029 Ref C: 2024-12-03T06:47:56Z
Date : Tue, 03 Dec 2024 06:47:56 GMT
Body:
{
"id": "<****>",
"name": "<****>",
"type": "Microsoft.Web/sites/config",
...
"properties": {
...
"azureStorageAccounts": {
"FileSystem": {
"type": "FileShare",
"accountName": "test",
"shareName": "test",
"accessKey": null,
"mountPath": "\\mounts\\FileSystem",
"state": "Ok",
"endpoint": "test",
"protocol": "Smb"
}
},
...
}
}
DEBUG: 2:47:56 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
Get-AzWebApp: Unable to deserialize the response.
DEBUG: 2:47:56 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 2:47:56 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Websites:3.0.0; CommandName: Get-AzWebApp; PSVersion: 7.4.6; IsSuccess: False; Duration: 00:00:01.2080096; Exception: Unable to deserialize the response.;
DEBUG: 2:47:57 PM - GetAzureWebAppCmdlet end processing.
```
### Environment data
```PowerShell
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
PS> Get-Module Az*
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.12.3 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 3.0.0 Az.Websites {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfiguration, Get-AzAppServiceEnvironment…}
```
### Error output
```PowerShell
Resolve-AzError
DEBUG: 2:56:55 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 2:56:55 PM - using account id '<****>'...
DEBUG: 2:56:55 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release. Please change any scripts that use this alias to use `Resolve-AzError` instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
HistoryId: 10
Message : Unable to deserialize the response.
StackTrace : at Microsoft.Azure.Management.WebSites.WebAppsOperations.GetConfigurationWithHttpMessagesAsync(String resourceGroupName, String name, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.WebSites.WebAppsOperationsExtensions.GetConfigurationAsync(IWebAppsOperations operations, String resourceGroupName, String name, CancellationToken cancellationToken)
at Microsoft.Azure.Management.WebSites.WebAppsOperationsExtensions.GetConfiguration(IWebAppsOperations operations, String resourceGroupName, String name)
at Microsoft.Azure.Commands.WebApps.Utilities.WebsitesClient.GetWebAppConfiguration(String resourceGroupName, String webSiteName, String slotName, Site site, Boolean ignoreError)
at Microsoft.Azure.Commands.WebApps.Utilities.WebsitesClient.GetWebApp(String resourceGroupName, String webSiteName, String slotName, Boolean ignoreError)
at Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppCmdlet.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : Microsoft.Rest.SerializationException
InvocationInfo : {Get-AzWebApp}
Line : Get-AzWebApp -ResourceGroupName <****> -Name <****>
Position : At line:1 char:1
+ Get-AzWebApp -ResourceGroupName <****> -Name <****>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 10
Message : Error converting value "FileShare" to type 'System.Nullable`1[Microsoft.Azure.Management.WebSites.Models.AzureStorageType]'. Path 'properties.azureStorageAccounts.FileSystem.type', line 1, position 4012.
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 -ResourceGroupName <****> -Name <****>
Position : At line:1 char:1
+ Get-AzWebApp -ResourceGroupName <****> -Name <****>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 10
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 -ResourceGroupName <****> -Name <****>
Position : At line:1 char:1
+ Get-AzWebApp -ResourceGroupName <****> -Name <****>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 10
```
Contributor guide
Research direction
Start with the Get-AzWebApp path that reads Microsoft.Azure.Management.Websites.dll responses, using the reported azureStorageAccounts.FileSystem payload as the reproduction case. Trace why the FileShare type cannot be deserialized and verify that Get-AzWebApp returns the Logic App successfully for this configuration without the deserialization error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, powershell
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100