简体   繁体   English

如何将存储在Azure存储中的cspkg部署到Azure云服务(经典)?

[英]How to deploy an cspkg stored in Azure storage to Azure cloud services (classic)?

I am trying to deploy a cspkg file that is stored in a blob container in an Azure storage account using VSTS release pipeline. 我正在尝试使用VSTS发布管道来部署存储在Azure存储帐户的Blob容器中的cspkg文件。

I am trying to mimic the upgrade process of updating the cloud service with a new version so I have the current PROD version of the app in storage. 我正在尝试模仿使用新版本更新云服务的升级过程,因此我将应用程序的当前PROD版本存储在存储中。 I want to release this version to this test upgrade cloud service and then release the new version that is coming from TEST onto the test upgrade cloud service and then check that app still works. 我想将此版本发布到此测试升级云服务,然后将来自TEST的新版本发布到测试升级云服务,然后检查该应用程序是否仍然有效。

I am using an Azure PowerShell task to perform this process that is similar to an Azure Automation runbook that I used in the past to perform this operation. 我正在使用Azure PowerShell任务来执行此过程,该过程类似于我过去用来执行此操作的Azure自动化运行手册。

The first step is to get the cspkg file and get the url 第一步是获取cspkg文件并获取url

$pkgFile = Get-AzureRmStorageAccount -Name $StorageAccountName -ResourceGroupName $ResourceGroupName | Get-AzureStorageBlob -Container $ContainerName -Blob $BlobNamePackageFull
$package = $pkgFile.ICloudBlob.uri.AbsoluteUri

I also write the config file to a temp folder 我还将配置文件写入临时文件夹

$TempFileLocation = "C:\temp\$BlobNameConfiguration"
Get-AzureRmStorageAccount -Name $StorageAccountName -ResourceGroupName $ResourceGroupName | Get-AzureStorageBlobContent -Container $ContainerName -Blob $BlobNameConfiguration -Destination $TempFileLocation -Force

I then try to deploy the cloud service using New-AzureDeployment 然后,我尝试使用New-AzureDeployment部署云服务

New-AzureDeployment -ServiceName "$ServiceName" -Slot "$Slot" -Package "$package" -Configuration $TempFileLocation -Label "$Label" -ErrorAction Stop

I keep getting an error related to the default subscription not being set. 我不断收到与未设置默认订阅相关的错误。

Error details = No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.

I have used this task to run other tasks without having this error pop up. 我已经使用此任务运行其他任务,而没有弹出此错误。 I have tried using the subscription ID I used to run the Azure PowerShell task and got the following error even though the subscription exists. 我尝试使用用于运行Azure PowerShell任务的订阅ID,即使存在订阅,也遇到以下错误。

The subscription id XXX-XXX-XXXX doesn't exist

How can I run this cmdlet? 我如何运行此cmdlet? This does work in Azure Automation. 这在Azure自动化中有效。 Should I look at a different way to deploy an older version of a cspkg? 我是否应该考虑以其他方式部署较旧版本的cspkg?

For New-AzureDeployment command, it is classic command, so you need to choose Azure Classic as Azure Connection Type for Azure PowerShell task and specify a Classic endpoint. 对于New-AzureDeployment命令,它是经典命令,因此您需要选择Azure经典作为Azure PowerShell任务的Azure连接类型,并指定经典终结点。

So, you can add another PowerShell task with Azure Classic endpoint to call New-AzureDeployment to deploy. 因此,您可以使用Azure Classic终结点添加另一个PowerShell任务,以调用New-AzureDeployment进行部署。

On the other hand, there is Azure Deployment task that used to deploy Cloud Service. 另一方面,存在用于部署Cloud Service的Azure部署任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 播放2:如何将dist应用程序部署到Windows Azure云服务(不是VM) - Play 2: How to deploy dist app to the Windows Azure Cloud Services (not VM) 如何在Microsoft Azure云服务上部署django Web应用程序 - How to deploy django web application on Microsoft Azure cloud services 我可以使用Mac部署到Azure云服务吗? - Can I deploy to Azure Cloud Services with a mac? Azure cspkg上载速度 - Azure cspkg uploading speed 从Azure存储部署云服务 - Deploy Cloud Service from Azure Storage Azure-多个云服务,单个存储帐户 - Azure - Multiple Cloud Services, Single Storage Account 在Classic Cloud Services中可以使用ActiveDirectoryMembershipProvider,但不能在Azure Web App上使用 - Working ActiveDirectoryMembershipProvider in Classic Cloud Services but do not work on Azure Web App 将去往单个端点的流量重定向到Azure Cloud Services中的功能(经典) - Redirecting traffic going to a single endpoint to a function in Azure Cloud Services (classic) 如何强制Azure存储帐户作为经典 - How to force Azure Storage Account as classic 如何在远程桌面上编辑配置文件(Azure云服务(经典)文件的一部分)? - How to edit configuration files (part of Azure Cloud Services (Classic) files )on Remote Desktop?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM