Aleks G
Aleks G

Reputation: 57316

Deploying Azure Cloud Service (extended support) via REST API

I'm in the process of migrating from Cloud Service (classic) to Cloud Service (extended support) in Azure. Unfortunately, CS extended support documentation is very scarce and often inaccurate, so the process if very much not straight forward. At this point, I'm working on the deployment pipelines. With CS classic, we used management APIs to deploy/update/etc. The API for extended support is more straight forward, however, again, the documentation is lacking. The best I found was this page: Cloud Service - create or update. While this provides fairly good starting points, I'm struggling to find any info on the following points:

On authentication front, I managed to send the auth request and get the oauth2 token, which I would then use for this API - could this be enough? Of course, I can try this, but need to understand the other things first (i.e. format of some elements).

Note separately that deployment pipeline is executed from Jenkins and must stay that way - I don't have any control over that.

UPDATE: I tested this as best I could with service configuration being plain xml, with content matching the rest of json input, plain text password for RDP extension, and hoping for the auth to use bearer token. The response I received was 400, with the following details:

{
    "error": {
        "code": "InvalidParameter",
        "message": "The value of parameter packageUrl is invalid."
    }
}

So, back to my point 3 above - what is the format of package url?

UPDATE 2: After some experimenting, it did accept the package URL with the SAS token. Now I'm stuck with this error:

{
    "error": {
        "code": "StandardPublicIPAddressNotSupportedCloudService",
        "message": "Standard public IP not supported for cloud services."
    }
}

Web search for that string returns 0 matches. The template I'm using is copy/paste from MS documentation; the process I'm using is exactly per MS documentation. Any further help massively appreciated.

Upvotes: 0

Views: 1273

Answers (1)

Adam Marshall
Adam Marshall

Reputation: 126

This isn't exactly what you're after, but I used the following article to help with generating a template.json and parameter.json file which then could be used through Powershell.

https://techcommunity.microsoft.com/t5/azure-paas-blog/how-to-use-azure-devops-to-publish-cloud-service-extended/ba-p/3675180

This is what my Powershell script eventually looked like:

New-AzResourceGroupDeployment -ResourceGroupName "cses-rg" -TemplateFile DeployArm.template.json -TemplateParameterFile DeployArm.parameter.json -packageSasUri $cspkg -configurationSasUri $cscfg -cloudServiceName cldcsestest -deploymentLabel myDeploymentLabel -publicIPName 'MyPublicReservedIp' -rdpPassword $rdpPassword

I only used the Powershell script locally for quicker testing, but my goal was to get it working with Azure Dev Ops.

Upvotes: 0

Related Questions