microsoft / studentambassadors

This repository is for Microsoft Learn Student Ambassadors.
MIT License
124 stars 48 forks source link

Issue in azure static webapps workflow file #22

Open varma59 opened 1 year ago

varma59 commented 1 year ago

Describe the bug

When i tried to create a azure static website with file sources from my GitHub. The resources are also deployed successfully in Azure and is done with other works in Azure website and when i visit the GitHub workflow status there is an issue in the build and deploy job.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Azure static apps'
  2. Click on 'Create a new resource group'
  3. Scroll down to 'Source - GitHub'
  4. See error 'In runs page'

Expected behavior

As expected, the website is not deployed in the URL, but we get mails as issues every time we make a change.

Screenshots

image

Desktop (please complete the following information):

Additional context

Below of the image we see App Directory Location: '/' was found. Looking for event info The content server has rejected the request with: BadRequest Reason: No matching Static Web App was found or the api key was invalid.

softchris commented 1 year ago

thank you for submitting this @varma59

saragibby commented 1 year ago

Hi @varma59! Working to reproduce this locally, could you also share a link to the GitHub repo you are deploying? It sounds like the error may have to do with how the web site is set in the repo and what Static Web Apps is expecting or looking for. Seeing your repo would be super helpful so I can track this down.

Thanks! Sara

varma59 commented 1 year ago

Okay, I will be attaching my repo link https://github.com/varma59/varma59.github.io

saragibby commented 1 year ago

Thanks for sharing your repo @varma59 and apologies for the delay here. When looking at your repo and failing workflows it looks like there may be an issue with your Azure SWA token that is being used for deploying. I woudl try to rest your API token to see if you continue to get the same errors.

Here are a few links to give you some guidance: https://learn.microsoft.com/azure/static-web-apps/deployment-token-management https://learn.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions https://github.com/Azure/static-web-apps/issues/193

Let me know questions you have resetting your token, and once you do, if that resolved the error you are seeing.

Thanks! Sara

saragibby commented 1 year ago

@varma59 it also looks like you have 3 GitHub workflows for SWA: image

Would be helpful to remove the ones you are no longer using, to help ensure all the pieces (workflow, repo, SWA subscription, token) all align.

varma59 commented 1 year ago

@saragibby Thankyou for your reply. I followed what you said and now they are no issues with that repo.