Unable to deploy my ASP.NET web app using Azure, Login error appears on Github - Stack Overflow

I'm attempting to deploy an ASP.NET web app using Azure by setting up continuous deployment throug

I'm attempting to deploy an ASP.NET web app using Azure by setting up continuous deployment through Github.

I went through the steps of creating a new web app on the Azure portal, connected it to my Github repo, and deployed it. On the Azure side of things, everything runs successfully and I'm told that the deployment worked. But when I navigate to view my app, I get a blank page, it doesn't work.

Upon checking my Github repo for the app, I noticed a failed deployment error. The app builds fine, but the following error log appears:

2025-03-12T20:26:46.7645361Z Running Azure CLI Login.
2025-03-12T20:26:53.5408785Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" cloud set -n azurecloud"
2025-03-12T20:26:54.2644293Z Done setting cloud: "azurecloud"
2025-03-12T20:26:54.4333175Z Federated token details:
2025-03-12T20:26:54.4335750Z  issuer - 
2025-03-12T20:26:54.4336665Z  subject claim - repo:KyleHoc/Omnia:environment:Production
2025-03-12T20:26:54.4337388Z Attempting Azure CLI login by using OIDC...
2025-03-12T20:27:03.5562068Z ##[error]No subscriptions found for ***.

2025-03-12T20:27:03.8902139Z ##[error]Login failed with Error: The process 'C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd' failed with exit code 1. Double check if the 'auth-type' is correct. Refer to  for more information.

I'm pretty new to Azure but I currently have another deployed app on my subscription that works fine, so I don't understand why it's saying "No subscriptions found for ***"

It's also confusing to me that this error appears on Github even though on Azure it says the deployment was a success (even though my app does not work). I really don't get what's going on.

EDIT: Github Actions Workflow file

# Docs for the Azure Web Apps Deploy action: 
# More GitHub Actions for Azure: 

name: Build and deploy ASP.Net Core app to Azure Web App - OmniaWebDevTest

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    permissions:
      contents: read #This is required for actions/checkout

    steps:
      - uses: actions/checkout@v4

      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'

      - name: Build with dotnet
        run: dotnet build --configuration Release

      - name: dotnet publish
        run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"

      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: -app
          path: ${{env.DOTNET_ROOT}}/myapp

  deploy:
    runs-on: windows-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
    permissions:
      id-token: write #This is required for requesting the JWT
      contents: read #This is required for actions/checkout

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v4
        with:
          name: -app
      
      - name: Login to Azure
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CB48100DBA1947F78C42C2A6D1438B7D }}
          tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5B5424504A3241BEAA63F9FCBFE282A7 }}
          subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4C0A6941CDAD4177B92253E180A342E9 }}

      - name: Deploy to Azure Web App
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'OmniaWebDevTest'
          slot-name: 'Production'
          package: .

I'm attempting to deploy an ASP.NET web app using Azure by setting up continuous deployment through Github.

I went through the steps of creating a new web app on the Azure portal, connected it to my Github repo, and deployed it. On the Azure side of things, everything runs successfully and I'm told that the deployment worked. But when I navigate to view my app, I get a blank page, it doesn't work.

Upon checking my Github repo for the app, I noticed a failed deployment error. The app builds fine, but the following error log appears:

2025-03-12T20:26:46.7645361Z Running Azure CLI Login.
2025-03-12T20:26:53.5408785Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" cloud set -n azurecloud"
2025-03-12T20:26:54.2644293Z Done setting cloud: "azurecloud"
2025-03-12T20:26:54.4333175Z Federated token details:
2025-03-12T20:26:54.4335750Z  issuer - https://token.actions.githubusercontent
2025-03-12T20:26:54.4336665Z  subject claim - repo:KyleHoc/Omnia:environment:Production
2025-03-12T20:26:54.4337388Z Attempting Azure CLI login by using OIDC...
2025-03-12T20:27:03.5562068Z ##[error]No subscriptions found for ***.

2025-03-12T20:27:03.8902139Z ##[error]Login failed with Error: The process 'C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd' failed with exit code 1. Double check if the 'auth-type' is correct. Refer to https://github/Azure/login#readme for more information.

I'm pretty new to Azure but I currently have another deployed app on my subscription that works fine, so I don't understand why it's saying "No subscriptions found for ***"

It's also confusing to me that this error appears on Github even though on Azure it says the deployment was a success (even though my app does not work). I really don't get what's going on.

EDIT: Github Actions Workflow file

# Docs for the Azure Web Apps Deploy action: https://github/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github/Azure/actions

