2

In short, taking action

Visual Studio 2022 > Publish > Deployment type > CI/CD using GitHub Actions workflows (generates yml file)

Throws error

Visual Studio 22 was unable to set secret '(Azure App Service name)_FFFF' because you may not have collaborator access to the repository '_git/(name)'

More detailed steps

  1. Install Visual Studio 2022
  2. Sign in with
  3. Scaffold project
  4. Adapt scaffolded code to requirements
  5. Publish

Publish steps

  1. Right click publish
  2. Add a publish profile
  3. Target > Azure
  4. Azure App Service (Windows)
  5. Set subscription name VS professional, view correct resource group, able to select correct App Service instance
  6. Select deploy as .zip package to true
  7. Choose CI/CD using GitHub Actions workflows (generates yml file)

Microsoft Visual Studio Visual Studio was unable to set secret because you may not have collaborator access to the repository

wvt
  • 31
  • 4
  • I guess a workaround can be: Create and edit yml file in Azure DevOps (Pipelines > Pipelines) – wvt Nov 23 '21 at 14:23
  • Are you sure you are using VS2022 . I have tried to repro but unable to find ``` **CI/CD using GitHub Actions workflows (generates yml file)** option – Harshitha Veeramalla Nov 24 '21 at 06:03
  • Tried to enable the option from Tools but unable to find the **GitHub Actions Support in Publish** option in VS2022, where as i can see the option in VS2019. [Imgur: The magic of the Internet](https://imgur.com/kJtkIHI) – Harshitha Veeramalla Nov 24 '21 at 06:05

1 Answers1

-1

I was able to fix this by recreating the repo. BE VERY CAREFUL WHILE DOING THIS.

  1. Delete the repo from github (optional step and dangerous)
  2. In the root directory of your local repo, show hidden files and delete the .git folder.
  3. Restart visual studio.
  4. Recreate the repo from visual studio.

This is probably NOT the best answer, it worked for me. But there was some bug in my git repo not allowing it see me as the owner of the repo.