none
Importing publish settings file from azure storage using power shell

    Question

  • I want to import publish settings file in powershell which is kept in azure storage. But it is not working I am trying the below command. If I use my local file system it works...

    Import-AzurePublishSettingsFile -PublishSettingsFile "https://.blob.core.windows.net/scripts/MyFile.publishsettings"

    How do I resolve this ?

    Friday, October 2, 2015 2:16 PM

Answers

  • Import-AzurePublishSettingsFile supports files located on either a local folder or an SMB share. You cannot use it to access to file contained on an Azure blob.

    To do that, you will have to download the file to a temporary location then make the import from that location.

    You can use AzCopy or Azure Powershell to download your file:

    AZcopy

    AzCopy.exe /Source:"https://.blob.core.windows.net/scripts/MyFile.publishsettings" /Dest:C:\temp


    Powershell

    Get-AzureStorageBlobContent -Container 'https://.blob.core.windows.net/scripts/' -Blob 'MyFile.publishsettings' -Destination C:\Temp\

    then

    Import-AzurePublishSettingsFile -PublishSettingsFile C:\temp\MyFile.publishsettings




    Regards, Samir Farhat || Datacenter Consultant || The way to share my knowledge with the community Visit my blog : buildwindows.wordpress.com

    Friday, October 2, 2015 2:28 PM

All replies

  • Import-AzurePublishSettingsFile supports files located on either a local folder or an SMB share. You cannot use it to access to file contained on an Azure blob.

    To do that, you will have to download the file to a temporary location then make the import from that location.

    You can use AzCopy or Azure Powershell to download your file:

    AZcopy

    AzCopy.exe /Source:"https://.blob.core.windows.net/scripts/MyFile.publishsettings" /Dest:C:\temp


    Powershell

    Get-AzureStorageBlobContent -Container 'https://.blob.core.windows.net/scripts/' -Blob 'MyFile.publishsettings' -Destination C:\Temp\

    then

    Import-AzurePublishSettingsFile -PublishSettingsFile C:\temp\MyFile.publishsettings




    Regards, Samir Farhat || Datacenter Consultant || The way to share my knowledge with the community Visit my blog : buildwindows.wordpress.com

    Friday, October 2, 2015 2:28 PM
  • I understand but I want to execute powershell files in Release management VSO.. i cant use AzCopy there..
    Friday, October 2, 2015 2:35 PM
  • Just want to make sure of this. You are inserting your real storage account name in the address to blob storage, right? Like [http://myaccount.blob.core.windows.net] rather than [http://.blob.core.windows.net]?

    Robin

    Monday, October 5, 2015 4:46 AM
  • As Samir suggested, you can use Powershell or AzCopy. You don't have to use AzCopy. Use the Get-AzureStorageBlobContent cmdlet to download the publish settings to your local machine and then import the publish settings file.
    Friday, October 16, 2015 6:20 PM
    Moderator