Azure REST API to create windows VM

kb3uyi Source

I have been sending "classic" Azure Service Manager REST calls to provision windows VMs. The XML I send is below:

<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>server20160427</Name>
<DeploymentSlot>Production</DeploymentSlot>
<Label>c2VydmVyMjAxNjA0Mjc=</Label>  
<RoleList>
    <Role>
        <RoleName>server20160427</RoleName>
        <RoleType>PersistentVMRole</RoleType>
        <LicenseType>Windows_Client</LicenseType>
        <ConfigurationSets>
            <ConfigurationSet i:type="WindowsProvisioningConfigurationSet">
                <ConfigurationSetType>WindowsProvisioningConfiguration</ConfigurationSetType>
                <ComputerName>server20160427</ComputerName>
                <AdminUsername>HMCBuser</AdminUsername>
                <AdminPassword>[email protected]$$w0rD2016!!</AdminPassword>
            </ConfigurationSet>
            <ConfigurationSet> 
                <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
                <InputEndpoints>
                    <InputEndpoint>
                        <LocalPort>3389</LocalPort>
                        <Name>Remote Desktop</Name> 
                        <Port>3389</Port>
                        <Protocol>TCP</Protocol>                    
                    </InputEndpoint>
                </InputEndpoints>
            </ConfigurationSet>
        </ConfigurationSets>
        <OSVirtualHardDisk>
            <MediaLink>http://server20160427031136.blob.core.windows.net/vhds/a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-20151022-en.us-127GB.vhd</MediaLink>     
            <SourceImageName>03f55de797f546a1b29d1b8d66be687a__Windows-7-Enterprise-N-x64-en.us-201507.20</SourceImageName>
        </OSVirtualHardDisk>
        <RoleSize>Basic_A0</RoleSize>     
    </Role>
</RoleList>
<ReservedIPName>ip-server20160427</ReservedIPName>

I've tried some solutions from the Azure forums. If I include the <LicenseType> the response doc says The x-ms-version header value '2014-05-01' is not one of the supported version headers.

The response doc says An administrator password must be specified. without the <LicenseType>.

This code was working previously, and it obeys the documentation for Service Manager Create VM, but on the azure forums I found that bad passsword errors can come from malformed or 'out of order' XMLs. Am I missing a dependency argument or something here?

restazureprovisioning

Answers

comments powered by Disqus