I have successfully created an image of a VM using packer. The instance is an Ubuntu machine installed with nginx.
Now, when i want to fire up a ressource group with a load balancer and Auto-Scaling, i need to refer this image using a URI; but when i go to the image in Azure, the URI field is empty.
How do i get this URI, so i can set up my Auto Scale enviornment, with the template below?
Best,
Jonas
i need to refer this image using a URI; but when i go to the image in
Azure, the URI field is empty.
This is because that your Image is managed. With Managed Image, you wouldn't see the URI, just like manged disk.
How do i get this URI, so i can set up my Auto Scale enviornment, with
the template below?
Since your Image is managed , you cannot get the URI. However, you can still create VMSS from the managed Image with template.
You can use
"imageReference": {
"id": "[variables('managedImageId')]"
}
You can refer to this template. This template uses the Name and Group of the image to deploy VMSS.
Hope this helps!
Related
I want to access the path of the image/blog in the browser, I am using Django rest API and the package Azure storage, I tried to make the container storage public, but still had no luck in accessing the image, what could be wrong?
This is an example of the image I want to access, it's there in the storage but can't access it :
https://guiomentor-staging.azurewebsites.net/media/blog_images/images_3.jpeg
If you store your images in a container of a storage account and grant public to the container then you can access the images using a URL.
First create a container under the Containers tab in the storage and then set the access level to container .
Now click on the newly created container and then click on upload and upload images in the container .
Here I have uploaded two images If you click on the images a pop will immerge with the url of the that image
This url is publicly accessible and you can make get request to it in you django app
In Browser :
In Postman :
you don't even need to go the storage account for url
the urls will be of format :
https://<Storage Acount Name>.blob.core.windows.net/<Container>/<Image Name>
#Siddhartha Vikram answer is also correct using the azure storage.blob
I have been looking into the "logic apps designer' of Microsoft azure for a couple of days. Thank you for your help! I am stuck on the following:
Context
I wanted to perform some actions interacting between multiple files in a Dropbox. The logic app was not proposing an off-the-self solution, hence I created a python script that did exactly what I wanted.
I then decided to create an image of this script in order to be able to use it from the azure platform within the Logic Apps.
The containers registry contains the image I pushed to Azure and I created the container instance that includes only one image which is the python script.
Everything works.
Current structure
From what I read, it seems that we can run the container instance by using the action called create group container then adding a until action (run until state is equal to Succeeded) and finally using delete the container group.
I have a trigger that has been tested and that works.
Issue
When running the Logic App, the action create group container is failing:
"code": "InaccessibleImage",
"message": "The image '<name_of_the_image>' in container group '<name_of_the_group>' is not accessible. Please check the image and registry credential."
Question
How can I correct what seems to be a basic error on my part?
Where can this registry credential be appropriately corrected?
Update
I have tried removing everything, assigning myself "owner" role in the container registry, then adding the container instance, assigning myself "owner" role in the container instance, then rebuilt the logic app. I ran it again and I get the same error.
I figured the issue.
Since in my case, it is a private container registry, I needed to add the following the the action 'create group container': properties.imageRegistryCredentials.
In this, you will be required to enter the following information that are available in the Access keys of the container registry:
[
{
"password": "<yourpassword>",
"server": "<yourloginserver>",
"username": "<yourusername>"
}
]
So glad and I hope it helps others!
To set the credentials of ACI inside Create or update container group task in logic app you need to add a parameter (See the picture).
add parameter for ACI credentials
Is it possible to create a new VM (Azure RM) that uses an existing vhd disk (where everything is already set up) that is already on a storage account? In the new portal, I can't find any option for doing that. But can it be done by editing a template or by using PowerShell? Can anyone point me to any docs about this?
You can deploy an existing Vhd from both PowerShell and ARM Templates.
There are two methods of using an existing image. You can either directly attach that disk or you can use that disk as an image source.
If you look at the Create a Virtual Machine from a User Image template on Github. There is both a template and a PowerShell script.
Both of those are currently configured to make a copy of the Vhd and use that. If you want to directly attach your Vhd you would need to change this line (currently line 168) in the template
"createOption": "FromImage",
to
"createOption": "Attach",
You would do the same for the createoption of Add-AzureVMDataDisk
Yes you can create a Resource Manager VM from a VHD. It is possible through aRMT template. in Github there is a reference template, please edit and deploy that.
Thanks!
Sabha Mahadevan
I have created an image file in resource manager portal.And I tried to create multiple VMs using that created image file. But the exception occurs as follows: New-AzureRmVM : InvalidParameterConflictingProperties: The property 'imageReference' cannot be used together withproperty 'image'. I am able to create only one VM using that image file. Please let me know is there any solution.
Context:
Trying to create VMs in Azure (cloud) using VMSS in ARM mode and using json templates.
Problem:
Creating a VMSS from an os image and datadisk image using Azure CLI and json template creates new VMSS but not the datadisk.
My success so far:
Successfully created VMs using CLI with both os and data disk from a custom image using json template. Also successfully created VMSS (Virtual Machine Scale Set) from a valid custom os image using CLI with json template.
My research for problem:
There isn't any sample on github for this scenario git hub templates. Microsoft azure site also have sample for os disk only and not creating a VMSS with data disk.
blkid comand doesn't show the data disk at all, meaning it was never created and mounted. My json template virtualMachineProfile->storageProfile declares a valid dataDisks object and I know it's works as it successfully creates VM (not VMSS) with data disk and also CLI doesn't return any error.
I know json based template is new and Microsoft is working on adding more features/functionalities so my questions is "Is there anything wrong that I am doing and is it that creating VMSS with data disk is not yet implemented in Azure ?"
Environment: Linux (Debian/RHEL)
Azure CLI : 0.9.13 (ARM mode)
Azure Api: 2015-06-15
Image: (CentOS 6.7)
Thanks for your help.
As per this blog post VMSS and data disks, it is not yet supported. Such a bummer..... Hopefully Microsoft will soon release this feature before selling VMSS too much.