I want to deploy my application on azure using powershell. While I created the certificate in the localmachine store, I will not start the deployment of the script as I downloaded the script in azure. The next step is to access the service on the azure screen in PowerShell, but it does not work there. script I still have:
$cert = Get-Item Cert:\LocalMachine\deploy\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Set-AzureSubscription -SubscriptionName $subscriptionName -SubscriptionId $subscriptionId -Certificate $cert Select-AzureSubscription $subscriptionName $service = Get-AzureService $azureId
The last line displays the following message:
Get-AzureService : Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. At F:\DeployTest\deploy.ps1:9 char:12 + $service = Get-AzureService $azureId + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Get-AzureService], Exception + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.GetAzureServiceCommand Get-AzureService : HTTP Status Code: AuthenticationFailed - HTTP Error Message: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription. Operation ID: At F:\DeployTest\deploy.ps1:9 char:12 + $service = Get-AzureService $azureId + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-AzureService], CommunicationException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.HostedServices.GetAzureServiceCommand
I really don't know what the problem is, the certificate I'm trying to use is loading, so it seems that there is something fundamental that I missed.
Update: I got it to work after loading the .publishsettings file and importing, instead of trying to use Set-AzureSubscription . I'm still a little confused, but shouldn't I use the method I tried above?
source share