Logic app file created - azure

I am assigned to create an on-premise data gateway on a virtual machine in Azure. This way, I am able to watch new files created in a specific folder and trigger a logic app flow for every newly created file.
As the name says 'on-premise' I feel like there must be a better option.
Is there any trigger that is able to watch a certain folder on a VHD disk in a storage account?

Is there any trigger that is able to watch a certain folder on a VHD
disk in a storage account?
If my understanding is right, you want to watch files on a Azure storage account VHD. Currently, it is not possible. You need use the VHD to create a new VM or mount the VHD on a VM, then you could see the file in VHD.

Related

Upload Azure VM snapshot to Azure Blob Storage directly without saving VHD to local computer

We are taking over a VM image from another subscription, which we cannot access via the portal, so the snapshot download link is all we have.
I don't have enough disk storage on my computer to download the VHD from the download link provided by Azure so I'm wondering if there is a way to upload a file from URL directly to an Azure container? The image is roughly 120 gb.
The SAS url looks something like this:
https://{something}.blob.storage.azure.net/{something}/{something}
Thanks in advance!
If you have a SAS URI for your VM's Snapshot, you can use Copy Blobs functionality to perform server-side copy operation which will copy blob from one storage account to another without the need to download it locally.
You can use azcopy tool to perform this operation.

move file from azure vm to azure file storage

I have a Azure VM (Win 2016) where I have a folder where we have file coming every 5 minute.
Now I want to create and Window Service which will run on Azure VM and if any file exist, it will move to Azure File storage.
Could someone guide whats need to do or any other approach?
As I see it, you have 2 options:
Mount File Storage Share as a network drive. Once you mount the share as a network drive (and get a drive letter) you can simply use System.IO namespace to perform IO operations. Please see this link for more details: https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows.
Use Microsoft's Azure Storage SDK which is a wrapper over Azure Storage REST API and upload files from the local folder to the share in Azure File Storage. Please note that once the file is uploaded in Azure File Storage, you would need to manually delete the file from your server to achieve move operation.

Will my files will be lost if I stop and restart my Microsoft Azure Virtual Machine

Will my files and database will be lost if I stop or restart or my VM get crashed certainly.
Can the files created at VM be stored in my computer hard disk so that I can retrieve them in future, if I need.
If your VM get crashed you will not be able to access your VM as well as your data but that doesn't mean you will loss your data. Your data will be stored there in the blob storage.
What you need to do is- attach the blob storage properly to some other vm or new vm to access it again.
As previously mentioned this was answered on another thread, the best thing to do is to download the VHD locally.
From the Windows Azure Portal you can easily download the VHD. Just navigate to STORAGE and then the storage account in which your virtual disk is created. Select CONTAINERS (at the top), open the container named "vhds". Just click the vhd you want and select DOWNLOAD (at the bottom of the page).
Have a great day

Can you copy an Azure VM from one account to another account?

We created a VM for a client and set it all up on our account. A bunch of work. Now I'd like to put a copy of it on his Azure account (which he does not have yet) and keep my copy for troubleshooting. Is there a method I can use to backup the VM and restore it to his Azure account? Or any other suggested way to copy it to another account's VM?
Sure you can. Since VHD for your Virtual Machine is stored as Page Blob in Azure Storage, you can simply copy the blob from one storage account to another. You can use AzCopy tool to do that. There's no need for you to download the blob from main storage account and reupload it in backup storage account.
When you need to create a VM again, simply create an image using that blob and then create a VM from that image.
You can create Image and upload to the new account, You can check link for more information Create and upload a Windows Server VHD to Azure

Why does my custom VM Image not show up in Azure Create VM Interface?

I recently went through the hassle of creating and uploading a .VHD image containing a nice little Debian installation to my Azure Storage Account. It was created in Fixed Mode and uploaded as a PageBlob.
After a couple of attempts I was able to create an Image from my Blob, but I have no idea where to go from here.
Obviously, I want to create a VM instance from my image, but I can't figure out how to select my Image. I followed the NEW > Compute > Virtual Machine > From Gallery link, and there is a tab labeled My Images, but my image does not show up there.
Does anyone have an idea why?
EDIT: When I try to create a Disk from my Blob, I get the following Error:
The storage account does not support this operation. Please check the location of this storage account or create a new storage account and retry.
But the Disk is not associated with any storage account, or is it?
If you've uploaded your VHD you should be able to create a new disk using Virtual Machines > Disks > Create Disk this will prompt you for the url of the VHD you uploaded and allow you to specify the OS type and a name for the disk.
From there you can create a new Virtual Machine. New > Compute > Virtual Machine > From Gallery > My Disks
EDIT
I'm told by a colleague that some storage accounts do not support disks for VM's and a workaround can be to create a new VM using the portal (either from scratch or using a pre-made gallery image) this will create a storage account called something like portalvhdxxxxxxxx. You should then be able to upload your VHD to this storage account and create your disk from there.
I just ran into the same problem and this question helped me get around it. To provide more details, Azure VMs are not currently supported in certain data centers (such as North Central US). So if you create a storage account in an unsupported data center, you'll be able to upload vhd blobs and even create an image from it via the Azure portal. However that image will not show up under My Images when you attempt to spin up a VM from it.
It's pretty confusing but that seems to be what is happening. So if you want to store your vhd blobs in a storage account that isn't called portalvhdxxxxxx, just make sure your storage account is created in a data center that supports VMs. To figure out exactly what those data centers are, they are the data centers that you can choose when you quick create a VM directly on the portal.
I had the same issue, where I was unable to find the image in "Shared Images". However, I've learnt that the subscription under which I was trying to create the VM is different from the Subscription in which the Shared Image is present.
After, I have selected "Default Subscription filter" in portal settings to 'Select All', I was able to see the image in "Shared Images".
Note: Though it is a Shared Image, the Default Subscription should be set to 'Select All' when you are creating VMs across different subscriptions.

Resources