Azure SWA can't enable configuration changes in the configuration blade

Rafe Anderson 0 Reputation points
2024-07-24T15:47:27.1233333+00:00

I have an Azure SWA. I have made changes to the staticwebapp.config.json, but the changes are not applying when I deploy. I am deploying via the swa cli.

In the portal, when I navigate to the Configuration blade of my SWA I am unable to apply the checkbox setting for "Enable configuration file changes". When I check the box the "Save" button remains grey. If I navigate away and return the checkbox is no longer checked.

How am I able to propagate these changes?

Any help is appreciated.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
893 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rafe Anderson 0 Reputation points
    2024-07-24T17:13:55.5333333+00:00

    I figured out my problem.

    When you first run the swa cli deploy it will take the config file it finds and copy it to the source directory. It does not update or replace this in subsequent deploys. You must delete the file each time you deploy if your distribution directory is not removed between builds and deployment.

    0 comments No comments

  2. Grmacjon-MSFT 17,886 Reputation points
    2024-07-24T20:36:51.27+00:00

    Hello@Rafe Anderson I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    -You made changes to the staticwebapp.config.json for my Azure Static Web App (SWA), but they aren’t applying when you deploy via the SWA CLI.

    -In the Azure portal, you can’t enable the “Enable configuration file changes” checkbox as the “Save” button remains greyed out and the checkbox doesn’t stay checked. You want to know how to ensure these changes are propagated

    Solution:

    -"When you first run the SWA CLI deploy it will take the config file it finds and copy it to the source directory. It does not update or replace this in subsequent deploys. You must delete the file each time you deploy if your distribution directory is not removed between builds and deployment."

    Best,

    -Grace

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.