Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Static Web Apps - Limit 104857600 bytes - Why? #1537

Open
JoelMTaylor opened this issue Sep 2, 2024 · 0 comments
Open

Azure Static Web Apps - Limit 104857600 bytes - Why? #1537

JoelMTaylor opened this issue Sep 2, 2024 · 0 comments

Comments

@JoelMTaylor
Copy link

I am trying to deploy a Retype app to Azure Static Web Apps using GitHub Actions. Retype is a tool that generates websites from Markdown files. However, I get the following error during the deployment:

The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.

I have done research on the issue, and most other Q&A posts are related to Next.js or some other language that I am not using. Thus, I created a new post because none of the other information has been relevant.

I checked the size of my wwwroot folder, which contains the output of the Retype build, and it is about 50 MB (according to Windows Explorer). Also, the whole repo (in WinEx) is 90 MB.

I also checked the quotas for Azure Static Web Apps, and it says that the maximum size per app is 250 MB (free plan) and 500 MB (standard plan). We changed from the free to the standard plan to attempt to fix the problem, but nothing changed.

So, I have two questions:

  1. Am I correct in assuming that I should be able to create a Static Web App with a size of 250 MB like the documentation quota describes? Or, is there something that I am missing or misunderstanding that causes the quota to be lower and I can really only use 100 MB as my error describes?
  2. If I should be able to use 250 MB (or 500 MB), how can I achieve this?

I have tried some of the solutions suggested in these links, such as removing the cache folder or using a bundler, but they did not work for me. Also, I'm unsure how to apply 'solutions' that are for Next.js, since my page (Retype built) doesn't use this. 1 2 3

.github/workflows code

I have two .yml files in the workflows folder. Below are the two files and some of their code.

retype-action.yml

build_and_deploy_job:
    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    needs: publish
    name: Build and Deploy to Azure Static Web Apps
    steps:
      - uses: actions/checkout@v3
       with:
          submodules: true
      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
          repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e., PR comments)
          action: "upload"
          ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
          # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
          app_location: "/wwwroot/" # App source code path
          api_location: "/" # Api source code path - optional
          output_location: "" # Built app content directory - optional
          app_build_command: 'npm run build-ui-prod'
          api_build_command: 'npm run build-api-prod'
          ###### End of Repository/Build Configurations ######
  close_pull_request_job:
    if: github.event_name == 'pull_request' && github.event.action == 'closed'
    runs-on: ubuntu-latest
    name: Close Pull Request Job
    steps:
      - name: Close Pull Request
        id: closepullrequest
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
          action: "close"

azure...[secret].yml

name: Azure Static Web Apps CI/CD
on:
  workflow_dispatch:
  push:
    branches:
      - published
  pull_request:
    types: [opened, synchronize, reopened, closed]
    branches:
      - published
jobs:
  build_and_deploy_job:
    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') || github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    name: Build and Deploy Job
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
          repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e., PR comments)
          action: "upload"
          ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
          # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
          app_location: "/wwwroot/" # App source code path
          api_location: "/" # Api source code path - optional
          output_location: "" # Built app content directory - optional
          app_build_command: 'npm run build-ui-prod'
          api_build_command: 'npm run build-api-prod'
          ###### End of Repository/Build Configurations ######
  close_pull_request_job:
    if: github.event_name == 'pull_request' && github.event.action == 'closed'
    runs-on: ubuntu-latest
    name: Close Pull Request Job
    steps:
      - name: Close Pull Request
        id: closepullrequest
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets.[AZURE SECRET] }}
          action: "close"

In link 1 above, the app and API build commands were suggested as a solution, but this didn't work. The suggestion was:

app_build_command: 'npm run build'
api_build_command: 'rm -rf ./node_modules/@next/swc-* && rm -rf ./.next/cache'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant