Thursday, March 28, 2013

Cannot create/reset deployment credentials on an Azure Web Site?

Issue

I encountered a problem recently, attempting to browse Azure Web Site using FTP access. What I was actually trying to do is getting my custom logs written down to App_Data. In order to get FTP access, I started to create an account for this, according to my own understanding and many instructions in the Internet.



Having typed a (valid) user name and (valid) password, I pressed the tick to confirm creation/reset. It led me to error message like this (Failed to Set Credentials with error: "Please, try again. If the problem persists, contact support."):


Furthermore, my just typed credentials did not appear in the Quick Glance:

As you can see, I used free mode, so I could not figure on Microsoft support, since they give only Billing support for free plans:



You know, I even started of grief to think about writing a temporary custom viewer of App_Data.

Cause

To be honest, I did not find out the actual reason why my deployment/FTP user was Not Set. I don`t even know whether this was a temporary problem or a permanent bug. But...

Solution (workaround)

In spite of the fact that you cannot create an account for FTP access, there is one. Moreover, you can easily find it under the nearest link, namely "Download publish profile":


This link will download the well-known file of *.PublishSettings, it can be opened with well-known notepad. Actually, it contains two sections, one of which (//...@publishMethod=FTP) includes the information we are looking for (search for the words selected as bold and red below at once in the notepad):

<publishData>
  <publishProfile 
      profileName="{pubName} - Web Deploy"
      publishMethod="MSDeploy"
      publishUrl="{pubUrl}.publish.azurewebsites.windows.net:443"
      msdeploySite="{pubName}"
      userName="${pubName}"
      userPWD="{generatedPassword 1}"
      destinationAppUrl="http://{pubName}.azurewebsites.net"
      SQLServerDBConnectionString=""
      mySQLDBConnectionString=""
      hostingProviderForumLink=""
      controlPanelLink="http://windows.azure.com">
    <databases/>
  </publishProfile>
  <publishProfile
      profileName="{pubName} - FTP"
      publishMethod="FTP"
      publishUrl="ftp://waws-prod-bay-001.ftp.azurewebsites.windows.net/site/wwwroot"
      ftpPassiveMode="True"
      userName="{pubName}\${pubName}"
      userPWD="{generatedPassword 2}"
      destinationAppUrl="http://{pubName}.azurewebsites.net"
      SQLServerDBConnectionString=""
      mySQLDBConnectionString=""
      hostingProviderForumLink=""
      controlPanelLink="http://windows.azure.com">
    <databases/>
  </publishProfile>
</publishData>

Surprisingly, these credentials did the work properly. Of course, if not to forget to turn on Passive Mode for FTP. Now we've got  the FTP access and reviewed the content of App_Data folder even in free plan.

UPDATE. It looks like some information about this has already appeared in the Internet.

No comments:

Post a Comment