Create Azure Cloud Service Programatically

ramukaka 1 Reputation point
2021-01-12T16:18:27.11+00:00

I am trying to create Azure Cloud Service Classic. However, I keep getting error "The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription." for all API endpoint for Azure Cloud Services.

Below is an example of error that I receive when trying to list Azure Cloud Services.

55753-selection-013.png

55812-screenshot-from-2021-01-12-21-53-04.png

Previously, I was creating Azure Cloud Service classic using docker based Azure CLI azure-cli:0.10.14 . However, I am receiving similar error as stated above since past few days using Azure CLI as well.

56006-screenshot-from-2021-01-13-08-15-21.png

It would be very kind of you if you let me know what am I doing wrong.

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,976 Reputation points Microsoft Employee Moderator
    2021-01-19T07:12:27.06+00:00

    @ramukaka Apologies for the delay in response and all the inconvenience caused because of the issue.

    Can you refer to below steps as mentioned here and see if it helps you out with your issue:

    • Open Windows Powershell on VM
    • Run "Get-AzurePublishSettingsFile". It will ask you to login to Azure and you will get the publish setting file for your Azure Subscription associated with your account.
    • Then run "Add-AzureAccount", It will ask you to login and your account will be added to powershell.
    • Login to Azure Portal (manage.windowsazure.com).
    • Go to Settings => Management Certificates section. Get the ThumbPrint of the recently added PublishSettingCertificate.
    • On Powershell run Import-AzurePublishSettingsFile "path of your publish setting file on VM"
    • Run Add-AzureCertificate -serviceName "Your service Name" -certToDeploy (get-item cert:\CurrentUser\MY"Certificate ThumbPrint you got from Azure")
    • Finally "Get-AzureSubscription", to see the subscriptions added on Powershell.

    You can refer this as well for troubleshooting this error.

    Hope it helps!!!

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as convenient to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.