Connect to local CosmosDB emulator from Xamarin.Forms - xamarin.forms

I have a Xamarin app, which use Azure Storage and Azure Cosmos.
For now, both storage are emulated from my PC.
As well as a Pixel 2 from the Android emulator.
I found that I need to configure the ip as 10.0.2.2, even if I can't find this IP or even network on my PC.
Although, it works well with the storage account, I can connect to it.
But when I'm connecting to Cosmos, I get the following exception :
Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/boringssl/ssl/handshake_client.c:1132
I'm not an expert in Android, How can I add a custom certificate?
Or just disable SSL for Cosmos emulator?

Related

Meteor iOS app issue with AirWatch VPN Tunneling

We have developed a mobile app using Meteor+Ionic2. We use our internal NodeJS server which is not in internet zone. We got the app deployed to our enterprise app store which enables AirWatch VPN tunneling to get the access to server in intranet zone.
Everything works great when tested with iOS device level using "F5 Access" VPN when deployed using Xcode or enterprise app store with NO VPN tunneling . But when download the app from our enterprise app store which does per-app VPN using AirWatch VPN Tunneling, iOS app gets stuck at the splash screen. It is not seems to call any client side or server side code of Meteor+Ionic2.
When redeploying it using development distribution, It seems to be stays at about:blank and not going to localhost and getting "Failed to load resource" error in about:blank.
The same AirWatch VPN Tunneling works great in Android. This issue seems to be happening only in iOS. I checked device level logs and also AirWatch VPN tunnel logs which donesn't report any errors.
I'm not sure whether Meteor+Ionic2 supports AirWatch VPN Tunneling for iOS as none of framework codes get called. Is there anyway to debug the enterprise distributed app? Is VPN-Tunneling not supported in iOS app development using Meteor?
Thanks,
Annadurai.
The root cause of the issue seems to be AirWatch config which causes the localhost to be appended with domain name like localhost.mycompany.com. As AirWatch couldn't fix this issue, we dropped plan of using AirWatch VPN tunneling.

DocumentDB Emulator Remote Connection

Do we have any way to connect document dB emulator from remote system ?
Can we create procedure , triggers , user defined functions etcs in document db emulator ?
The Emulator is meant for local dev scenarios, since it runs exposing a local port, you probably could (never tried, this is purely theoretical) work around the firewall and expose it, then connect from another system using your external IP and the exposed port.
There is also the local SSL certificate that you must solve (that probably is the biggest issue), though you could try with the TCP connection setting, might want to check this thread about which ports need to be opened.
Also, the Emulator does not have the entire feature set that the live service does:
The DocumentDB Emulator supports only a single fixed account and a well-known master key. Key regeneration is not possible in the DocumentDB Emulator.
The DocumentDB Emulator is not a scalable service and will not support a large number of collections.
The DocumentDB Emulator does not simulate different DocumentDB consistency levels.
The DocumentDB Emulator does not simulate multi-region replication.
The DocumentDB Emulator does not support the service quota overrides that are available in the Azure DocumentDB service (e.g. document size limits, increased partitioned collection storage).
As your copy of the DocumentDB Emulator might not be up to date with the most recent changes with the Azure DocumentDB service, please DocumentDB capacity planner to accurately estimate production throughput (RUs) needs of your application.
So, you are probably better off installing the emulator on the other system via the installer or Chocolatey and avoid all the problems.
UPDATE: My following attempted solution doesn't work. Connection Timeout, 192.168.0.101:8881 using the Node.js DocumentDB sdk. I think because of SSL. :/ Sorry. Leaving this "Answer" for documentation on what doesn't work, and if anyone knows how to bypass DocumentDB Emulator SSL.
I am trying to connect DocumentDB Emulator across my local network. (I dev on a virtual machine)
I am trying to do a port forward, to the 8081 local port that DocumentDB Emulator listens on. In Command Prompt (Run as Administrator)
netsh interface portproxy add v4tov4 listenaddress=192.168.0.101 listenport=8080 connectport=8081 connectaddress=127.0.0.1
192.168.0.101 is the network address of the PC.
Now I'm able to navigate to:
https://192.168.0.101:8080/_explorer/index.html and see the data explorer. Optimistic I can get this working for dev, with SSL turned off?
Also tried to use node.js http-proxy couldn't get it working with self-signed certificates. :(
Update, I actually got http-proxy working, but it only works if you start the servers in a specific order...
start api server
start proxy server (on windows box) with secure: true
make a failed connection
change proxy server (on windows box) to secure: false; restart;
now it's working... but useless for dev, because if you restart the API server after code change, the connection fails again.
Sample Node.js Proxy to be run on Windows box:
```
var fs = require('fs'),
httpProxy = require('http-proxy');
//
// Create the proxy server listening on port 443
//
httpProxy.createServer({
ssl: {
key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
},
target: 'https://localhost:8081',
secure: true // Depends on your needs, could be false.
}).listen(8881);
```
You just need to start the documentdb with additional parameters:
start "" "c:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" /AllowNetworkAccess /NoFirewall /Key=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
Checkout the documentdb docker file for more details: https://github.com/Azure/azure-cosmos-db-emulator-docker/blob/master/package_scripts/startemu.cmd

