You can download Windows 8 Consumer Preview and Visual Studio 11 (beta) here.
The new Windows Azure Toolkit for Windows 8 Consumer Preview makes it much easy for developers to use Windows Azure and the Windows Push Notification Services (WNS) for a Windows 8 Metro Style app. If you follow the instructions precisely, chances are you will be able to run the sample Margie’s Travel app, and create your own Windows 8 apps using the WNS.
However, you may have run into issues in two areas: one related to Windows Firewall and the other related to use of WNS credentials in your apps. Before discussing how to troubleshoot the potential issues, let’s take a quick look at how the WNS works. More detail here. You can skip this section if you are familiar with the WNS.
- Your app sends a request for a push notification channel to the Notification Client Platform.
- The Notification Client Platform asks WNS to create a notification channel. This channel is returned to the calling device in the form of a Uniform Resource Identifier (URI).
- The notification channel URI is returned by Windows to your app.
- Your app sends the URI to your own cloud service. This callback mechanism is an interface between your own app and your own service. It is your responsibility to implement this callback with safe and secure web standards.
- When your cloud service has an update to send, it notifies WNS using the channel URI. This is done by issuing an HTTP POST request, including the notification payload, over Secure Sockets Layer (SSL). This step requires authentication.
- WNS receives the request and routes the notification to the appropriate device.
Windows Firewall Rules
When you install the toolkit on Windows 8 Consumer Preview, the setup program checks dependencies and install all required programs such as Visual Web Developer 2010 Express and Windows Azure SDK in addition to Visual Studio 11 Express Beta For Windows 8.
During the setup, you will be asked to change Windows Firewall rules, install the 127.0.0.1 certificate, and add Loopback Exceptions for the WebAuthentication Broker.
You can check if the Windows Firewall rule for Windows Azure Toolkit for Windows 8 Local has been added. If not, try to re-run the setup or check if you have the permission to change the Windows Firewall rules. If your computer is domain joined, some firewall rules may be managed by Group Policy.
Remote Server 403 Error
if your applications are not registered with the WNS properly, you will likely experience this error, “The remote server returned an error: (403) Forbidden.” One possibility is that your Windows 8 Metro Style app uses an incorrect package name or one that is different from one for the registered cloud service app.
Using the toolkit, you will create and work with two applications: a Windows Azure cloud service application, which runs either locally with the emulator or in Windows Azure, and a Windows 8 Metro Style app. The cloud service app has to be registered with the WNS, and authenticated by the WNS using Package security identifier and Client secret before sending requests to the WNS. On the other hand, the Windows 8 app has to use the Package name for the registered cloud service app. If you register the Windows 8 app, and uses the new Package name associated with the registration, you will receive the 403 error.
Ports 443 or 10080
Make sure that these ports are not used in your local IIS web sites. As you compile the Windows Azure app, you may seen some output that looks like below:
Windows Azure Tools: Warning: Remapping private port 443 to 446 in role ‘zxdemoWin8CloudApp1.Web’ to avoid conflict during emulation.
Windows Azure Tools: Warning: Remapping private port 10080 to 10082 in role ‘zxdemoWin8CloudApp1.Web’ to avoid conflict during emulation.
This is fine as long as your cloud service app is running at port 443, for example, https://127.0.0.1.
If you see something like https://127.0.0.1:444, or any port number that is not 443, then you should check. If you are using the local development environment, you should shut down the local emulators, both the storage emulator and the computer emulator and start them again. Doing so ensures that the emulators are running for the current cloud service app.
Application Management Site for Metro style apps
You can register your cloud service app or Windows 8 Metro Style app at ttps://manage.dev.live.com/build
You can find a list of registered apps at https://manage.dev.live.com/Applications/Index that is associated with your Windows Live ID account.
Happy Coding! You can find my other Windows 8 Developer How To posts here.