microsoft/vscode-azurestaticwebapps

Internal error: 'branchDataProvider.getResourceltem' threw exception Cannot read properties of null (reading 'contextValuesToAdd')

Opened this issue · 18 comments

Hello,

I am no longer able to see details for static web apps and getting this error instead:

Internal error: 'branchDataProvider.getResourceltem' threw exception Cannot read properties of null (reading 'contextValuesToAdd')

swaerror

The same error shows on all static web apps in all subscriptions.

Are you still able to view these apps on the portal as normal? This error indicates that we aren't able to fetch data about this resource due to lack of permissions.

Hello,

Yes, all works in portal as normal and I can see all other resources in the azure extension except static web apps for all subscriptions.

If the issue is with permissions, how can I check I have the correct ones?

Thanks

Which method did you use to deploy to your static web app? Did you deploy with GitHub actions or use the static web apps cli, etc?

The cli and the Deploy Azure Static Web App 0.* (preview) task in devops releases

I suspect this error will show up for apps that aren't connected to GitHub or Azure DevOps. The extension lacks support at the moment for apps that have been deployed with other means (SWA CLI, or the DevOps task).

Just to help confirm this, is this error showing for all of your apps? Do you have Static Web Apps that are connected to GitHub/DevOps repositories? If yes, are those ones showing the same error?

If you only have apps that have been deployed to with the CLI or the DevOps preview task, that's fine. We need to add support for those apps in the extension. It's been on our todo list for a while.

In the meantime we could certainly provide a better error message.

I do not have apps deployed directly via GitHub/devops. I deploy them with pipelines.

Ok that makes sense.

Thanks

Hello, was this ever resolved?

I had access to .yml config files for a static web app via the Azure extension in VS Code for years, but now it's broken.

If this is now broken for foreseeable future, is there another way to read and write files that are git-ignored for static web apps?

How are you deploying @BP-StepanO-RUS ?

How are you deploying @BP-StepanO-RUS ?

Github Actions @motm32

How are you deploying @BP-StepanO-RUS ?

Github Actions @motm32

Could you go into the Azure Portal and show us the property JSON for this static web site? Something that we expect to be there is undefined so if you can share that with us, we may be able to discern what's throwing the error.

Do you mean this file? @nturinski