name: Build and deploy ASP.Net Core app to Azure Web App - OmniaWebDevTest

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    permissions:
      contents: read #This is required for actions/checkout

    steps:
      - uses: actions/checkout@v4

      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'

      - name: Build with dotnet
        run: dotnet build --configuration Release

      - name: dotnet publish
        run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"

      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: -app
          path: ${{env.DOTNET_ROOT}}/myapp

  deploy:
    runs-on: windows-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
    permissions:
      id-token: write #This is required for requesting the JWT
      contents: read #This is required for actions/checkout

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v4
        with:
          name: -app
      
      - name: Login to Azure
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_CB48100DBA1947F78C42C2A6D1438B7D }}
          tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5B5424504A3241BEAA63F9FCBFE282A7 }}
          subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4C0A6941CDAD4177B92253E180A342E9 }}

      - name: Deploy to Azure Web App
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'OmniaWebDevTest'
          slot-name: 'Production'
          package: .
Share Improve this question edited Mar 13 at 15:38 Kyle Hochdoerfer asked Mar 12 at 21:07 Kyle HochdoerferKyle Hochdoerfer 11 bronze badge 7
  • First of all, please include your GitHub Error Log in the question itself instead of using an image. Secondly, please include your GitHub Actions Workflow file so we can help you debug it. – akseli Commented Mar 13 at 0:31
  • @Kyle Hochdoerfer How do you authenticate GitHub Actions to Azure using Basic or User Identity? – Aslesha Kantamsetti Commented Mar 13 at 5:04
  • @Kyle Hochdoerfer Check your secret variable in GitHub settings and make sure to paste the correct SubscriptionId. – Aslesha Kantamsetti Commented Mar 13 at 5:06
  • @akseli Understood. I've edited my question and added the error log and the Github Workflow file – Kyle Hochdoerfer Commented Mar 13 at 15:41
  • @AsleshaKantamsetti When I set up the web app using the Azure portal, I enabled CD to deploy using Github Actions, and then selected my repo on that page. Is that what you're referring to? Sorry, still new to Azure And for the SubscriptionId, you're saying to check the Action Secrets page on my repo and make sure that the subscription ID secret matches the subscription ID from my app, correct? – Kyle Hochdoerfer Commented Mar 13 at 15:53
 |  Show 2 more comments

1 Answer 1

Reset to default 0

2025-03-12T20:27:03.5562068Z ##[error]No subscriptions found for ***.
2025-03-12T20:27:03.8902139Z ##[error]Login failed with Error: The process 'C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd' failed with exit code 1. Double check if the 'auth-type' is correct. Refer to https://github/Azure/login#readme for more information.

The above error occurs because an incorrect subscription ID is passed when GitHub logs into Azure for deployment through the Azure CLI.

When we create a CI/CD pipeline through the Deployment Center, we have the option to select an authentication type. In your case, it is User-assigned identity, as shown below.

After linking GitHub and Azure for deployment, you can find a Managed Identity with the same name as your Web App. Copy the Client Id and Subscription Id

Goto Directories + Subscriptions Copy the Directory ID (Tenant Id).

Paste the copied values into your GitHub repository by navigating to GitHub Repository -> Settings -> Secret and Variables -> Actions -> Secrets -> Edit as shown below. Then, re-run all jobs in the `Actions` tab of your GitHub repository. This will resolve the issue.

OR Disconnect the Github in the Deployment centre of Azure Web App.

Log out of your GitHub account, click on `Change Account`, then log back in and create a new GitHub deployment.

Workflow File:

name: Build and deploy ASP.Net Core app to Azure Web App - kaaspnetapp
on:
  push:
    branches:
      - master
  workflow_dispatch:
jobs:
  build:
    runs-on: windows-latest
    permissions:
      contents: read 
    steps:
      - uses: actions/checkout@v4
      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'
      - name: Build with dotnet
        run: dotnet build --configuration Release
      - name: dotnet publish
        run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"
      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: -app
          path: ${{env.DOTNET_ROOT}}/myapp
  deploy:
    runs-on: windows-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
    permissions:
      id-token: write 
      contents: read 
    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v4
        with:
          name: -app
      - name: Login to Azure
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3E3B8941AAC746ABA3E292FE89C2D1CC }}
          tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_968F48A3EFA847399BF0C0863219C69A }}
          subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_ABE5FBBE5C974F43A100974D1B706525 }}
      - name: Deploy to Azure Web App
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'kaaspnetapp'
          slot-name: 'Production'
          package: .

Azure Output:

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744730189a4590420.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信