You can set an application key for your Azure Mobile App like Azure Mobile Services.
Definition | Value |
---|---|
zumo-api-key | TYPE YOUR API KEY |
MS_SkipVersionCheck | True |
sampleAPI.js AND sampleAPI.json
Do not forget to change permissions to "Anonymous"
sampleTable.js AND sampleTable.json
Do not forget to change permissions to "Anonymous"
Do not forget to add header while calling Azure Mobile/Web App.
**If you are using WindowsAzure.MobileServices
MobileServiceClient client = new MobileServiceClient(keys.mobileServiceAdress, keys.appSecret, new AppKeyHandler());
IMobileServiceTable<notifications> uTable = client.GetTable<notifications>();
await uTable.InsertAsync(n);
**If you are using Microsoft.Azure.Mobile.Client
MobileServiceClient client = new MobileServiceClient(keys.mobileServiceAdress, new AppKeyHandler());
IMobileServiceTable<notifications> uTable = client.GetTable<notifications>();
await uTable.InsertAsync(n);
public class AppKeyHandler : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("zumo-api-key", keys.mobileServiceKey);
return base.SendAsync(request, cancellationToken);
}
}
ps. Feel free to ask questions via "Issues".
thisisfatih.