Azure / Azure/static-web-apps

Blazor deployment with Functions API suddenly failing

Open
#1,690 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**UPDATE:**
It seems migrating to .NET 9 fixed the issue. I'm assuming the publish task for SWAs in DevOps no longer supports .NET 7 as it reached EOL recently. Re-opened issue in case others are experiencing similar.

Hi, we have a .NET Blazor application backed by an Azure Functions API that gets deployed to a Static Web App. Our build pipeline in DevOps has worked fine for several months but, suddenly today, it's experiencing an issue during the Static Web App publish step:

`Cannot deploy to the function app because Function language info isn't provided.`

The pipeline's YAML hasn't been changed in quite a while so we're completely stumped as to why this is suddenly occurring. Have there been any recent changes to SWA deployments that could be causing this?

Thank you in advance.

Snippet of our YAML (minus the restore, build, etc):

```
- task: DotNetCoreCLI@2
displayName: 'Publish main project'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(BuildConfiguration) --output src/main'
zipAfterPublish: false
modifyOutputPath: false

- task: DotNetCoreCLI@2
displayName: 'Publish Azure Functions project'
inputs:
command: 'publish'
projects: '$(ProjectName).AzureFunctions/$(ProjectName).AzureFunctions.csproj'
arguments: '--configuration $(BuildConfiguration) --output src/functions'
zipAfterPublish: false
modifyOutputPath: false
publishWebProjects: false

- task: DownloadPipelineArtifact@2
displayName: 'Download artifacts'
inputs:
path: 'src'

- task: AzureStaticWebApp@0
inputs:
skip_app_build: true
skip_api_build: true
output_location: ''
azure_static_web_apps_api_token: $(deployment-token)
app_location: 'src/main/wwwroot'
api_location: 'src/functions'
config_file_location: 'Deployment/v1'
```

The pipeline log prior to the error suggests that it's having no issues locating staticwebapp.config.json, which contains the `"apiRuntime": "dotnet-isolated:7.0"` key:

```
Try to validate location at: '/working_dir/src/main/wwwroot'.
App Directory Location: 'src/main/wwwroot' was found.
Try to validate location at: '/working_dir/swa-db-connections'.
Try to validate location at: '/working_dir/Deployment/v1/staticwebapp.config.json'.
config_file_location: config file 'Deployment/v1/staticwebapp.config.json' was found.
Looking for event info
Skipping step to build /working_dir/src/main/wwwroot with Oryx
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
Copying 'staticwebapp.config.json' to build output
Try to validate location at: '/working_dir/src/functions'.
Api Directory Location: 'src/functions' was found.
Skipping step to build /working_dir/src/functions with Oryx
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.