从其他设备访问的Azure模拟器 [英] Accessing Azure Emulator from Another Device
问题描述
我有两个不同的项目:
- 的Windows Phone 8应用程序,其中我是一个真实的,发展的物理设备上运行。
- 的Azure云服务,它包含一个包含ASP.NET MVC的WebAPI一个简单的WebRole端点。
我的目标很简单:
使用来自真实设备运行WP8应用程序,访问(使用了HTTPClient)中的WebAPI控制器,而它被部署到Azure的模拟器。
什么工作:
- 的应用程序时,它部署在碧霞可以成功的WebAPI沟通。
- 的应用程序可以当它是在
本地托管的的WebAPI IIS防爆preSS
(无天青)成功通信,以及IIS防爆preSS
设置被更改之后的这个文章。
据我的理解,问题是,在Azure仿真器配置为侦听IP地址为127.0.0.1,这是不是从本地主机外域访问。
我发现这个帖子,提供了一个解决这个确切的问题,而是试图跟随它会导致未知异常,而试图将其部署到Azure的模拟器。
难道真的无法在本地与Azure的云服务?
通信测试WP8应用我想通了,它是如何可能有一个Phone模拟器或连接的物理的Windows Phone设备与Azure的模拟器。
通信有关其他开发者使用相同的要求挣扎,下面是步骤需要为它工作:
假设:
- 您知道托管机器的IP地址。
- 没有防火墙阻止访问
- 关闭IIS和Azure的仿真器和配置更改后重新启动它们
Azure计算仿真器:
- 开启
C:\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devfabric \\ DevFC.exe.config
编辑 。 - 设置
VipPoolStartIPAddress
和VipPoolEndIPAddress
到你的主机机器的IP(例如192.168.1.100)
Azure存储模拟器:
- 开启这两个
C:\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devstore \\ DSServiceLDB.exe.config
和C :\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devstore \\ DSServiceSQL.exe.config
编辑 - 将
服务
部分中的两个的文件使用托管IP。 - 在角色设置(而不是默认的
的Windows Azure存储模拟器
设置)配置存储连接字符串:- 右键点击
角色
(下在Solution Explorer角色文件夹中)进入它的属性
页。点击设置
设置页。确保您编辑本地
设置(选择它服务配置
选择框)。 - 编辑连接字符串的存储
- 手动输入凭据
账户名称和账号密码可在帐户写
在第DSServiceSQL.exe.config
- 右键点击
- 指定自定义端点,与您的托管IP。
享受!
I Have two different projects:
- Windows Phone 8 Application, which I am running on a real, physical development device.
- Azure Cloud service, which contains one simple WebRole endpoint that contains a ASP.NET MVC WebAPI.
My goal is simple:
Use the WP8 Application running from a real device, to access (using HTTPClient) the WebAPI controller while it is deployed to the Azure Emulator.
What DO work is:
- The application can successfully communicate with the WebApi when it is deployed on Azure Cloud.
- The application can successfully communicate with the WebApi when it is hosted locally on
IIS Express
(Without Azure), and theIIS Express
settings are changed following this article.
As far as I understand, the problem is that the Azure Emulator is configured to listen on IP address 127.0.0.1, which is not accessible from outside the localhost domain.
I found this post that offers a solution to this exact problem, but trying to follow it results in an Unknown Exception while trying to deploy to Azure Emulator.
Is it really impossible to locally test WP8 application that communicates with Azure Cloud Service?
I figured out how it is possible to have a Phone Emulator or an attached physical Windows Phone device communicating with the Azure Emulator.
For other developers struggling with the same requirement, here are the steps required for it to work:
Assumptions:
- You know the IP address of the hosting machine.
- No Firewall is blocking the access
- Shut down IIS and Azure Emulators and restart them after configuration changes
Azure Compute Emulator:
- Open
"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devfabric\DevFC.exe.config"
for editing. - Set
"VipPoolStartIPAddress"
and"VipPoolEndIPAddress"
to your hosting machine IP (e.g. 192.168.1.100)
Azure Storage Emulator:
- Open both
"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceLDB.exe.config"
and"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceSQL.exe.config"
for editing. - Set the
services
section in both of the files to use hosting IP. - Configure the Storage Connection String in the "Role" settings (instead of default
Windows Azure storage emulator
setting):- Right click on the
Role
(under "Roles" folder in the solution explorer) to enter it'sProperties
page. Click onSettings
tab. Make sure you edit theLocal
settings (Select it onService Configuration
selection box). - Edit the Connection String for the storage
- Manually enter credentials
- Account name and account key are written under
accounts
section inDSServiceSQL.exe.config
- Specify custom endpoints, with your hosting IP.
- Right click on the
Enjoy!
这篇关于从其他设备访问的Azure模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!