简体   繁体   中英

Azure Powershell Deployment File Directory Error

Trying to deploy a service throws up an exception: 'Bad Request' and 'FileFormatException' error and cannot create the deployment.

This error notably only occurs when I test the script on a PC besides my personal laptop, even when I copy the folder in question directly into the C drive, so the file location should be the same.

Poking around online has suggested to me that I should upload the .cspkg and etc. files to Blob storage and then use them in the deployment, but wouldn't that run into the same problem if the issue arises from the script executing on a different computer?

I also cannot just upload the files onto the portal directly, as this is part of a project for an assignment and is meant to be completed solely through the command line.

Can anyone advise me if there is a way around this using a Powershell command, or if there's something I'm missing with the deployments?

EDIT: I have changed the code as follows:

#move the package to blob storage 
New-AzureStorageContainer elephant-container1 -Permission Container 
Set-AzureStorageBlobContent -Container elephant-container1 -File $package

#publish the deployment with both services to the staging environment
New-AzureDeployment -ServiceName "elephantService" -Slot Staging -Package "https://elephantaccount.blob.core.windows.net/elephant-container1/sad_SQL_Service_2015.cspkg" -Configuration $configuration -Label "elephantDeployment"
New-AzureDeployment -ServiceName "elephantService2" -Slot Staging -Package "https://elephantaccount.blob.core.windows.net/elephant-container1/sad_SQL_Service_2015.cspkg" -Configuration $configuration -Label "elephantDeployment"

And this again works fine on my own PC, but testing on another computer raises the following error:

New-AzureDeployment : BadRequest : Package conversion failed. Detailed error information: FileFormatException

etc. etc.

I am unsure if the problem is one of the package files. It is not the .cpskg not being on blob storage, as I have edited the code to use blob storage, and I have made the services beforehand. Does anyone have any enlightening advice??

您的软件包(cspkg)必须事先已上传到Blob存储位置,并且该位置的URL已提供给New-AzureDeployment Cmdlet。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM