actions-workflow-samples icon indicating copy to clipboard operation
actions-workflow-samples copied to clipboard

Action for Deploying to Azure VM

Open bennettnw2 opened this issue 2 years ago • 4 comments

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.

bennettnw2 avatar May 03 '23 16:05 bennettnw2

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

mukeshsalaria01 avatar Jul 22 '23 18:07 mukeshsalaria01

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 [email protected]"

Create app directory

WORKDIR /app

Bundle app source

COPY . .

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

TheProdigyLeague avatar Oct 14 '23 00:10 TheProdigyLeague

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

GeethaK18 avatar Feb 08 '24 05:02 GeethaK18

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 @<anonymous>:1:14 ['VM4588']:1 <VisualStudio>

TheProdigyLeague avatar Mar 19 '24 18:03 TheProdigyLeague