1

From powershell, I am trying to add certificate to a service that was already created and I am running into the following error

Add-AzureCertificate : HTTP Status Code: NotFound - HTTP Error Message: https://management.core.windows.net/97d3cd24-78a1-44ba-aea4-0dd7c733cb56/services/hostedservices/XXXX /certificates does not exist.

Operation ID: dc1eabcef0c74861853fe53ed047f674 At + Add-AzureCertificate <<<< -ServiceName $servicename -CertToDeploy $CertificatePath -Password $Password + CategoryInfo : CloseError: (:) [Add-AzureCertificate], CommunicationException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.Certificates.AddAzureCertificate

This works fine on one subscription (say subscription A) but fails on each service in the subscription (say subscription B)

Wondering what this error actually means? I do see a folder by the name 'Certificates' under the service to which I am trying to add the certificate

I have also imported the appropriate publish settings of subscription A & B and I don't do anything different on subscription A to make it work!

Could you please help me on it?

1 Answer 1

1

If I understand it correct, It might be due subscription context. to In case of multiple Subscription, its necessary to change default context of Subscription in your power-shell for which you are trying to perform operation .

Example : Two : subscriptionA and subscriptionB

  1. Execute : Get-AzureSubscription
  2. Make sure you see all (2 in this case) subscriptions
  3. Use 'Select-AzureSubscription command to select context to the subscription where you want to perform operation .
  4. Use Set-AzureSubscription to set right context PS C:> Set-AzureSubscription -SubscriptionName SubscriptionA -CurrentStorageAccount < YourStorageaccountName>
  5. Run this to Verify that right Subscription is set : PS C:> Get-AzureSubscription -Current
  6. Perform your operation .
  7. Now go back to step 3 with SubscrptionB and continue.

-----------------This Might help to change the context ------------

Select-AzureSubscription

PS C:\> Select-AzureSubscription -SubscriptionName SubscriptionA

PS C:\>

Set-AzureSubscription

PS C:\> Set-AzureSubscription -SubscriptionName SubscriptionA -CurrentStorageAccount <YourStorageaccountName>

PS C:\>

Remove-AzureSubscription

PS C:\> Remove-AzureSubscription -SubscriptionName SubscriptionA -Force
    WARNING: The default subscription is being removed. Use Select-Subscription <subscriptionName> to select a new default subscription.
    WARNING: The current subscription is being removed. Use Select-Subscription <subscriptionName> to select a new current subscription.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Abhishek! This worked. However I think the "Set-AzureSubscription" is not required as the certificate is not uploaded to a blob in the storage account specified with the -CurrentStorageAccount parameter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.