0
votes

We have an App Service (Web App) in Azure with 3 deployment slots.

I'm currently building a deployment script in powershell to use on our Team City build server to deploy to our staging environment but I have run into a problem.

When I run the New-AzureDeployment command I get the following error:

New-AzureDeployment : ResourceNotFound: The hosted service does not exist.
OperationID : 'c50c73c0f8219d47adb1e579065b267a'
At C:\sourcecode\econ-appstore\scripts\azure-deployment.ps1:70 char:15
+     $opstat = New-AzureDeployment -Slot $slot -Package $packageLocation -Configu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureDeployment], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.NewAzureDeploymentCommand

I do run the the following commands before:

Import-AzurePublishSettingsFile $pubsettings
Set-AzureSubscription -CurrentStorageAccountName $storageAccountName -SubscriptionName $selectedsubscription
Select-AzureSubscription $selectedsubscription

So I looked at the management rest api that azure have, specifically the https://management.core.windows.net/$subscriptionId/services/hostedservices endpoint and I get nothing back. So it seems I have no hosted services.

What do I have to do to make my app service a hosted service? I can't find any info or guide to this.

Help would be much appreciated.

-- Edit ---

Thx to Alexandr I found the following command: Publish-AzureWebsiteProject

This will deploy your project for you. You need to change your msbuild script to output your web deploy package as a zip file but that's it.

Thx for the help!

1

1 Answers

0
votes

That commandlet creates the service based on the cloud service model. Is that what you want? You mentioned Web App - maybe New-AzureWebSite commandlet is what you want? The error is connected with the Cloud Service - create it using the portal or the commandlet.