I am learning how to use the Windows Azure REST API to create virtual machines in a Windows Azure environment. Looking at the Windows Azure REST API link, I see that the URL to which the POST request should be made is as follows:
https://management.core.windows.net/<subscription-id>/services/hostedservices/<cloudservice-name>/deployments/<deployment-name>/roles
My confusion here is related to the need for <cloudservice-name> and <deployment-name> . In fact, if I sign up directly to my Windows Azure subscription portal and go through the menu to create a virtual machine, I DO NOT have to provide a cloud name or deployment name. All I do is select the image (centos, ubuntu, windows, etc.) for the virtual machine, select the taste (xsmall, small, large, etc.) for the virtual machine and click "Create", and a virtual machine will be created in a few minutes,
Given that I could create a virtual machine this way, I donโt understand why I need to pass the <cloudservice-name> and <deployment-name> parameters in the curl REST API call and what values โโto pass to these parameters. In fact, I do not have a deployment in my subscription, and I do not intend to have it. All I want to do is just create a virtual machine that I could use.
Is it possible for me to skip these options and still be able to create a virtual machine in my Azure subscription? those. only by skipping <subscription-id> ?
Can someone who has used the Windows Azure REST API before or someone who has experience with Windows Azure shed some light on this and helps clarify?
Update Wed, 07/31/2013: Thanks again for the feedback on my question. I would like to update that I managed to get to the point where I was finally able to create a virtual machine using a REST API call. But it is strange that the creation of a virtual machine only worked successfully once. Subsequently, when I tried to create a virtual machine with a different name, it threw an error, for example, "Deployment Lock". So for the sake of sanity, I went ahead and deleted the existing virtual machine and did some cleaning up the account. I tried the POST operation to create the virtual machine again, and now it happens that the POST response is returned with the message 202 Accepted, but despite this, I DO NOT see the virtual machine created in my Azure account. I donโt know where and how to even start fixing this problem, given that I am not getting an error, and a virtual machine is being created.
I am placed below the whole body of the XML request that I submit to create the virtual machine:
<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Name>Staging</Name> <DeploymentSlot>Staging</DeploymentSlot> <Label>stk_curl_label_1</Label> <RoleList> <Role> <RoleName>stk_curl_role_1</RoleName> <RoleType>PersistentVMRole</RoleType> <ConfigurationSets> <ConfigurationSet> <ConfigurationSetType>WindowsProvisioningConfiguration</ConfigurationSetType> <ComputerName>stkVm1</ComputerName> <AdminPassword>Password123</AdminPassword> <EnableAutomaticUpdates>false</EnableAutomaticUpdates> </ConfigurationSet> </ConfigurationSets> <OSVirtualHardDisk> <HostCaching>ReadWrite</HostCaching> <DiskLabel>Visual studio ultimate</DiskLabel> <DiskName>stk_disk_1</DiskName> <MediaLink>http://stk11.blob.core.windows.net/communityimages/visual_studio_ultimate.vhd</MediaLink> <SourceImageName>03f55de797f546a1b29d1b8d66be687a__Visual-Studio-2013-Preview-Ultimate-12.0.20617.1</SourceImageName> </OSVirtualHardDisk> <RoleSize>ExtraSmall</RoleSize> </Role> </RoleList> </Deployment>
And I insert below the tail of the response that I get to call curl:
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: management.core.windows.net > Accept: */* > x-ms-version: 2012-03-01 > Content-Type: application/xml > Content-Length: 1236 > Expect: 100-continue > * SSLv3, TLS handshake, Hello request (0): SSLv3, TLS handshake, Client hello (1): SSLv3, TLS handshake, Server hello (2): SSLv3, TLS handshake, CERT (11): SSLv3, TLS handshake, Request CERT (13): SSLv3, TLS handshake, Server finished (14): SSLv3, TLS handshake, CERT (11): SSLv3, TLS handshake, Client key exchange (16): SSLv3, TLS handshake, CERT verify (15): SSLv3, TLS change cipher, Client hello (1): SSLv3, TLS handshake, Finished (20): SSLv3, TLS change cipher, Client hello (1): SSLv3, TLS handshake, Finished (20): HTTP/1.1 100 Continue HTTP/1.1 202 Accepted < Cache-Control: no-cache < Content-Length: 0 < Server: 33.0.6198.68 (rd_rdfe_stable.130710-0833) Microsoft-HTTPAPI/2.0 < x-ms-servedbyregion: ussouth < x-ms-request-id: b2f3dd01319049a5a6728bbdbcde6c4a < Date: Wed, 31 Jul 2013 17:26:54 GMT * Connection
As you can clearly see, this is the answer "202 accepted." But, as I mentioned earlier, despite this, when I check my Azure account, I do not see the creation of a virtual machine.
Would thank any expert information / ideas on how to decide why it is not working properly?