d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
246 stars 101 forks source link

Invoke-D365AzCopyTransfer gives Error parsing the argument "copy": parameter name is required. #396

Closed fivefq closed 4 years ago

fivefq commented 4 years ago

Version : 0.5.81 While trying to copy the files between two blobs, getting the below error.

The syntax of the command is incorrect. Error parsing the argument "copy": parameter name is required.

Invoke-D365AzCopyTransfer -SourceUri "https://uswedpl1catalog.blob.core.windows.net/product-financeandoperations/8e9a2c66-47fa-4cb6-892f-768a9c06ea20/FinanceandOperations-AX7ProductVersion-17-b89a7d24-38c6-497a-ad92-ecfe94e9ea9f-8e9a2c66-47fa-4cb6-892f-768a9c06ea20?sv=2015-12-11&sr=b&sig=<SAS key Masked>r" -DestinationUri "https://blobname.blob.core.windows.net/test-container/LMMYUATbackup.bacpac?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-03-18T15:03:31Z&st=2020-03-18T07:03:31Z&spr=https&sig=<SAS key Masked>" -ShowOriginalProgress -EnableException [2020/03/18 12:14:30][ERROR] The syntax of the command is incorrect. Error parsing the argument "copy": parameter name is required.

Splaxi commented 4 years ago

Try to leave the destination url to only point to the container level of your storage account.

Then supply the -Name "LMMYUATbackup.bacpac"

Splaxi commented 4 years ago

I was on mobile earlier, please try below script:

Invoke-D365AzCopyTransfer -SourceUri "https://uswedpl1catalog.blob.core.windows.net/product-financeandoperations/8e9a2c66-47fa-4cb6-892f-768a9c06ea20/FinanceandOperations-AX7ProductVersion-17-b89a7d24-38c6-497a-ad92-ecfe94e9ea9f-8e9a2c66-47fa-4cb6-892f-768a9c06ea20?sv=2015-12-11&sr=b&sig=<SAS key Masked>r" -DestinationUri "https://blobname.blob.core.windows.net/test-container?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-03-18T15:03:31Z&st=2020-03-18T07:03:31Z&spr=https&sig=<SAS key Masked>" -FileName "LMMYUATbackup.bacpac" -ShowOriginalProgress -EnableException
fivefq commented 4 years ago

Tried it. Dint work either. Not sure what I am doing wrong.

image

Splaxi commented 4 years ago

I'll double check in a few hours when the kids are sleeping.

Splaxi commented 4 years ago

Hi again.

I just did:

Update-Module d365fo.tools -Force -Confirm:$false
Import-Module d365fo.tools -Force
Invoke-D365InstallAzCopy
Invoke-D365AzCopyTransfer -SourceUri "https://uswedpl1catalog.blob.core.windows.net/product-navproductname/ee9f5369-6e2d-4ec8-a288-1c1348ae5a03/NavProductName-22-10-6ffd92c1-b99d-4d62-9a2c-4f3278adc44d-ee9f5369-6e2d-4ec8-a288-1c1348ae5a03?sv=2015-12-11&sr=b&sig=6%2BfZVlxWCvKHgd4U%2FCzVeAjac9IRUJ51o2Vezf%2BbzyE%3D&se=2020-03-19T18%3A21%3A21Z&sp=r" -DestinationUri  "https://motz.blob.core.windows.net/azcopytest?sv=2018-03-28&si=FullAccess&sr=c&sig=<masked>" -FileName "Temp.zip"

Could you please try and run the above, with your settings?

If it still fails, please try this:

Invoke-D365AzCopyTransfer -SourceUri "https://..." -DestinationUri "https://..." -OutputCommandOnly 

This should output the raw command that the module is trying to execute. Then we can see if something is off. It seems to indicate that we don't supply the "copy" keyword / parameter to the AzCopy.exe file - which we should.

Splaxi commented 4 years ago

@fivefq Did you have time to test my suggestion?

fivefq commented 4 years ago

Been little today. I will test this to night.

Regards Shafeeque Mohammed

On Thu, 19 Mar 2020 at 17:15, Mötz Jensen notifications@github.com wrote:

@fivefq https://github.com/fivefq Did you have time to test my suggestion?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/d365collaborative/d365fo.tools/issues/396#issuecomment-601170981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFTNYNDROMKSXI6CM6CXGVTRIILGZANCNFSM4LOKT2VA .

fivefq commented 4 years ago

@Splaxi : Thank you so much! That worked like a charm. I just followed all the steps in the first part of your response. Was outdated module on my PC creating the issue?

Splaxi commented 4 years ago

Maybe a little bit of errors in earlier versions and you not force updating things.

I would ALWAYS run the azcopy install, just to make sure that I'm on the latest version, when planning on working with azcopy.