Static Web App API Link Not Working

Henry LaFleur 0 Reputation points
2025-06-17T21:29:37.9966667+00:00

I want to unlink and relink an API from a Static Web App, but the Unlink button is not working (it does nothing). I recently added a custom domain with TLS to the static web site, and as soon as I did the Azure function link stopped working. I want to try to re-link it to see if I that will fix it.

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

3 answers

Sort by: Most helpful
  1. Henry LaFleur 0 Reputation points
    2025-06-17T21:43:20.4666667+00:00

    Your command was incorrect. The correct command is:

    az staticwebapp functions unlink --name <YourStaticWebAppName> --resource-group <YourResourceGroup>

    but unfortunately this did not fix anything. I re-linked using the Azure Portal, but it still does not work. There must be something wrong with the routes.

    0 comments No comments

  2. Henry LaFleur 0 Reputation points
    2025-06-18T14:20:13.92+00:00

    To provide more context, I am running the Azure URL Shortener, https://github.com/microsoft/AzUrlShortener, which I did a custom deployment using the magic button they used to provide (deploys using GitHub actions). The whole thing broke when I set up a custom domain with SSL and the link to the Azure function from the Static Web Site stopped working.

    I will upgrade my private repo to the latest version, backup the data, delete the old deployment, and redeploy from scratch (and restore data). Hopefully that will fix it.

    0 comments No comments

  3. Shree Hima Bindu Maganti 4,775 Reputation points Microsoft External Staff Moderator
    2025-06-18T18:06:06.27+00:00

    Hi@Henry LaFleur
    It appears that you're having trouble unlinking and relinking your API from the Static Web App. If the Unlink button isn't working, it might be a temporary issue with the Azure portal or a configuration problem.

    • In the Azure portal, go to the static web app.
    • Select APIs from the navigation menu.
    • Find the environment you want to unlink and select the API name.
    • Select Unlink.

    If the unlinking process doesn't complete successfully, check for any errors or notifications in the Azure portal for more details.

    After unlinking, you can relink the Azure Functions app

    • Open your Static Web Apps instance in the Azure portal.
    • From the Settings menu, select APIs.
    • From the Production row, select Link to open the Link new Backend window.
    • Enter the required settings and select Link.

    Ensure that the api_location value in the workflow configuration is set to an empty string before linking the existing Functions application.

    References:

    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.