Make Azure VM image publically deployable - azure

I have have created a Resource Manager VM image in Azure and this is publically accessible from the web and can be downloaded.
From what I can see, users can download this image if they wanted to and upload it into their Azure subscription.
Is it possible to deploy this image from our Azure blob storage, from the PowerShell examples and .NET SDK it says it has to be in the same subscription and location.

The documentation is correct, you need to first copy the image to a storage account in the subscription where you want to create the VM from.
The alternative, and sounds like it might meet your objective, is to publish the image into the marketplace. You can also provide an ARM template to allow users to configure it before deployment.
https://azure.microsoft.com/en-gb/documentation/articles/marketplace-publishing-vm-image-creation/
For an walkthrough on creating ARM templates (not VMs but the same tools/principals apply) - please see my blog post https://russellyoung.net/2016/04/15/arm-cd-vsts/

Related

Azure ARM Template Deployment task is not able to download Templates from Storage Account(Configured via Vnet/subnet)

I am using Linked Template to deploy ARM template in Target env, While deploying I am storing the templates in blob contaier using “Azure File Copy” and generating URL and SAS token for the container.
But As my Storage account is configured via VNet/Subnet private endpoint, My ARM template deployment task is failing to download the Templates from the storage account.
I am checking for a workaround here, Please help me as soon as possible.
If you use Microsoft-hosted agents, please refer to this doc: Allowed address lists and network connections to configure your VNet/Subnet.
If you use private agents in pipeline, it will access to your Storage account via local network, please make sure that the local network can access to your Storage account.
In addition, you need to set up valid Azure Resource Manager service connection when using this Azure Resource Manager (ARM) Template Deployment Task.

Azure: Deploy VM in another tenant

I'm new to Azure and trying to setup an automation.
My questions is, is it possible to deploy virtual machine in another tenant using arm template? I saw these two links in Azure, but did not give me clear idea how I can use that.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/share-images-across-tenants
https://github.com/Azure/azure-cli/issues/11151
Scenario: Two tenants, tenantA and tenantB. I have SIG setup in tenantA and I want to be able to deploy VM in tenantB using image from SIG in tenantA. I'm currently using Azure Java SDK to do so but I was wondering if I can do it using ARM template?
Thanks in advance!
First, follow the instructions in https://learn.microsoft.com/en-us/azure/virtual-machines/windows/share-images-across-tenants to share the VM image with tenant B.
Once that is done, you can reference this quickstart to create an ARM template using the shared image https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-sig/

Create Classic VM from VHD in Azure

I have a server in Classic ASM which I want to move to another subscription.
I tried using the move feature on the portal but it throws error that target subscription is not empty.
Are there any way that I can recreate the classic VM from its VHDs and also migrate its IP address to the new Subscription.
I don't want the Generalise the VM.
Thanks.
I tried using the move feature on the portal but it throws error that target subscription is not empty.
If you want to move ASM resources to a new subscription, you should note:
All classic resources in the subscription must be moved in the same operation.
The target subscription must not contain any other classic resources.
The move can only be requested through a separate REST API for classic moves. The standard Resource Manager move commands don't work when moving classic resources to a new subscription.
To move classic resources to a new subscription, use the REST operations that are specific to classic resources, refer to this link.
Besides, if it is possible, I recommend you to use ARM nowadays, Microsoft released a new management model called Azure Resource Manager (ARM) which provides many new capabilities to manage, and control Azure resources. You could migrate the VM from ASM to ARM, refer to this link. And move it to another subscription, refer to this link.
The client does not plan to migrate to ARM currently.
To migrate the VM to another subscription, I followed the below steps and it worked well.
1- Copy the VM's VHDs to the destination storage account.
2- Create VM Image (Classic) using the VHD which was copied and then create VM out of it.
3- Unfortunately, I was unable to find a way to migrate the public IP address to another subscription.

How do I configure which storage account my Web Apps and Function Apps use?

Is this even possible? I have a couple web apps and a couple of Azure Functions running under the same App Service Plan. I'd like to (ideally) have them use a specific Storage plan, so I can keep everything in one place. I envision them in different containers under the same plan.
If that's not possible...then where are the files? Are they on the storage that's built into the App Service Plan itself? If so, can I connect to this somehow, so I can manage the files through something like Storage Explorer?
Today when playing with the Azure Az Powershell tool I found I was able to provision a Function App without a Azure Storage back-end. This cannot be done via the UI. An easy way to provision a Function App with a storage account backend is by leveraging the Azure UI for provisioning.
When a Function App is provisioned via command line, the bits seem to be stored within the function app itself. There is an FTP URL given if you download the publish profile. The files can be read and written to using an FTP tool like WinSCP (as alternative to Kudu)
I'd like to (ideally) have them use a specific Storage plan, so I can keep everything in one place. I envision them in different containers under the same plan. If that's not possible...then where are the files? 
Every Azure Web App has a home directory stored/backed by Azure Storage. More detail info please refer to Azure WebApp sandbox. It is owned by Azure WebApp Service, we are not able to choose Azure Storage to setup WebApp by ourselves currently. But we could config storage account for Azure WebApp Diagnostic logs.
Are they on the storage that's built into the App Service Plan itself? If so, can I connect to this somehow, so I can manage the files through something like Storage Explorer?
Different WebApp Service Plan has different volume of the storage. We could use Kudu tool (https://yoursite.scm.azurewebsites.net) to manage the files. More detail info about Kudu please refer to the document.
Update:
We could access the home directory with the Kudu tool. More details please refer to the snapshoot

Azure Resource Manager: Restore VM from existing disk

I have a storage account with as OS-disk blob and would like to redeploy the VM.
Under the classic deployment system I could simply choose from disk when creating a new VM, but I cant find that functionality on the new portal, it only offers the marketplace. The disk is in the new format so I cant use the classic portal.
Thanks
As noted in the comments, you can't do this end-to-end in the new portal yet.
Here's an Azure Resource Manager template to deploy a VM from an OS-disk blob: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-specialized-vhd-new-or-existing-vnet
Using the "Deploy to Azure" button takes you to the new portal to enter parameters. The readme also includes PowerShell instructions.
This write-up also covers capturing an image, and links to some of the options for creating the image using different versions of PowerShell.. http://www.codeisahighway.com/how-to-capture-your-own-custom-virtual-machine-image-under-azure-resource-manager-api/

Resources