Connecting to database in asp.net website by Wp8 app

I created localhost website in asp.net in Visual Studio and i added there a MSSQL connection.
My problem is that I created an app for windows phone 8 but i dont know how to connect this app with database which is on this website.
Can you help me with this?
First of all: your Windows Phone app can't connect to a SQL Server database, so you'll have to create an API.
Since you're using ASP.NET, I suggest to have a look at Web API. In short: you'll have several URL endpoints which return json/xml to your Windows Phone app. It's your job to query the database and return a single item/list of items in the controller of that URL endpoint (this sentence will make sense if you read into creating a Web API).
Next task is connecting to this API. Normally you would host it on a public url, so your phone device can connect to it (a phone doesn't know about your pc's localhost). If you want to use localhost with the emulator for testing, you'll have to execute the tasks mentioned in the quote below as this doesn't work out of the box.
When you create a WCF web service in Visual Studio, by default the
service is hosted in IIS Express and only accepts connections at
http://localhost/. Apps that target Windows Phone OS 7.1 can connect
to the development computer as localhost because the Windows Phone 7.1
emulator uses the network connection of the development computer. The
Windows Phone 8 Emulator, however, configures itself as a separate
device on the network. As a result, an app running on the Windows
Phone 8 Emulator can’t connect to the development computer as
localhost. Before you can connect successfully from the emulator to
the local web service, you have to make two changes:
You have to configure the local web service and web server to accept connections from other devices on the network.
You have to configure the service reference in the Windows Phone app to connect to the service by using the IP address of the development
computer on which the service is running.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/jj684580(v=vs.105).aspx

Access TFS from Azure Service

In my application, I have to show the work items of logged in user. I have tried to pull work items of TFS from the application and It’s working fine on local server, but when it is deployed to the cloud server, it is not working and getting error message saying ‘TF400324 : The remote name could not be resolved’, as a cloud application is trying to ping internal TFS.
Is there any way to connect to internal TFS from the application hosted on cloud server ?
Many thanks in advance..
You can setup an Azure VPN tunnel between your cloud service and your internal network:
http://azure.microsoft.com/en-us/services/virtual-network/
Or you could expose your internal TFS to the internet:
http://msdn.microsoft.com/en-us/library/bb668967.aspx
Or you could use the Azure BizTalk Hybrid Connections to enable the communication:
http://azure.microsoft.com/en-us/documentation/articles/integration-hybrid-connection-overview/
After multiple tries, Service Bus Relay Binding is the one, to ping on-premise environment(internal tfs) from azure cloud server(web role).
The below link works like charm..
Service Bus Relay Binding
Hope It Helps to Somebody who has faced the same issue I've faced. Have Fun..

How to connect Google TV remote app with Google TV emulator

As the title suggests, I have been unable to connect (and pair) the google tv remote app with a Google TV emulator running on Ubuntu. I understand that the emulator runs on its own sub-network and therefore has to use redirections in order to connect with anything outside its network.
I have tried the following:
1) Remote control app running on device,
2) Remote control app running on android emulator on same machine as the google tv emulator (For this I had to use a modified version of the app, since there is no wifi on the emulator and the official app would close without wifi)
In configuration (2) I have somehow managed to establish a connection with the tv emulator by using telnet and redirection commands (see this). However the app fails while trying to establish pairing as it tries to build a socket at a new (random) port which is not redirected (I assume).
I would firstly like to know how to find which ports to route for the google tv remote app to successfully connect with the TV emulator. And then how would the pairing action succeed in connecting the controller with the TV emulator through a new socket (which I couldn't redirect)
Any help will be greatly appreciated.
This feature is not supported. If you are working on a GoogleTV application that requires this feature, please fill out the form at goo.gl/tVw4i.

Resources