{ "id": "[REDACTED]", "name": "[REDACTED]", "type": "Microsoft.Web/sites", "kind": "app,linux", "location": "West US 2", "tags": { "CostCenter": "[REDACTED]", "Engagement": "[REDACTED]", "Purpose": " ", "Environment": "Prod", "Owner": " ", "Eol": "NA", "Outcome": "Tagged", "BusinessCriticality": "High", "Department": "[REDACTED]", "Notes": "[REDACTED]", "ResourceServiceType": "Microsoft.Web/sites", "Schedule": " ", "CreatedBy": "[REDACTED]" }, "properties": { "name": "[REDACTED]", "state": "Running", "hostNames": [ "[REDACTED]" ], "webSpace": "[REDACTED]", "selfLink": "[REDACTED]", "repositorySiteName": "[REDACTED]", "owner": null, "usageState": 0, "enabled": true, "adminEnabled": true, "afdEnabled": false, "enabledHostNames": [ "[REDACTED]", "[REDACTED]" ], "siteProperties": { "metadata": null, "properties": [ { "name": "LinuxFxVersion", "value": "PYTHON|3.9" }, { "name": "WindowsFxVersion", "value": null } ], "appSettings": null }, "availabilityState": 0, "sslCertificates": null, "csrs": [], "cers": null, "siteMode": null, "hostNameSslStates": [ { "name": "[REDACTED]", "sslState": 0, "ipBasedSslResult": null, "virtualIP": null, "virtualIPv6": null, "thumbprint": null, "certificateResourceId": null, "toUpdate": null, "toUpdateIpBasedSsl": null, "ipBasedSslState": 0, "hostType": 0 }, { "name": "[REDACTED]", "sslState": 0, "ipBasedSslResult": null, "virtualIP": null, "virtualIPv6": null, "thumbprint": null, "certificateResourceId": null, "toUpdate": null, "toUpdateIpBasedSsl": null, "ipBasedSslState": 0, "hostType": 1 } ], "computeMode": null, "serverFarm": null, "serverFarmId": "[REDACTED]", "reserved": true, "isXenon": false, "hyperV": false, "lastModifiedTimeUtc": "2024-03-11T20:28:25.5433333", "storageRecoveryDefaultState": "Running", "contentAvailabilityState": 0, "runtimeAvailabilityState": 0, "dnsConfiguration": {}, "vnetRouteAllEnabled": false, "containerAllocationSubnet": null, "useContainerLocalhostBindings": null, "vnetImagePullEnabled": false, "vnetContentShareEnabled": false, "siteConfig": { "numberOfWorkers": 1, "defaultDocuments": null, "netFrameworkVersion": null, "phpVersion": null, "pythonVersion": null, "nodeVersion": null, "powerShellVersion": null, "linuxFxVersion": "PYTHON|3.9", "windowsFxVersion": null, "windowsConfiguredStacks": null, "requestTracingEnabled": null, "remoteDebuggingEnabled": null, "remoteDebuggingVersion": null, "httpLoggingEnabled": null, "azureMonitorLogCategories": null, "acrUseManagedIdentityCreds": false, "acrUserManagedIdentityID": null, "logsDirectorySizeLimit": null, "detailedErrorLoggingEnabled": null, "publishingUsername": null, "publishingPassword": null, "appSettings": null, "metadata": null, "connectionStrings": null, "machineKey": null, "handlerMappings": null, "documentRoot": null, "scmType": null, "use32BitWorkerProcess": null, "webSocketsEnabled": null, "alwaysOn": true, "javaVersion": null, "javaContainer": null, "javaContainerVersion": null, "appCommandLine": null, "managedPipelineMode": null, "virtualApplications": null, "winAuthAdminState": null, "winAuthTenantState": null, "customAppPoolIdentityAdminState": null, "customAppPoolIdentityTenantState": null, "runtimeADUser": null, "runtimeADUserPassword": null, "loadBalancing": null, "routingRules": null, "experiments": null, "limits": null, "autoHealEnabled": null, "autoHealRules": null, "tracingOptions": null, "vnetName": null, "vnetRouteAllEnabled": null, "vnetPrivatePortsCount": null, "publicNetworkAccess": null, "cors": null, "push": null, "apiDefinition": null, "apiManagementConfig": null, "autoSwapSlotName": null, "localMySqlEnabled": null, "managedServiceIdentityId": null, "xManagedServiceIdentityId": null, "keyVaultReferenceIdentity": null, "ipSecurityRestrictions": null, "ipSecurityRestrictionsDefaultAction": null, "scmIpSecurityRestrictions": null, "scmIpSecurityRestrictionsDefaultAction": null, "scmIpSecurityRestrictionsUseMain": null, "http20Enabled": false, "minTlsVersion": null, "minTlsCipherSuite": null, "supportedTlsCipherSuites": null, "scmMinTlsVersion": null, "ftpsState": null, "preWarmedInstanceCount": null, "functionAppScaleLimit": 0, "elasticWebAppScaleLimit": null, "healthCheckPath": null, "fileChangeAuditEnabled": null, "functionsRuntimeScaleMonitoringEnabled": null, "websiteTimeZone": null, "minimumElasticInstanceCount": 1, "azureStorageAccounts": null, "http20ProxyFlag": null, "sitePort": null, "antivirusScanEnabled": null, "storageType": null, "sitePrivateLinkHostEnabled": null }, "functionAppConfig": null, "daprConfig": null, "deploymentId": "[REDACTED]", "slotName": null, "trafficManagerHostNames": null, "sku": "Basic", "scmSiteAlsoStopped": false, "targetSwapSlot": null, "hostingEnvironment": null, "hostingEnvironmentProfile": null, "clientAffinityEnabled": false, "clientCertEnabled": false, "clientCertMode": 0, "clientCertExclusionPaths": null, "hostNamesDisabled": false, "ipMode": "IPv4", "vnetBackupRestoreEnabled": null, "domainVerificationIdentifiers": null, "customDomainVerificationId": "[REDACTED]", "kind": "app,linux", "managedEnvironmentId": null, "workloadProfileName": null, "resourceConfig": null, "inboundIpAddress": "13.77.182.13", "possibleInboundIpAddresses": "13.77.182.13", "ftpUsername": "[REDACTED]", "ftpsHostName": "ftps://waws-prod-mwh-029.ftp.azurewebsites.windows.net/site/wwwroot", "outboundIpAddresses": "13.77.161.10,52.183.26.12,52.175.235.45,13.77.178.124,13.77.182.13", "possibleOutboundIpAddresses": "13.77.161.10,52.183.26.12,52.175.235.45,13.77.178.124,52.183.34.217,13.66.206.87,13.77.172.226,52.183.34.132,13.77.180.8,20.112.59.90,20.112.61.147,20.112.63.92,20.112.63.133,20.112.63.173,20.112.63.193,20.99.138.182,20.99.199.228,20.112.58.245,20.112.59.161,20.120.136.0,20.120.136.18,13.77.182.13", "containerSize": 0, "dailyMemoryTimeQuota": 0, "suspendedTill": null, "siteDisabledReason": 0, "functionExecutionUnitsCache": null, "maxNumberOfWorkers": null, "homeStamp": "waws-prod-mwh-029", "cloningInfo": null, "hostingEnvironmentId": null, "tags": { "CostCenter": "[REDACTED]", "Engagement": "[REDACTED]", "Purpose": " ", "Environment": "Prod", "Owner": " ", "Eol": "NA", "Outcome": "Tagged", "BusinessCriticality": "High", "Department": "[REDACTED]", "Notes": "[REDACTED]", "ResourceServiceType": "Microsoft.Web/sites", "Schedule": " ", "CreatedBy": "[REDACTED]" }, "resourceGroup": "[REDACTED]", "defaultHostName": "[REDACTED]", "slotSwapStatus": null, "httpsOnly": true, "endToEndEncryptionEnabled": false, "functionsRuntimeAdminIsolationEnabled": false, "redundancyMode": 0, "inProgressOperationId": null, "geoDistributions": null, "privateEndpointConnections": [], "publicNetworkAccess": null, "buildVersion": null, "targetBuildVersion": null, "migrationState": null, "eligibleLogCategories": "AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs", "inFlightFeatures": [ "SiteContainers" ], "storageAccountRequired": false, "virtualNetworkSubnetId": null, "keyVaultReferenceIdentity": "SystemAssigned", "autoGeneratedDomainNameLabelScope": null, "defaultHostNameScope": 0, "privateLinkIdentifiers": null, "sshEnabled": true } }

Looking at this payload, this looks like it's a function or web app. Is this issue in the right repository?

The original issue was reported for a "Static Web Apps". Mine is the same issue for something called "App Services". I'm not sure what the differences are, but apparently both experience the same.

We have made a release recently that may have fixed the issue or at least improved the error messaging. Could you please let us know if you're still encountering the above issue? Thanks!

We have made a release recently that may have fixed the issue or at least improved the error messaging. Could you please let us know if you're still encountering the above issue? Thanks!

The error message is now Internal error: Expected value to be neither null nor undefined: defaultHostName

There's also Could not resolve resource "/subscriptions/<subscriptionID>/<some paths to the site>/"

Do you happen to have a containerized function app, by chance? In the same location of the app that is throwing this error?

Do you happen to have a containerized function app, by chance? In the same location of the app that is throwing this error?

No, I don't think so