Azure / actions-workflow-samples

Help developers to easily get started with GitHub Action workflows to deploy to Azure
https://github.com/Azure/actions
MIT License
447 stars 624 forks source link

Action for Deploying to Azure VM #143

Open bennettnw2 opened 1 year ago

bennettnw2 commented 1 year ago

I've been looking for information on how to deploy dockerized applications to an Azure VM. My search has led me to here what seems to be a dead-end. https://github.com/Azure/actions-workflow-samples/issues/32

Since I don't see an action for deploying to Azure virtual machines, I assume there is no action to deploy to Azure VMs. Is my assumption accurate? If so, and if there are no plans to support deploying an image or application to a virtual machine, feel free to close this issue.

mukeshsalaria01 commented 1 year ago

@bennettnw2 Any news on this? I'm looking for the same. Wants to deploy .net core 7.0 application to Azure VM using github actions.

TheProdigyLeague commented 11 months ago

doc

Looked at #32 User @raiyanalam seems to have answered it with a link to repo. dockerized apps deployed to vm I also found this...

name: create_custom_vm_image
on: [push]

jobs:
  BUILD-CUSTOM-IMAGE:
    runs-on: windows-latest    
    steps:
    - name: Checkout
      uses: actions/checkout@v2    
$Azure(cTM)/usr/login/cred.yml

    - name: Login via Az module
        uses: azure/login@v1
        with:
          creds: ${{secrets.AZURE_CREDENTIALS}}

$Azure(cTM)/usr/login/cred/createIMG.sh

    - name: CREATE APP BAKED VM IMAGE
      id: imageBuilder
      uses: azure/build-vm-image@v0
      with:
        location: 'eastus'
        resource-group-name: 'raivmdemo-rg'
        managed-identity: 'rai-identity2' # Managed identity as mentioned in pre-requisites.

        source-os-type: 'windows'
        source-image-type: 'platformImage'
        source-image: MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest #unique  identitifier of source image

        customizer-source: '${{ GITHUB.WORKSPACE }}\webApp'  # This folder gets injected to the image at directory location C:\
        customizer-script: |
          & 'c:\webApp\webconfig.ps1'

        dist-type: 'SharedImageGallery'
        dist-resource-id: '/subscriptions/${{ secrets.SUBSCRIPTION_ID }}resourceGroups/raivmdemo-rg/providers/Microsoft.Compute/galleries/appImageGallery/images/AppBakedVMs/versions/0.1.${{ GITHUB.RUN_ID }}' #Replace with the resource id of your shared image  gallery's image definition
        dist-location: 'eastus'

$Azure(cTM)/usr/login/cred/createVM.sh

    - name: CREATE VM
      uses: azure/CLI@v1
      with:
        azcliversion: 2.0.72
        inlineScript: |
          az vm create --resource-group raivmdemo-rg  --name "app-vm-${{ GITHUB.RUN_NUMBER }}"  --admin-username moala --admin-password "${{ secrets.VM_PWD }}" --location  eastus \
          --image "${{ steps.imageBuilder.outputs.custom-image-uri }}"              

$Azure(cTM)/usr/login/cred/createVM.sh
$Azure(cTM)/usr/login/cred/_node.js
$Azure(cTM)/usr/login/cred/AzureApp/Gallrey/BakedVM/node.js/

builder failed to delete resources `FROM node:8 LABEL maintainer="Azure App Services Container Images appsvc-images@microsoft.com"

Create app directory

WORKDIR /app

Bundle app source

COPY . .

EXPOSE 8080 80 CMD [ "npm", "start" ]` Basically, Devs posted this in response: token

GeethaK18 commented 7 months ago

Is there are any actions with which I can directly deploy the my published dotnet code to Azure VM (IIS) ?

TheProdigyLeague commented 5 months ago

Is there are any actions with which I can directly deploy the my published dotnet code to Azure VM (IIS) ?

Responses to what you are attempting to achieve have been inconsistent. But since then, no one else has commented or responded... The quick response is in the affirmative. Will the api most likely contain errors? Indeed. How are the developers going to address these errors? No. Basically, if you're authorized to do that, ask the Azure development team for approval.

actions: deploy publisher: GeethaK18 nodejs: GeethaK18.net server: Azure(cTM) Go through the basic development to deployment actions. ` [object Window] ▶ Main_menu | VM152 | ⮕ forms "ReferenceError 'require' not defined" [object Window] ▶ Main_menu | VM294 | ⮕ forms "ReferenceError 'require' not defined" ▶ Main_menu | VM609 | ⮕ forms ▶ Unexpected string @:1:14 ['VM4588']:1

`