小编mos*_*osu的帖子

Azure staging Web部署失败,错误为ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP,但不适用于生产

我正在尝试在Azure中进行自动化网站部署,而我正处于运行Web部署命令的阶段.用于生产的命令工作正常并更新内容但是用于登台的命令失败并且标题中包含错误代码.

我不确定问题是什么,如果是授权,我不知道在哪里为暂存帐户设置更多权限.

这是生产命令(有效):

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package="MyTestingSite.zip" -dest:auto,ComputerName="https://mytestingsite.scm.azurewebsites.net:443/msdeploy.axd?site=MyTestingSite",UserName="$mytestingsite",Password="fromProductionPublishProfile",authtype="Basic" -verb:sync
Run Code Online (Sandbox Code Playgroud)

这是用于暂存的(使用ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP失败)

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package="MyTestingSite.zip" -dest:auto,ComputerName="https://mytestingsite-staging.scm.azurewebsites.net:443/msdeploy.axd?site=MyTestingSite__staging",UserName="$MyTestingSite__staging",Password="fromStagingPublishProfile",authtype="Basic" -verb:sync -verbose
Run Code Online (Sandbox Code Playgroud)

非常感谢帮助!谢谢!

command-line azure webdeploy

7
推荐指数
2
解决办法
1756
查看次数

使用EnableSSL的FtpWebRequest

我实现了我的自定义FTP类来处理我正在支付的托管服务器.我使用FTP来备份,恢复和更新我的应用程序.我现在正处于想要让ssl投入生产的那一刻.我问我的托管公司他们是否支持ssl协议,他们说他们这样做.

所以我在Microsoft MSDN教程之后将我的方法修改为:

reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(m_ftpAddress.Trim()));
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(m_ftpUsername, m_ftpPassword);
reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;

ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);
                X509Certificate cert = new X509Certificate(path to a certificate created with makecert.exe);

reqFTP.ClientCertificates.Add(cert);
reqFTP.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested;
reqFTP.ImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification;

reqFTP.EnableSsl = true;
Run Code Online (Sandbox Code Playgroud)

现在,MSDN说如果服务器支持ssl协议,当被问到AUTH TLS时,它不会抛出异常.这可以在跟踪日志中看到.所以我认为这不是服务器问题.

在身份验证阶段之后,服务器返回a

System.Net信息:0:[0216] FtpControlStream#41622463 - 接收响应[227进入被动模式(IP和端口号).]

触发错误的消息:

System.Net错误:0:[0216] FtpWebRequest中的异常#12547953 :: GetResponse - 远程服务器返回错误:227进入被动模式(IP和端口号).

我试过设置

reqFTP.UsePassive = true;
Run Code Online (Sandbox Code Playgroud)

属性为false然后我收到此错误:

System.Net信息:0:[2692] FtpControlStream#4878312 - 收到回复[500 Illegal PORT command]

当然,如果没有将EnableSLL属性设置为true,一切都可以正常工作.

有没有人对此有任何想法?

编辑:我将代码修改为休耕:

reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(m_ftpAddress.Trim()));
reqFTP.UseBinary = true; …
Run Code Online (Sandbox Code Playgroud)

c# ftp ssl ftpwebrequest

5
推荐指数
1
解决办法
9839
查看次数

标签 统计

azure ×1

c# ×1

command-line ×1

ftp ×1

ftpwebrequest ×1

ssl ×1

webdeploy ×1