I need to change the git hub repository connected to my azure static web app. i have ran the command to disconnect the repo using azure cli and when tried to reconnect, getting error

Raees Kamba 1 Reputation point
2023-10-06T05:06:53.05+00:00

I need to change the git hub repository connected to my azure static web app. i have ran the command to disconnect the repo using azure cli and when tried to reconnect, getting error

az : WARNING: Static Web App raeestest already exists in resource group DEMO
At line:1 char:1
+ az staticwebapp reconnect -n raeestest --source https://github.com/Ra ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (WARNING: Static...urce group DEMO:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,175 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-10-10T16:52:11.3766667+00:00

    Hi @Raees Kamba thanks for the question.

    Based on this SO thread here is how to change the git hub repository:

    1. Get the workflow YAML file from the existing repository and add it to the new one.
    2. Add the secret to the new repository with the same key (secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_...) and the deployment token.
    3. Grab the Deployment token from the Azure static web app, Manage deployment token link.

    Please note that if you need to change the branch, you can just edit the branch in the YAML file

    Hope that helps.

    -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.