从其他设备访问的Azure模拟器 [英] Accessing Azure Emulator from Another Device

查看:132
本文介绍了从其他设备访问的Azure模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的项目:


  1. 的Windows Phone 8应用程序,其中我是一个真实的,发展的物理设备上运行。

  2. 的Azure云服务,它包含一个包含ASP.NET MVC的WebAPI一个简单的WebRole端点。

我的目标很简单:

使用来自真实设备运行WP8应用程序,访问(使用了HTTPClient)中的WebAPI控制器,​​而它被部署到Azure的模拟器。

什么工作:


  1. 的应用程序时,它部署在碧霞可以成功的WebAPI沟通。

  2. 的应用程序可以当它是在本地托管的的WebAPI IIS防爆preSS (无天青)成功通信,以及 IIS防爆preSS 设置被更改之后的这个文章。

据我的理解,问题是,在Azure仿真器配置为侦听IP地址为127.0.0.1,这是不是从本地主机外域访问。

我发现这个帖子,提供了一个解决这个确切的问题,而是试图跟随它会导致未知异常,而试图将其部署到Azure的模拟器。

难道真的无法在本地与Azure的云服务?

通信测试WP8应用
解决方案

我想通了,它是如何可能有一个Phone模拟器或连接的物理的Windows Phone设备与Azure的模拟器。

通信

有关其他开发者使用相同的要求挣扎,下面是步骤需要为它工作:

假设:


  1. 您知道托管机器的IP地址。

  2. 没有防火墙阻止访问

  3. 关闭IIS和Azure的仿真器和配置更改后重新启动它们

Azure计算仿真器:


  1. 开启C:\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devfabric \\ DevFC.exe.config编辑

  2. 设置VipPoolStartIPAddressVipPoolEndIPAddress到你的主机机器的IP(例如192.168.1.100)

Azure存储模拟器:


  1. 开启这两个C:\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devstore \\ DSServiceLDB.exe.configC :\\ Program Files文件\\微软的SDK \\的Windows Azure \\模拟器\\ devstore \\ DSServiceSQL.exe.config编辑

  2. 服务部分中的两个的文件使用托管IP。

  3. 在角色设置(而不是默认的的Windows Azure存储模拟器设置)配置存储连接字符串:

    • 右键点击角色(下在Solution Explorer角色文件夹中)进入它的属性页。点击设置设置页。确保您编辑本地设置(选择它服务配置选择框)。

    • 编辑连接字符串的存储

    • 手动输入凭据

    • 账户名称和账号密码可在帐户写
    • 在第 DSServiceSQL.exe.config

    • 指定自定义端点,与您的托管IP。


享受!

I Have two different projects:

  1. Windows Phone 8 Application, which I am running on a real, physical development device.
  2. 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:

  1. The application can successfully communicate with the WebApi when it is deployed on Azure Cloud.
  2. The application can successfully communicate with the WebApi when it is hosted locally on IIS Express (Without Azure), and the IIS 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:

  1. You know the IP address of the hosting machine.
  2. No Firewall is blocking the access
  3. Shut down IIS and Azure Emulators and restart them after configuration changes

Azure Compute Emulator:

  1. Open "C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devfabric\DevFC.exe.config" for editing.
  2. Set "VipPoolStartIPAddress" and "VipPoolEndIPAddress" to your hosting machine IP (e.g. 192.168.1.100)

Azure Storage Emulator:

  1. 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.
  2. Set the services section in both of the files to use hosting IP.
  3. 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's Properties page. Click on Settings tab. Make sure you edit the Local settings (Select it on Service Configuration selection box).
    • Edit the Connection String for the storage
    • Manually enter credentials
    • Account name and account key are written under accounts section in DSServiceSQL.exe.config
    • Specify custom endpoints, with your hosting IP.

Enjoy!

这篇关于从其他设备访问的Azure模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